svn commit: trunk/busybox/networking/libiproute

aldot at busybox.net aldot at busybox.net
Fri May 16 10:19:03 PDT 2008


Author: aldot
Date: 2008-05-16 10:19:03 -0700 (Fri, 16 May 2008)
New Revision: 21993

Log:
- accept ip l s ib0 addr 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00


Modified:
   trunk/busybox/networking/libiproute/iplink.c


Changeset:
Modified: trunk/busybox/networking/libiproute/iplink.c
===================================================================
--- trunk/busybox/networking/libiproute/iplink.c	2008-05-16 16:55:17 UTC (rev 21992)
+++ trunk/busybox/networking/libiproute/iplink.c	2008-05-16 17:19:03 UTC (rev 21993)
@@ -130,9 +130,11 @@
 	memset(ifr, 0, sizeof(*ifr));
 	strncpy(ifr->ifr_name, dev, sizeof(ifr->ifr_name));
 	ifr->ifr_hwaddr.sa_family = hatype;
-	alen = ll_addr_a2n((unsigned char *)(ifr->ifr_hwaddr.sa_data), 14, lla);
+
+	alen = hatype == 1/*ARPHRD_ETHER*/ ? 14/*ETH_HLEN*/ : 19/*INFINIBAND_HLEN*/;
+	alen = ll_addr_a2n((unsigned char *)(ifr->ifr_hwaddr.sa_data), alen, lla);
 	if (alen < 0)
-		exit(1);
+		exit(EXIT_FAILURE);
 	if (alen != halen) {
 		bb_error_msg_and_die("wrong address (%s) length: expected %d bytes", lla, halen);
 	}



More information about the busybox-cvs mailing list