summaryrefslogtreecommitdiffstats
path: root/net/ipv6/ipv6_sockglue.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo2005-08-10 04:45:38 +0200
committerDavid S. Miller2005-08-30 00:37:29 +0200
commite6848976b721eeb5551cd94673faafeef78d9f35 (patch)
tree6c78b0eb52614ff6386b603ca64091b5aefaa418 /net/ipv6/ipv6_sockglue.c
parent[IPV4/6]: Check if packet was actually delivered to a raw socket to decide wh... (diff)
downloadkernel-qcow2-linux-e6848976b721eeb5551cd94673faafeef78d9f35.tar.gz
kernel-qcow2-linux-e6848976b721eeb5551cd94673faafeef78d9f35.tar.xz
kernel-qcow2-linux-e6848976b721eeb5551cd94673faafeef78d9f35.zip
[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,
fl6_free_socklist(sk);
ipv6_sock_mc_close(sk);
+ /*
+ * Sock is moving from IPv6 to IPv4 (sk_prot), so
+ * remove it from the refcnt debug socks count in the
+ * original family...
+ */
+ sk_refcnt_debug_dec(sk);
+
if (sk->sk_protocol == IPPROTO_TCP) {
struct tcp_sock *tp = tcp_sk(sk);
@@ -192,9 +199,11 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname,
kfree_skb(pktopt);
sk->sk_destruct = inet_sock_destruct;
-#ifdef INET_REFCNT_DEBUG
- atomic_dec(&inet6_sock_nr);
-#endif
+ /*
+ * ... and add it to the refcnt debug socks count
+ * in the new family. -acme
+ */
+ sk_refcnt_debug_inc(sk);
module_put(THIS_MODULE);
retv = 0;
break;