This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: test_ifindex, current CVS glibc && Linux 2.3.5


>>>>> David S Miller writes:

 >    From: Andreas Jaeger <aj@arthur.rhein-neckar.de>
 >    Date: 10 Jun 1999 19:11:38 +0200

 >    But test_ifindex only reports the first one :-(.  Is this a kernel
 >    bug (Linux 2.3.5 on i486) or a bug in glibc?  Is this only a
 >    problem on my system or can others running Linux 2.3.5 or newer
 >    reproduce it?

 > Technically it's a kernel bug, and since the result seems that I've
 > changed an API, I'm going to fix it.
Hi Dave,

you made in net/ipv4/devinet.c the following change:
-       struct ifreq ifr;
+       struct ifreq *ifr = (struct ifreq *) buf;

Looking at the code you've got to change the sizeof calculations also:

--- net/ipv4/devinet.c.~1~	Thu Jun 10 07:54:44 1999
+++ net/ipv4/devinet.c	Fri Jun 11 09:17:34 1999
@@ -615,10 +615,10 @@
 
 	for ( ; ifa; ifa = ifa->ifa_next) {
 		if (!ifr) {
-			done += sizeof(ifr);
+			done += sizeof(struct ifreq);
 			continue;
 		}
-		if (len < (int) sizeof(ifr))
+		if (len < (int) sizeof(struct ifreq))
 			return done;
 		memset(ifr, 0, sizeof(struct ifreq));
 		if (ifa->ifa_label)

This should fix the if_index bug I've reported.  ifc_len is set to 16
for my four interfaces - and sizeof (ifr) is 4 on my i486.

Andreas
-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]