diff options
author | sam <sam@FreeBSD.org> | 2003-10-30 23:02:51 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2003-10-30 23:02:51 +0000 |
commit | 9183d53dd706fc6cf2da442eac0d791630796da2 (patch) | |
tree | 86b489ad92452a54684a5299e07cbdce8229465b /sys/netinet/in_pcb.c | |
parent | 778c2eee4276d3b48a83b3d80320a61f39ea8d83 (diff) | |
download | FreeBSD-src-9183d53dd706fc6cf2da442eac0d791630796da2.zip FreeBSD-src-9183d53dd706fc6cf2da442eac0d791630796da2.tar.gz |
Overhaul routing table entry cleanup by introducing a new rtexpunge
routine that takes a locked routing table reference and removes all
references to the entry in the various data structures. This
eliminates instances of recursive locking and also closes races
where the lock on the entry had to be dropped prior to calling
rtrequest(RTM_DELETE). This also cleans up confusion where the
caller held a reference to an entry that might have been reclaimed
(and in some cases used that reference).
Supported by: FreeBSD Foundation
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r-- | sys/netinet/in_pcb.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index e094c8c..a1490c4 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. |