From 089cdfad789bebd55c52712f9148cd271079f866 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Thu, 15 Mar 2001 14:52:12 +0000 Subject: 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) --- usr.bin/netstat/netstat.1 | 11 ++++++++--- usr.bin/netstat/route.c | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/netstat/netstat.1 b/usr.bin/netstat/netstat.1 index 2f4a02dd79d3..2568227d95e4 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 e10d07a0e9ce..7e4b69d857d8 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)); -- cgit v1.3