NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/47704: netstat ignores L option



>Number:         47704
>Category:       bin
>Synopsis:       netstat ignores L option
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 28 21:10:00 +0000 2013
>Originator:     Takahiro Hayashi
>Release:        NetBSD 6.99.17 (around Mar 17)
>Organization:
>Environment:
System: NetBSD halt 6.99.17 NetBSD 6.99.17 (UNION) #0: Sun Mar 17 14:09:02 JST 
2013  root@halt:/usr/build2/obj.i386/sys/arch/i386/compile/UNION i386
Architecture: i386
Machine: i386
>Description:
        The netstat(1) ignores option "-L" (dont show link-level routes).
        The code handling option L is removed when cleaning up of
        OSI network stack removal.

>How-To-Repeat:
        run "netstat -nrL"

>Fix:
        Re-add RTF_LLINFO handling to show.c.
        or run "netstat -nrL | grep -v L"

Index: src/usr.bin/netstat/show.c
===================================================================
RCS file: /cvsroot/src/usr.bin/netstat/show.c,v
retrieving revision 1.15
diff -u -p -r1.15 show.c
--- src/usr.bin/netstat/show.c  11 Nov 2011 15:09:33 -0000      1.15
+++ src/usr.bin/netstat/show.c  28 Mar 2013 11:01:10 -0000
@@ -243,6 +243,9 @@ p_rtentry(struct rt_msghdr *rtm)
        char             ifbuf[IF_NAMESIZE];
 
 
+       if (Lflag && (rtm->rtm_flags & RTF_LLINFO))
+               return;
+
        if (old_af != sa->sa_family) {
                old_af = sa->sa_family;
                pr_family(sa->sa_family);




Home | Main Index | Thread Index | Old Index