summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-03-15 14:52:12 +0000
committerru <ru@FreeBSD.org>2001-03-15 14:52:12 +0000
commite4b7d932a19a7e68b2fe6b5b0ccb5013fcfc7469 (patch)
treeffd1d748ab689b5fb13295902794e0dad4bc76fe /usr.bin/netstat
parenta2c5f8fdaca23b3981f7016495ca06ae12220d18 (diff)
downloadFreeBSD-src-e4b7d932a19a7e68b2fe6b5b0ccb5013fcfc7469.zip
FreeBSD-src-e4b7d932a19a7e68b2fe6b5b0ccb5013fcfc7469.tar.gz
net/route.c:
A route generated from an RTF_CLONING route had the RTF_WASCLONED flag set but did not have a reference to the parent route, as documented in the rtentry(9) manpage. This prevented such routes from being deleted when their parent route is deleted. Now, for example, if you delete an IP address from a network interface, all ARP entries that were cloned from this interface route are flushed. This also has an impact on netstat(1) output. Previously, dynamically created ARP cache entries (RTF_STATIC flag is unset) were displayed as part of the routing table display (-r). Now, they are only printed if the -a option is given. netinet/in.c, netinet/in_rmx.c: When address is removed from an interface, also delete all routes that point to this interface and address. Previously, for example, if you changed the address on an interface, outgoing IP datagrams might still use the old address. The only solution was to delete and re-add some routes. (The problem is easily observed with the route(8) command.) Note, that if the socket was already bound to the local address before this address is removed, new datagrams generated from this socket will still be sent from the old address. PR: kern/20785, kern/21914 Reviewed by: wollman (the idea)
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/netstat.111
-rw-r--r--usr.bin/netstat/route.c4
2 files changed, 10 insertions, 5 deletions
diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1
index 2f4a02d..2568227 100644
--- a/usr.bin/netstat/netstat.1
+++ b/usr.bin/netstat/netstat.1
@@ -100,9 +100,14 @@ With the default display,
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 protocol-cloned routes (routes
-generated by a RTF_PRCLONING parent route); normally these routes are
+.Fl r ,
+as described below), show cloned routes (routes
+generated by a
+parent route with either
+.Dv RTF_CLONING
+or
+.Dv RTF_PRCLONING
+flag set); normally these routes are
not shown.
.It Fl b
With the interface display (option
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index e10d07a..7e4b69d 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -588,9 +588,9 @@ p_rtentry(rt)
sa_u addr, mask;
/*
- * Don't print protocol-cloned routes unless -a.
+ * Don't print cloned routes unless -a.
*/
- if (rt->rt_parent && !aflag)
+ if (rt->rt_flags & RTF_WASCLONED && !aflag)
return;
bzero(&addr, sizeof(addr));
OpenPOWER on IntegriCloud