]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit09ed11fb3f63bb6fa44a775f4474d38cc399ab76
tree1f47abac17996fdbe45114dd6bbf65f451f1075d
parent658634e794c6cb7dbaa47686902b0c0e7fc67b18
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