mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix ifenslave to not fail on lack of IP information
@ 2005-11-04 16:54 Neil Horman
  2005-11-07  6:23 ` Willy Tarreau
  0 siblings, 1 reply; 3+ messages in thread
From: Neil Horman @ 2005-11-04 16:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: bonding-devel, nhorman, ctindel, fubar, akpm

[-- Attachment #1: Type: text/plain, Size: 1812 bytes --]

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 <nhorman@tuxdriver.com>


 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 #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-11  4:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-04 16:54 [PATCH] fix ifenslave to not fail on lack of IP information Neil Horman
2005-11-07  6:23 ` Willy Tarreau
2005-11-11  4:20   ` Rob Landley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome