diff options
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r-- | net/ipv6/udp.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index d4defdd44937..42923b14dfa6 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -1432,6 +1432,17 @@ void udp6_proc_exit(struct net *net) { | |||
1432 | } | 1432 | } |
1433 | #endif /* CONFIG_PROC_FS */ | 1433 | #endif /* CONFIG_PROC_FS */ |
1434 | 1434 | ||
1435 | void udp_v6_clear_sk(struct sock *sk, int size) | ||
1436 | { | ||
1437 | struct inet_sock *inet = inet_sk(sk); | ||
1438 | |||
1439 | /* we do not want to clear pinet6 field, because of RCU lookups */ | ||
1440 | sk_prot_clear_portaddr_nulls(sk, offsetof(struct inet_sock, pinet6)); | ||
1441 | |||
1442 | size -= offsetof(struct inet_sock, pinet6) + sizeof(inet->pinet6); | ||
1443 | memset(&inet->pinet6 + 1, 0, size); | ||
1444 | } | ||
1445 | |||
1435 | /* ------------------------------------------------------------------------ */ | 1446 | /* ------------------------------------------------------------------------ */ |
1436 | 1447 | ||
1437 | struct proto udpv6_prot = { | 1448 | struct proto udpv6_prot = { |
@@ -1462,7 +1473,7 @@ struct proto udpv6_prot = { | |||
1462 | .compat_setsockopt = compat_udpv6_setsockopt, | 1473 | .compat_setsockopt = compat_udpv6_setsockopt, |
1463 | .compat_getsockopt = compat_udpv6_getsockopt, | 1474 | .compat_getsockopt = compat_udpv6_getsockopt, |
1464 | #endif | 1475 | #endif |
1465 | .clear_sk = sk_prot_clear_portaddr_nulls, | 1476 | .clear_sk = udp_v6_clear_sk, |
1466 | }; | 1477 | }; |
1467 | 1478 | ||
1468 | static struct inet_protosw udpv6_protosw = { | 1479 | static struct inet_protosw udpv6_protosw = { |