diff options
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 71167069b394..0a17ed9eaf39 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1890,6 +1890,17 @@ void tcp6_proc_exit(struct net *net) | |||
1890 | } | 1890 | } |
1891 | #endif | 1891 | #endif |
1892 | 1892 | ||
1893 | static void tcp_v6_clear_sk(struct sock *sk, int size) | ||
1894 | { | ||
1895 | struct inet_sock *inet = inet_sk(sk); | ||
1896 | |||
1897 | /* we do not want to clear pinet6 field, because of RCU lookups */ | ||
1898 | sk_prot_clear_nulls(sk, offsetof(struct inet_sock, pinet6)); | ||
1899 | |||
1900 | size -= offsetof(struct inet_sock, pinet6) + sizeof(inet->pinet6); | ||
1901 | memset(&inet->pinet6 + 1, 0, size); | ||
1902 | } | ||
1903 | |||
1893 | struct proto tcpv6_prot = { | 1904 | struct proto tcpv6_prot = { |
1894 | .name = "TCPv6", | 1905 | .name = "TCPv6", |
1895 | .owner = THIS_MODULE, | 1906 | .owner = THIS_MODULE, |
@@ -1933,6 +1944,7 @@ struct proto tcpv6_prot = { | |||
1933 | #ifdef CONFIG_MEMCG_KMEM | 1944 | #ifdef CONFIG_MEMCG_KMEM |
1934 | .proto_cgroup = tcp_proto_cgroup, | 1945 | .proto_cgroup = tcp_proto_cgroup, |
1935 | #endif | 1946 | #endif |
1947 | .clear_sk = tcp_v6_clear_sk, | ||
1936 | }; | 1948 | }; |
1937 | 1949 | ||
1938 | static const struct inet6_protocol tcpv6_protocol = { | 1950 | static const struct inet6_protocol tcpv6_protocol = { |