netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Andreas Henriksson <andreas@fatal.se>
Cc: netdev@vger.kernel.org, Mark Borst <mark@borst.org>
Subject: Re: [PATCH] iproute: "ip mroute show" doesn't show all output interfaces
Date: Tue, 1 Dec 2009 16:16:48 -0800	[thread overview]
Message-ID: <20091201161648.250638fb@nehalam> (raw)
In-Reply-To: <20091123095231.GA14210@amd64.fatal.se>

On Mon, 23 Nov 2009 10:52:31 +0100
Andreas Henriksson <andreas@fatal.se> wrote:

> From: Mark Borst <mark@borst.org>
> 
> 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>

Applied with small modification, sscanf... %u%[^\n] would not
skip leading whitespace like the original %u%s but adding a blank
in the format will correct that.

-- 

      reply	other threads:[~2009-12-02  0:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-23  9:52 [PATCH] iproute: "ip mroute show" doesn't show all output interfaces Andreas Henriksson
2009-12-02  0:16 ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091201161648.250638fb@nehalam \
    --to=shemminger@vyatta.com \
    --cc=andreas@fatal.se \
    --cc=mark@borst.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).