Skip to contentSkip to conversation

fix ifenslave to not fail on lack of IP information

PATCH Neil Horman 1 participant 1 message Nov 15, 2005 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive
Quoted 6 lines · Jay Vosburgh

You never did say which version of bonding you're using (or I
just cleverly missed it) , but I assume it's an old one, 2.5.something I'd guess, with the old abi. For that case, yes, your patch makes sense.

The RHEL kernel series use a variety of different versions of the bonding driver, and yes, some of the prievious update releases use a older version of the bonding abi.

Quoted 10 lines

Can you rework your patch to also remove the fprintf and post
that to the usual lists? If it's not an error to fail to set the address, there's no reason to complain about it. In truth, the set_if_addr() is all cosmetic; the kernel doesn't actually use that information for the slaves, so we could arguably remove it totally, but that might confuse end users. Plus, ifenslave is on its way out, so I'd just as soon not change it more than necessary.

	-J

As requested, here is a rework of my previous patch, removing the unneeded fprintf bits. Tested successfully by me, and several of the origional reporters.

Regards
Neil

 ifenslave.c |    9 +--------
 1 files changed, 1 insertion(+), 8 deletions(-)
Documentation/networking/ifenslave.c +1 -8
@@ -693,13 +693,7 @@ static int enslave(char *master_ifname, 
 		/* Older bonding versions would panic if the slave has no IP
 		 * address, so get the IP setting from the master.
 		 */
-		res = set_if_addr(master_ifname, slave_ifname);
-		if (res) {
-			fprintf(stderr,
-				"Slave '%s': Error: set address failed\n",
-				slave_ifname);
-			return res;
-		}
+		set_if_addr(master_ifname, slave_ifname);
 	} else {
 		res = clear_if_addr(slave_ifname);
 		if (res) {
@@ -1085,7 +1079,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;
Signature · 5 lines
/***************************************************
 *Neil Horman
 *Software Engineer
 *gpg keyid: 1024D / 0x92A74FA1 - http://pgp.mit.edu
 ***************************************************/