aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2016-08-23 14:39:26 -0400
committerDavid S. Miller <davem@davemloft.net>2016-08-24 02:23:50 -0400
commit6a6ad2a4e57bc907a6977eef6cad49348ad2744b (patch)
treea3e8a7d9cefa9d2a975b422015e7b375d336e8f2
parent5d77dca82839ef016a93ad7acd7058b14d967752 (diff)
ipv6: udp: remove udp_v6_clear_sk()
Now RCU lookups of ipv6 udp sockets no longer dereference pinet6 field, we can get rid of udp_v6_clear_sk() helper. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/udp.c12
-rw-r--r--net/ipv6/udp_impl.h2
-rw-r--r--net/ipv6/udplite.c2
3 files changed, 1 insertions, 15 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 16512cf06e73..9efe740ff6dd 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1424,17 +1424,6 @@ void udp6_proc_exit(struct net *net)
1424} 1424}
1425#endif /* CONFIG_PROC_FS */ 1425#endif /* CONFIG_PROC_FS */
1426 1426
1427void udp_v6_clear_sk(struct sock *sk, int size)
1428{
1429 struct inet_sock *inet = inet_sk(sk);
1430
1431 /* we do not want to clear pinet6 field, because of RCU lookups */
1432 sk_prot_clear_portaddr_nulls(sk, offsetof(struct inet_sock, pinet6));
1433
1434 size -= offsetof(struct inet_sock, pinet6) + sizeof(inet->pinet6);
1435 memset(&inet->pinet6 + 1, 0, size);
1436}
1437
1438/* ------------------------------------------------------------------------ */ 1427/* ------------------------------------------------------------------------ */
1439 1428
1440struct proto udpv6_prot = { 1429struct proto udpv6_prot = {
@@ -1466,7 +1455,6 @@ struct proto udpv6_prot = {
1466 .compat_setsockopt = compat_udpv6_setsockopt, 1455 .compat_setsockopt = compat_udpv6_setsockopt,
1467 .compat_getsockopt = compat_udpv6_getsockopt, 1456 .compat_getsockopt = compat_udpv6_getsockopt,
1468#endif 1457#endif
1469 .clear_sk = udp_v6_clear_sk,
1470 .diag_destroy = udp_abort, 1458 .diag_destroy = udp_abort,
1471}; 1459};
1472 1460
diff --git a/net/ipv6/udp_impl.h b/net/ipv6/udp_impl.h
index 0682c031ccdc..f6eb1ab34f4b 100644
--- a/net/ipv6/udp_impl.h
+++ b/net/ipv6/udp_impl.h
@@ -29,8 +29,6 @@ int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock,
29int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); 29int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
30void udpv6_destroy_sock(struct sock *sk); 30void udpv6_destroy_sock(struct sock *sk);
31 31
32void udp_v6_clear_sk(struct sock *sk, int size);
33
34#ifdef CONFIG_PROC_FS 32#ifdef CONFIG_PROC_FS
35int udp6_seq_show(struct seq_file *seq, void *v); 33int udp6_seq_show(struct seq_file *seq, void *v);
36#endif 34#endif
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c
index 9cf097e206e9..118057a5b759 100644
--- a/net/ipv6/udplite.c
+++ b/net/ipv6/udplite.c
@@ -56,7 +56,7 @@ struct proto udplitev6_prot = {
56 .compat_setsockopt = compat_udpv6_setsockopt, 56 .compat_setsockopt = compat_udpv6_setsockopt,
57 .compat_getsockopt = compat_udpv6_getsockopt, 57 .compat_getsockopt = compat_udpv6_getsockopt,
58#endif 58#endif
59 .clear_sk = udp_v6_clear_sk, 59 .clear_sk = sk_prot_clear_portaddr_nulls,
60}; 60};
61 61
62static struct inet_protosw udplite6_protosw = { 62static struct inet_protosw udplite6_protosw = {