Commit 6a6ad2a4 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5d77dca8
...@@ -1424,17 +1424,6 @@ void udp6_proc_exit(struct net *net) ...@@ -1424,17 +1424,6 @@ void udp6_proc_exit(struct net *net)
} }
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_PROC_FS */
void udp_v6_clear_sk(struct sock *sk, int size)
{
struct inet_sock *inet = inet_sk(sk);
/* we do not want to clear pinet6 field, because of RCU lookups */
sk_prot_clear_portaddr_nulls(sk, offsetof(struct inet_sock, pinet6));
size -= offsetof(struct inet_sock, pinet6) + sizeof(inet->pinet6);
memset(&inet->pinet6 + 1, 0, size);
}
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
struct proto udpv6_prot = { struct proto udpv6_prot = {
...@@ -1466,7 +1455,6 @@ struct proto udpv6_prot = { ...@@ -1466,7 +1455,6 @@ struct proto udpv6_prot = {
.compat_setsockopt = compat_udpv6_setsockopt, .compat_setsockopt = compat_udpv6_setsockopt,
.compat_getsockopt = compat_udpv6_getsockopt, .compat_getsockopt = compat_udpv6_getsockopt,
#endif #endif
.clear_sk = udp_v6_clear_sk,
.diag_destroy = udp_abort, .diag_destroy = udp_abort,
}; };
......
...@@ -29,8 +29,6 @@ int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock, ...@@ -29,8 +29,6 @@ int udpv6_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int noblock,
int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); int udpv6_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
void udpv6_destroy_sock(struct sock *sk); void udpv6_destroy_sock(struct sock *sk);
void udp_v6_clear_sk(struct sock *sk, int size);
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
int udp6_seq_show(struct seq_file *seq, void *v); int udp6_seq_show(struct seq_file *seq, void *v);
#endif #endif
......
...@@ -56,7 +56,7 @@ struct proto udplitev6_prot = { ...@@ -56,7 +56,7 @@ struct proto udplitev6_prot = {
.compat_setsockopt = compat_udpv6_setsockopt, .compat_setsockopt = compat_udpv6_setsockopt,
.compat_getsockopt = compat_udpv6_getsockopt, .compat_getsockopt = compat_udpv6_getsockopt,
#endif #endif
.clear_sk = udp_v6_clear_sk, .clear_sk = sk_prot_clear_portaddr_nulls,
}; };
static struct inet_protosw udplite6_protosw = { static struct inet_protosw udplite6_protosw = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment