Fix reference count leak with L2 caching.
ip_forward, TCP/IPv6, and probably SCTP leaked references to L2 cache
entry because they used their own routes on the stack, not in_pcb routes.
The original model for route caching was callers that provided a route
structure to ip{,6}input() would keep the route, and this model was used
for L2 caching as well. Instead, change L2 caching to be done by default
only when using a route structure in the in_pcb; the pcb deallocation
code frees L2 as well as L3 cacches. A separate change will add route
caching to TCP/IPv6.
Another suggestion was to have the transport protocols indicate willingness
to use L2 caching, but this approach keeps the changes in the network
level
Reviewed by: ae gnn
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D10059
and those below, will be ignored--
Description of fields to fill in above: 76 columns --|
PR: If and which Problem Report is related.
Submitted by: If someone else sent in the change.
Reported by: If someone else reported the issue.
Reviewed by: If someone else reviewed your modification.
Approved by: If you needed approval for this commit.
Obtained from: If the change is from a third party.
MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email.
MFH: Ports tree branch name. Request approval for merge.
Relnotes: Set to 'yes' for mention in release notes.
Security: Vulnerability reference (one per line) or description.
Sponsored by: If the change was sponsored by an organization.
Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed).
Empty fields above will be automatically removed.
M netinet/in_pcb.c
M netinet/ip_output.c
M netinet6/ip6_output.c