tcp: plug dst leak in tcp_v6_conn_request()
authorNeal Cardwell <ncardwell@google.com>
Thu, 28 Jun 2012 12:34:21 +0000 (12:34 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 29 Jun 2012 00:54:03 +0000 (17:54 -0700)
commit9f10d3f6f966ef6f6a8d025a4b1d341923d04607
tree1f47abac17996fdbe45114dd6bbf65f451f1075d
parent9494218fbae2f88bd3f9b887714734abfdf38bab
tcp: plug dst leak in tcp_v6_conn_request()

The code in tcp_v6_conn_request() was implicitly assuming that
tcp_v6_send_synack() would take care of dst_release(), much as
tcp_v4_send_synack() already does. This resulted in
tcp_v6_conn_request() leaking a dst if sysctl_tw_recycle is enabled.

This commit restructures tcp_v6_send_synack() so that it accepts a dst
pointer and takes care of releasing the dst that is passed in, to plug
the leak and avoid future surprises by bringing the IPv6 behavior in
line with the IPv4 side.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/tcp_ipv6.c