aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ipv6_sockglue.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@ghostprotocols.net>2005-08-09 22:45:38 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:37:29 -0400
commite6848976b721eeb5551cd94673faafeef78d9f35 (patch)
tree6c78b0eb52614ff6386b603ca64091b5aefaa418 /net/ipv6/ipv6_sockglue.c
parentd13964f4490157b8a290903362bfbc54f750a6bc (diff)
[NET]: Cleanup INET_REFCNT_DEBUG code
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ipv6_sockglue.c')
-rw-r--r--net/ipv6/ipv6_sockglue.c15
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;