]> git.proxmox.com Git - mirror_iproute2.git/commit
iproute: "ip mroute show" doesn't show all output interfaces
authorMark Borst <mark@borst.org>
Wed, 2 Dec 2009 00:15:15 +0000 (16:15 -0800)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Wed, 2 Dec 2009 00:15:15 +0000 (16:15 -0800)
commit080b3ad42820e002b91ab4e3ddb728d2c6763b58
treefe3dacd4f57fd87e98bff6476a45c96c99933304
parentf4af851bac12b0a72515912d6e1458d41aa2e009
iproute: "ip mroute show" doesn't show all output interfaces

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

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

mark@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:
mark@flappie:~/iproute-20090324/ip$ ./ip mroute show
(192.168.1.1, 224.0.0.123)       Iif: _rename    Oifs: eth1 eth0

This patch originally submitted as http://bugs.debian.org/550097

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
ip/ipmroute.c