- Revert r300854, r303657 which tried to fix regression from r297225.

- Fix the regression proper way using RO_RTFREE().

Submitted by:	ae
This commit is contained in:
Gleb Smirnoff 2016-10-13 20:15:47 +00:00
parent 721f5406c8
commit cc94f0c2d7
3 changed files with 4 additions and 19 deletions

View File

@ -1299,10 +1299,7 @@ in_pcbfree(struct inpcb *inp)
if (inp->inp_moptions != NULL)
inp_freemoptions(inp->inp_moptions);
#endif
if (inp->inp_route.ro_rt) {
RTFREE(inp->inp_route.ro_rt);
inp->inp_route.ro_rt = (struct rtentry *)NULL;
}
RO_RTFREE(&inp->inp_route);
if (inp->inp_route.ro_lle)
LLE_FREE(inp->inp_route.ro_lle); /* zeros ro_lle */
@ -2242,10 +2239,7 @@ void
in_losing(struct inpcb *inp)
{
if (inp->inp_route.ro_rt) {
RTFREE(inp->inp_route.ro_rt);
inp->inp_route.ro_rt = (struct rtentry *)NULL;
}
RO_RTFREE(&inp->inp_route);
if (inp->inp_route.ro_lle)
LLE_FREE(inp->inp_route.ro_lle); /* zeros ro_lle */
return;

View File

@ -704,11 +704,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
IPSTAT_INC(ips_fragmented);
done:
/*
* Release the route if using our private route, or if
* (with flowtable) we don't have our own reference.
*/
if (ro == &iproute || ro->ro_flags & RT_NORTREF)
if (ro == &iproute)
RO_RTFREE(ro);
else if (rte == NULL)
/*

View File

@ -1064,12 +1064,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt,
IP6STAT_INC(ip6s_fragmented);
done:
/*
* Release the route if using our private route, or if
* (with flowtable) we don't have our own reference.
*/
if (ro == &ip6route ||
(ro != NULL && ro->ro_flags & RT_NORTREF))
if (ro == &ip6route)
RO_RTFREE(ro);
return (error);