[openib-general] 2.6.12 Kernel OpenIB support

Tom Duffy tduffy at sun.com
Fri Jul 15 14:10:31 PDT 2005


On Fri, 2005-07-15 at 13:48 -0700, Roland Dreier wrote:
> I'm not sure what the right solution is yet.  Long term I guess
> sockaddr_ll should grow.  I think that right now the address is being
> cut off -- so arping.c can probably be fixed by replacing all uses of
> foo.sll_halen with min(foo.sll_halen, sizeof foo.sll_addr).

Filed bug and submitted patch (for Fedora anyways):

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=163383

-tduffy

diff -urp iputils/arping.c iputils.tom/arping.c
--- iputils/arping.c	2005-07-15 13:51:15.533632784 -0700
+++ iputils.tom/arping.c	2005-07-15 13:50:47.967823000 -0700
@@ -59,6 +59,8 @@ int received = 0, brd_recv, req_recv;
 #define MS_TDIFF(tv1,tv2) ( ((tv1).tv_sec-(tv2).tv_sec)*1000 + \
 			   ((tv1).tv_usec-(tv2).tv_usec)/1000 )
 
+#define min(x,y) ((x)<(y) ? (x) : (y))
+
 void usage(void)
 {
 	fprintf(stderr,
@@ -476,7 +478,7 @@ main(int argc, char **argv)
 	}
 
 	he = me;
-	memset(he.sll_addr, -1, he.sll_halen);
+	memset(he.sll_addr, -1, min(he.sll_halen, sizeof he.sll_addr));
 
 	if (!quiet) {
 		printf("ARPING %s ", inet_ntoa(dst));




More information about the general mailing list