diff options
author | ru <ru@FreeBSD.org> | 2001-05-07 12:29:36 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2001-05-07 12:29:36 +0000 |
commit | 0a9fa3241f5d1682903ed99aab43ffc404435e15 (patch) | |
tree | 23973771c67ed2ef23baaee4b7ec5ddd310d36ca /usr.bin/netstat | |
parent | b4e77391c3536ccca7aefca3e461c40868b19e4b (diff) | |
download | FreeBSD-src-0a9fa3241f5d1682903ed99aab43ffc404435e15.zip FreeBSD-src-0a9fa3241f5d1682903ed99aab43ffc404435e15.tar.gz |
Restore printing of routes cloned from a RTF_CLONING parent
(e.g., ARP table entries) with the default routing display.
PR: bin/26970
Reviewed by: wollman
MFC after: 3 days
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r-- | usr.bin/netstat/netstat.1 | 9 | ||||
-rw-r--r-- | usr.bin/netstat/route.c | 10 |
2 files changed, 10 insertions, 9 deletions
diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1 index aef1cc7..40afdea 100644 --- a/usr.bin/netstat/netstat.1 +++ b/usr.bin/netstat/netstat.1 @@ -101,13 +101,10 @@ show the state of all sockets; normally sockets used by server processes are not shown. With the routing table display (option .Fl r , -as described below), show cloned routes (routes +as described below), show protocol-cloned routes (routes generated by a -parent route with either -.Dv RTF_CLONING -or .Dv RTF_PRCLONING -flag set); normally these routes are +parent route); normally these routes are not shown. .It Fl b With the interface display (option @@ -247,7 +244,7 @@ If this option is repeated, counters with a value of zero are suppressed. Show the routing tables. Use with .Fl a -to show cloned routes. +to show protocol-cloned routes. When .Fl s is also present, show routing statistics instead. diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 7e4b69d..75cc325 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -582,16 +582,20 @@ p_rtentry(rt) register struct rtentry *rt; { static struct ifnet ifnet, *lastif; + struct rtentry parent; static char name[16]; static char prettyname[9]; struct sockaddr *sa; sa_u addr, mask; /* - * Don't print cloned routes unless -a. + * Don't print protocol-cloned routes unless -a. */ - if (rt->rt_flags & RTF_WASCLONED && !aflag) - return; + if (rt->rt_flags & RTF_WASCLONED && !aflag) { + kget(rt->rt_parent, parent); + if (parent.rt_flags & RTF_PRCLONING) + return; + } bzero(&addr, sizeof(addr)); if ((sa = kgetsa(rt_key(rt)))) |