summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 4fecd6a..41987af 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -555,7 +555,6 @@ in_pcbdetach(inp)
{
struct socket *so = inp->inp_socket;
struct inpcbinfo *ipi = inp->inp_pcbinfo;
- struct rtentry *rt = inp->inp_route.ro_rt;
#ifdef IPSEC
ipsec4_delete_pcbpolicy(inp);
@@ -566,22 +565,8 @@ in_pcbdetach(inp)
sotryfree(so);
if (inp->inp_options)
(void)m_free(inp->inp_options);
- if (rt) {
- /*
- * route deletion requires reference count to be <= zero
- */
- if ((rt->rt_flags & RTF_DELCLONE) &&
- (rt->rt_flags & RTF_WASCLONED) &&
- (rt->rt_refcnt <= 1)) {
- rt->rt_refcnt--;
- rt->rt_flags &= ~RTF_UP;
- rtrequest(RTM_DELETE, rt_key(rt),
- rt->rt_gateway, rt_mask(rt),
- rt->rt_flags, (struct rtentry **)0);
- }
- else
- rtfree(rt);
- }
+ if (inp->inp_route.ro_rt)
+ rtfree(inp->inp_route.ro_rt);
ip_freemoptions(inp->inp_moptions);
inp->inp_vflag = 0;
zfree(ipi->ipi_zone, inp);
OpenPOWER on IntegriCloud