diff options
| author | Sam Leffler <sam@FreeBSD.org> | 2003-10-30 23:02:51 +0000 |
|---|---|---|
| committer | Sam Leffler <sam@FreeBSD.org> | 2003-10-30 23:02:51 +0000 |
| commit | 9c63e9dbd78449ff82e855bd04c66097f7923615 (patch) | |
| tree | 86b489ad92452a54684a5299e07cbdce8229465b /sys/netinet | |
| parent | 52820ec247aefb59ed9e29703bf9f2f037f7a2c8 (diff) | |
Notes
Diffstat (limited to 'sys/netinet')
| -rw-r--r-- | sys/netinet/if_ether.c | 11 | ||||
| -rw-r--r-- | sys/netinet/in_pcb.c | 8 | ||||
| -rw-r--r-- | sys/netinet/in_rmx.c | 33 |
3 files changed, 15 insertions, 37 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 4cc1d4e24faab..d5916ba010ba7 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -949,14 +949,9 @@ arplookup(addr, create, proxy) * arplookup() is creating the route, then purge * it from the routing table as it is probably bogus. */ - RT_UNLOCK(rt); - if (rt->rt_refcnt == 1 && ISDYNCLONE(rt)) { - rtrequest(RTM_DELETE, - (struct sockaddr *)rt_key(rt), - rt->rt_gateway, rt_mask(rt), - rt->rt_flags, 0); - } - RTFREE(rt); + if (rt->rt_refcnt == 1 && ISDYNCLONE(rt)) + rtexpunge(rt); + RTFREE_LOCKED(rt); return (0); #undef ISDYNCLONE } else { diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index e094c8cc95d40..a1490c451f0d9 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -871,11 +871,9 @@ in_losing(inp) info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; info.rti_info[RTAX_NETMASK] = rt_mask(rt); rt_missmsg(RTM_LOSING, &info, rt->rt_flags, 0); - if (rt->rt_flags & RTF_DYNAMIC) { - RT_UNLOCK(rt); /* XXX refcnt? */ - (void) rtrequest1(RTM_DELETE, &info, NULL); - } else - rtfree(rt); + if (rt->rt_flags & RTF_DYNAMIC) + rtexpunge(rt); + RTFREE_LOCKED(rt); /* * A new route can be allocated * the next time output is attempted. diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c index baa8c71805dc7..39f5eeda6e882 100644 --- a/sys/netinet/in_rmx.c +++ b/sys/netinet/in_rmx.c @@ -125,17 +125,12 @@ in_addroute(void *v_arg, void *n_arg, struct radix_node_head *head, rt2->rt_flags & RTF_HOST && rt2->rt_gateway && rt2->rt_gateway->sa_family == AF_LINK) { - /* NB: must unlock to avoid recursion */ - RT_UNLOCK(rt2); - rtrequest(RTM_DELETE, - (struct sockaddr *)rt_key(rt2), - rt2->rt_gateway, rt_mask(rt2), - rt2->rt_flags, 0); + rtexpunge(rt2); + RTFREE_LOCKED(rt2); ret = rn_addroute(v_arg, n_arg, head, treenodes); - RT_LOCK(rt2); - } - RTFREE_LOCKED(rt2); + } else + RTFREE_LOCKED(rt2); } } @@ -211,13 +206,7 @@ in_clsroute(struct radix_node *rn, struct radix_node_head *head) rt->rt_flags |= RTPRF_OURS; rt->rt_rmx.rmx_expire = time_second + rtq_reallyold; } else { - /* NB: must unlock to avoid recursion */ - RT_UNLOCK(rt); - rtrequest(RTM_DELETE, - (struct sockaddr *)rt_key(rt), - rt->rt_gateway, rt_mask(rt), - rt->rt_flags, 0); - RT_LOCK(rt); + rtexpunge(rt); } } @@ -385,8 +374,8 @@ in_ifadownkill(struct radix_node *rn, void *xap) { struct in_ifadown_arg *ap = xap; struct rtentry *rt = (struct rtentry *)rn; - int err; + RT_LOCK(rt); if (rt->rt_ifa == ap->ifa && (ap->del || !(rt->rt_flags & RTF_STATIC))) { /* @@ -397,15 +386,11 @@ in_ifadownkill(struct radix_node *rn, void *xap) * the routes that rtrequest() would have in any case, * so that behavior is not needed there. */ - RT_LOCK(rt); rt->rt_flags &= ~(RTF_CLONING | RTF_PRCLONING); + rtexpunge(rt); + RTFREE_LOCKED(rt); + } else RT_UNLOCK(rt); - err = rtrequest(RTM_DELETE, (struct sockaddr *)rt_key(rt), - rt->rt_gateway, rt_mask(rt), rt->rt_flags, 0); - if (err) { - log(LOG_WARNING, "in_ifadownkill: error %d\n", err); - } - } return 0; } |
