svn commit: trunk/busybox/libbb

vda at busybox.net vda at busybox.net
Wed Dec 10 11:24:33 UTC 2008


Author: vda
Date: 2008-12-10 03:24:33 -0800 (Wed, 10 Dec 2008)
New Revision: 24355

Log:
add a note that SO_BINDTODEVICE needs padded iface name on 2.6.26



Modified:
   trunk/busybox/libbb/xconnect.c


Changeset:
Modified: trunk/busybox/libbb/xconnect.c
===================================================================
--- trunk/busybox/libbb/xconnect.c	2008-12-10 11:16:47 UTC (rev 24354)
+++ trunk/busybox/libbb/xconnect.c	2008-12-10 11:24:33 UTC (rev 24355)
@@ -24,7 +24,9 @@
 	int r;
 	struct ifreq ifr;
 	strncpy_IFNAMSIZ(ifr.ifr_name, iface);
-	/* Actually, ifr_name is at offset 0, and in practice
+	/* NB: passing (iface, strlen(iface) + 1) does not work!
+	 * (maybe it works on _some_ kernels, but not on 2.6.26)
+	 * Actually, ifr_name is at offset 0, and in practice
 	 * just giving char[IFNAMSIZ] instead of struct ifreq works too.
 	 * But just in case it's not true on some obscure arch... */
 	r = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr));




More information about the busybox-cvs mailing list