summaryrefslogtreecommitdiffstats
path: root/sys/net/route.c
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 /sys/net/route.c
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 'sys/net/route.c')
-rw-r--r--sys/net/route.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index 38867f4..884f0eb 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -496,8 +496,9 @@ rtrequest(req, dst, gateway, netmask, flags, ret_nrt)
* Now search what's left of the subtree for any cloned
* routes which might have been formed from this node.
*/
- if ((rt->rt_flags & RTF_PRCLONING) && netmask) {
- rnh->rnh_walktree_from(rnh, dst, netmask,
+ if ((rt->rt_flags & (RTF_CLONING | RTF_PRCLONING)) &&
+ rt_mask(rt)) {
+ rnh->rnh_walktree_from(rnh, dst, rt_mask(rt),
rt_fixdelete, rt);
}
@@ -654,7 +655,7 @@ rtrequest(req, dst, gateway, netmask, flags, ret_nrt)
*/
if (req == RTM_RESOLVE) {
rt->rt_rmx = (*ret_nrt)->rt_rmx; /* copy metrics */
- if ((*ret_nrt)->rt_flags & RTF_PRCLONING) {
+ if ((*ret_nrt)->rt_flags & (RTF_CLONING | RTF_PRCLONING)) {
rt->rt_parent = (*ret_nrt);
(*ret_nrt)->rt_refcnt++;
}
OpenPOWER on IntegriCloud