The current version of ifenslave fails to attach slave interfaces to a bond if the masters doesn't have appropriate IP information. While its common for bonded interface to have IP information its not required (bond as part of a bridge for instance). This patch modifies ifenslave to not fail if IP information is not available in the master at the time of enslaving. Regards Neil Signed-off-by: Neil Horman <[email protected]> ifenslave.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Documentation/networking/ifenslave.c b/Documentation/networking/ifenslave.c --- a/Documentation/networking/ifenslave.c +++ b/Documentation/networking/ifenslave.c @@ -517,11 +517,10 @@ static int if_getconfig(char *ifname) ifname, ifr.ifr_flags); strcpy(ifr.ifr_name, ifname); - if (ioctl(skfd, SIOCGIFADDR, &ifr) < 0) - return -1; - printf("The result of SIOCGIFADDR is %2.2x.%2.2x.%2.2x.%2.2x.\n", - ifr.ifr_addr.sa_data[0], ifr.ifr_addr.sa_data[1], - ifr.ifr_addr.sa_data[2], ifr.ifr_addr.sa_data[3]); + if (ioctl(skfd, SIOCGIFADDR, &ifr) >= 0) + printf("The result of SIOCGIFADDR is %2.2x.%2.2x.%2.2x.%2.2x.\n", + ifr.ifr_addr.sa_data[0], ifr.ifr_addr.sa_data[1], + ifr.ifr_addr.sa_data[2], ifr.ifr_addr.sa_data[3]); strcpy(ifr.ifr_name, ifname); if (ioctl(skfd, SIOCGIFHWADDR, &ifr) < 0) @@ -1085,7 +1084,6 @@ static int set_if_addr(char *master_ifna slave_ifname, ifra[i].req_name, strerror(saved_errno)); - return res; } ipaddr = ifr.ifr_addr.sa_data; -- /*************************************************** *Neil Horman *Software Engineer *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu ***************************************************/
Attachment:
pgpNoeyOwoIvU.pgp
Description: PGP signature
- Follow-Ups:
- Re: [PATCH] fix ifenslave to not fail on lack of IP information
- From: Willy Tarreau <[email protected]>
- Re: [PATCH] fix ifenslave to not fail on lack of IP information
- Prev by Date: Re: [Lhms-devel] [PATCH 0/7] Fragmentation Avoidance V19
- Next by Date: Re: [RFC,PATCH] libfs dcache_readdir() and dcache_dir_lseek() bugfix
- Previous by thread: TSC and Power Management Events on AMD Processors
- Next by thread: Re: [PATCH] fix ifenslave to not fail on lack of IP information
- Index(es):