diff options
author | glebius <glebius@FreeBSD.org> | 2014-03-04 19:49:41 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2014-03-04 19:49:41 +0000 |
commit | 2c50988dca8f1c498ada4b3c8c0c275a7c324622 (patch) | |
tree | bf8f361b94f91e2bf5d935995f36513ae1969389 /sys/netinet | |
parent | 373cea9476ea8bc27aaa8ba5e1f54abb066c079b (diff) | |
download | FreeBSD-src-2c50988dca8f1c498ada4b3c8c0c275a7c324622.zip FreeBSD-src-2c50988dca8f1c498ada4b3c8c0c275a7c324622.tar.gz |
Remove ifa_ref()/ifa_free(), which are atomic(9), from ip_output().
The ifaddr is already referenced by the rtentry, and we are holding
reference on the rtentry throughout the function execution.
Sponsored by: Netflix
Sponsored by: Nginx, Inc.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_output.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index ea283cf..04ef22c 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -293,7 +293,6 @@ again: goto bad; } ia = ifatoia(rte->rt_ifa); - ifa_ref(&ia->ia_ifa); ifp = rte->rt_ifp; rte->rt_rmx.rmx_pksent++; if (rte->rt_flags & RTF_GATEWAY) @@ -550,11 +549,8 @@ sendit: #endif error = netisr_queue(NETISR_IP, m); goto done; - } else { - if (ia != NULL) - ifa_free(&ia->ia_ifa); + } else goto again; /* Redo the routing table lookup. */ - } } /* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */ @@ -583,8 +579,6 @@ sendit: m->m_flags |= M_SKIP_FIREWALL; m->m_flags &= ~M_IP_NEXTHOP; m_tag_delete(m, fwd_tag); - if (ia != NULL) - ifa_free(&ia->ia_ifa); goto again; } @@ -697,8 +691,6 @@ passout: done: if (ro == &iproute) RO_RTFREE(ro); - if (ia != NULL) - ifa_free(&ia->ia_ifa); return (error); bad: m_freem(m); |