diff options
Diffstat (limited to 'net/ipv6/ipv6_sockglue.c')
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 3bc144a79fa5..76fe23925d77 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -163,6 +163,13 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, | |||
163 | fl6_free_socklist(sk); | 163 | fl6_free_socklist(sk); |
164 | ipv6_sock_mc_close(sk); | 164 | ipv6_sock_mc_close(sk); |
165 | 165 | ||
166 | /* | ||
167 | * Sock is moving from IPv6 to IPv4 (sk_prot), so | ||
168 | * remove it from the refcnt debug socks count in the | ||
169 | * original family... | ||
170 | */ | ||
171 | sk_refcnt_debug_dec(sk); | ||
172 | |||
166 | if (sk->sk_protocol == IPPROTO_TCP) { | 173 | if (sk->sk_protocol == IPPROTO_TCP) { |
167 | struct tcp_sock *tp = tcp_sk(sk); | 174 | struct tcp_sock *tp = tcp_sk(sk); |
168 | 175 | ||
@@ -192,9 +199,11 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, | |||
192 | kfree_skb(pktopt); | 199 | kfree_skb(pktopt); |
193 | 200 | ||
194 | sk->sk_destruct = inet_sock_destruct; | 201 | sk->sk_destruct = inet_sock_destruct; |
195 | #ifdef INET_REFCNT_DEBUG | 202 | /* |
196 | atomic_dec(&inet6_sock_nr); | 203 | * ... and add it to the refcnt debug socks count |
197 | #endif | 204 | * in the new family. -acme |
205 | */ | ||
206 | sk_refcnt_debug_inc(sk); | ||
198 | module_put(THIS_MODULE); | 207 | module_put(THIS_MODULE); |
199 | retv = 0; | 208 | retv = 0; |
200 | break; | 209 | break; |