Package: iproute
Version: 20090324-1
Severity: normal
Tags: patch

The command "ip mroute show" will only show the first Oif. 

m...@flappie:~$ ip mroute show
(192.168.1.1, 224.0.0.123)       Iif: _rename    Oifs: eth1 

m...@flappie:~$ cat /proc/net/ip_mr_cache 
Group    Origin   Iif     Pkts    Bytes    Wrong Oifs
7B0000E0 0101A8C0 2          0        0        0  0:1    1:1  

This shows 2 Oifs here. However, ipmroute.c, function read_mroute_list(), uses 
sscanf() with a %s mask for oiflist, which stops after the first whitespace 
(i.e. after Oif 0:1). The patch below fixes this to read until the newline 
(though I'm not sure whether this is the proper way to fix it).

After this patch:
m...@flappie:~/iproute-20090324/ip$ ./ip mroute show
(192.168.1.1, 224.0.0.123)       Iif: _rename    Oifs: eth1 eth0 

diff -rc iproute-20090324-origdeb/ip/ipmroute.c iproute-20090324/ip/ipmroute.c
*** iproute-20090324-origdeb/ip/ipmroute.c      2009-10-07 17:21:00.000000000 
+0200
--- iproute-20090324/ip/ipmroute.c      2009-10-07 17:34:01.000000000 +0200
***************
*** 95,101 ****
                char obuf[256];
  
                oiflist[0] = 0;
!               if (sscanf(buf, "%x%x%d%u%u%u%s", maddr.data, msrc.data, &vifi,
                           &pkts, &b, &w, oiflist) < 6)
                        continue;
  
--- 95,101 ----
                char obuf[256];
  
                oiflist[0] = 0;
!               if (sscanf(buf, "%x%x%d%u%u%u%[^\n]", maddr.data, msrc.data, 
&vifi,
                           &pkts, &b, &w, oiflist) < 6)
                        continue;
  



-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.30-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages iproute depends on:
ii  libc6                         2.9-27     GNU C Library: Shared libraries
ii  libdb4.7                      4.7.25-8   Berkeley v4.7 Database Libraries [

Versions of packages iproute recommends:
ii  libatm1                       2.4.1-17.2 shared library for ATM (Asynchrono

Versions of packages iproute suggests:
pn  iproute-doc                   <none>     (no description available)

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to