* [ECOS] manual networking configuration warning
@ 2005-05-05 16:41 Brad Petrus (RTC)
2005-05-05 16:45 ` Gary Thomas
0 siblings, 1 reply; 2+ messages in thread
From: Brad Petrus (RTC) @ 2005-05-05 16:41 UTC (permalink / raw)
To: eCos Discussion
Hi,
I am trying to manually configure a network interface, eth0, and am
getting the following warning:
/ [eth_drv_ioctl] Warning: Driver can't set multi-cast mode
/
Below is the sequence of ioctl() calls I am using together with the
output from show_network_tables() in italics.
The warning occurs each time I try to set the IP address for the
interface. Am I missing something
or is this just some warning that can be ignored?
Brad
-------------------------------------------------------------------------------------
struct ifreq ifr;
struct sockaddr_in *pAddr = ass_dc_NULL;
init_all_network_interfaces();
int sock = ::socket(AF_INET, SOCK_STREAM, 0) );
if(-1 == sock) {
dm_return(false);
}
show_network_tables((pr_fun *)diag_printf);
/ Routing tables
Destination Gateway Mask Flags Interface
127.0.0.0 127.0.0.1 255.0.0.0 UG lo0
127.0.0.1 127.0.0.1 UH lo0
Interface statistics
lo0 IP: 127.0.0.1, Broadcast: 127.0.0.1, Netmask: 255.0.0.0
UP LOOPBACK RUNNING MULTICAST MTU: 16384, Metric: 0
Rx - Packets: 0, Bytes: 0, Tx - Packets: 0, Bytes: 0/
// configure the address, netmask, ...
// assume interface is 'eth0'
memset(&ifr, 0, sizeof(struct ifreq));
strncpy(ifr.ifr_name, "eth0", IFNAMSIZ); // 'eth0' interface
// (a) get current address
if(-1 == ioctl(sock, SIOCGIFADDR, &ifr)) {
// this isn't a critical error, so no need to close socket and return
dm_echo(("Unable to obtain IP address\n"));
}
// (b) delete current address
if(-1 == ioctl(sock, SIOCDIFADDR, &ifr)) {
// this isn't a critical error, so no need to close socket and return
dm_echo(("Unable to remove IP address\n"));
}
show_network_tables((pr_fun *)diag_printf);
/
Routing tables
Destination Gateway Mask Flags Interface
127.0.0.0 127.0.0.1 255.0.0.0 UG lo0
127.0.0.1 127.0.0.1 UH lo0
Interface statistics
lo0 IP: 127.0.0.1, Broadcast: 127.0.0.1, Netmask: 255.0.0.0
UP LOOPBACK RUNNING MULTICAST MTU: 16384, Metric: 0
Rx - Packets: 0, Bytes: 0, Tx - Packets: 0, Bytes: 0/
// (c) set current address
// NOTE: do we need to set the port here too
memset(&ifr, 0, sizeof(struct ifreq));
pAddr = (struct sockaddr_in *)&(ifr.ifr_addr);
memset(pAddr, 0, sizeof(struct sockaddr_in));
pAddr->sin_len = sizeof(struct sockaddr_in);
pAddr->sin_family = AF_INET;
pAddr->sin_addr.s_addr = inet_addr(getSocketAddress());
strncpy(ifr.ifr_name, "eth0", IFNAMSIZ);
if(-1 == ioctl(sock, SIOCSIFADDR, &ifr)) {
closeSocket(sock);
dm_echo(("Unable to add IP address\n"));
dm_return(false);
}
/[eth_drv_ioctl] Warning: Driver can't set multi-cast mode/
show_network_tables((pr_fun *)diag_printf);
/ Routing tables
Destination Gateway Mask Flags Interface
10.0.0.0 10.0.0.0 255.0.0.0 U eth0
127.0.0.0 127.0.0.1 255.0.0.0 UG lo0
127.0.0.1 127.0.0.1 UH lo0
Interface statistics
eth0 IP: 10.25.59.211, Broadcast: 10.255.255.255, Netmask:
255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU: 1500, Metric: 0
Rx - Packets: 0, Bytes: 0, Tx - Packets: 0, Bytes: 0
lo0 IP: 127.0.0.1, Broadcast: 127.0.0.1, Netmask: 255.0.0.0
UP LOOPBACK RUNNING MULTICAST MTU: 16384, Metric: 0
Rx - Packets: 0, Bytes: 0, Tx - Packets: 0, Bytes: 0/
// (d) set mask
pAddr->sin_addr.s_addr = inet_addr("255.255.255.0");
if(-1 == ioctl(sock, SIOCSIFNETMASK, &ifr)) {
closeSocket(sock);
dm_echo(("Unable to set net mask\n"));
dm_return(false);
}
show_network_tables((pr_fun *)diag_printf);
/ Routing tables
Destination Gateway Mask Flags Interface
10.0.0.0 10.0.0.0 255.0.0.0 U eth0
127.0.0.0 127.0.0.1 255.0.0.0 UG lo0
127.0.0.1 127.0.0.1 UH lo0
Interface statistics
eth0 IP: 10.25.59.211, Broadcast: 10.255.255.255, Netmask:
255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU: 1500, Metric: 0
Rx - Packets: 0, Bytes: 0, Tx - Packets: 0, Bytes: 0
lo0 IP: 127.0.0.1, Broadcast: 127.0.0.1, Netmask: 255.0.0.0
UP LOOPBACK RUNNING MULTICAST MTU: 16384, Metric: 0
Rx - Packets: 0, Bytes: 0, Tx - Packets: 0, Bytes: 0/
// (e) set the address again
// NOTE: according to gary thomas in
// <http://article.gmane.org/gmane.os.ecos.general/6372>
// the address must be set a second time ?
pAddr->sin_addr.s_addr = inet_addr(getSocketAddress());
if(-1 == ioctl(sock, SIOCSIFADDR, &ifr)) {
closeSocket(sock);
dm_echo(("Unable to add IP address\n"));
dm_return(false);
}
/[eth_drv_ioctl] Warning: Driver can't set multi-cast mode/
show_network_tables((pr_fun *)diag_printf);
/ Routing tables
Destination Gateway Mask Flags Interface
10.25.59.0 10.25.59.0 255.255.255.0 U eth0
127.0.0.0 127.0.0.1 255.0.0.0 UG lo0
127.0.0.1 127.0.0.1 UH lo0
Interface statistics
eth0 IP: 10.25.59.211, Broadcast: 10.25.59.255, Netmask:
255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU: 1500, Metric: 0
Rx - Packets: 0, Bytes: 0, Tx - Packets: 0, Bytes: 0
lo0 IP: 127.0.0.1, Broadcast: 127.0.0.1, Netmask: 255.0.0.0
UP LOOPBACK RUNNING MULTICAST MTU: 16384, Metric: 0
Rx - Packets: 0, Bytes: 0, Tx - Packets: 0, Bytes: 0/
// (e) broadcast address
pAddr->sin_addr.s_addr = inet_addr("0.0.0.0");
if(-1 == ioctl(sock, SIOCSIFBRDADDR, &ifr)) {
closeSocket(sock);
dm_echo(("Unable to set broadcast address\n"));
dm_return(false);
}
show_network_tables((pr_fun *)diag_printf);
/ Routing tables
Destination Gateway Mask Flags Interface
10.25.59.0 10.25.59.0 255.255.255.0 U eth0
127.0.0.0 127.0.0.1 255.0.0.0 UG lo0
127.0.0.1 127.0.0.1 UH lo0
Interface statistics
eth0 IP: 10.25.59.211, Broadcast: 0.0.0.0, Netmask: 255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU: 1500, Metric: 0
Rx - Packets: 0, Bytes: 0, Tx - Packets: 0, Bytes: 0
lo0 IP: 127.0.0.1, Broadcast: 127.0.0.1, Netmask: 255.0.0.0
UP LOOPBACK RUNNING MULTICAST MTU: 16384, Metric: 0
Rx - Packets: 0, Bytes: 0, Tx - Packets: 0, Bytes: 0
/
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [ECOS] manual networking configuration warning
2005-05-05 16:41 [ECOS] manual networking configuration warning Brad Petrus (RTC)
@ 2005-05-05 16:45 ` Gary Thomas
0 siblings, 0 replies; 2+ messages in thread
From: Gary Thomas @ 2005-05-05 16:45 UTC (permalink / raw)
To: Brad Petrus (RTC); +Cc: eCos Discussion
On Thu, 2005-05-05 at 12:41 -0400, Brad Petrus (RTC) wrote:
> Hi,
>
> I am trying to manually configure a network interface, eth0, and am
> getting the following warning:
> / [eth_drv_ioctl] Warning: Driver can't set multi-cast mode
> /
> Below is the sequence of ioctl() calls I am using together with the
> output from show_network_tables() in italics.
>
> The warning occurs each time I try to set the IP address for the
> interface. Am I missing something
> or is this just some warning that can be ignored?
As long as you don't care about multicast support (including IPv6), this
can safely be ignored.
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-05-05 16:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-05 16:41 [ECOS] manual networking configuration warning Brad Petrus (RTC)
2005-05-05 16:45 ` Gary Thomas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).