Package: net-tools
Version: 1.60-17
Tags: patch

When running 'ifconfig' it will not show any IPv6 addresses for
interfaces that have an ifindex > 255.

Because the kernel will increment the ifindex every time an interface
is added or removed, it is not necessary to have 256 interfaces at
once, just creating 256 interfaces since system boot and they will no
longer show IPv6 addresses.

This is due to an improper fscanf() maximum range argument.  Patch to
fix the problem is below.

Example:

st34:~# ip addr list dev eth1.110
268: [EMAIL PROTECTED]: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue 
    link/ether 00:e0:81:2a:0d:2d brd ff:ff:ff:ff:ff:ff
    inet6 fd4d:5643:2886:6e::ea:0/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::2e0:81ff:fe2a:d2d/64 scope link 
       valid_lft forever preferred_lft forever
st34:~# ifconfig eth1.110
eth1.110  Link encap:Ethernet  HWaddr 00:E0:81:2A:0D:2D  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:676 (676.0 b)

st34:~# grep eth1.110 /proc/net/if_inet6 
fd4d56432886006e0000000000ea0000 10c 40 00 80 eth1.110
fe8000000000000002e081fffe2a0d2d 10c 40 20 80 eth1.110
st34:~# 


--- lib/interface.c.orig        2007-06-18 13:51:41.000000000 -0400
+++ lib/interface.c     2007-06-18 13:52:04.000000000 -0400
@@ -718,7 +718,7 @@
     /* FIXME: should be integrated into interface.c.   */
 
     if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) {
-       while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
+       while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %08x %02x %02x %02x %20s\n",
                      addr6p[0], addr6p[1], addr6p[2], addr6p[3],
                      addr6p[4], addr6p[5], addr6p[6], addr6p[7],
                  &if_idx, &plen, &scope, &dad_status, devname) != EOF) {



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to