diff options
Diffstat (limited to 'net/ipv6/udp.c')
| -rw-r--r-- | net/ipv6/udp.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 599e1ba6d1ce..d8e5e852fc7a 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
| @@ -1285,10 +1285,18 @@ do_confirm: | |||
| 1285 | 1285 | ||
| 1286 | void udpv6_destroy_sock(struct sock *sk) | 1286 | void udpv6_destroy_sock(struct sock *sk) |
| 1287 | { | 1287 | { |
| 1288 | struct udp_sock *up = udp_sk(sk); | ||
| 1288 | lock_sock(sk); | 1289 | lock_sock(sk); |
| 1289 | udp_v6_flush_pending_frames(sk); | 1290 | udp_v6_flush_pending_frames(sk); |
| 1290 | release_sock(sk); | 1291 | release_sock(sk); |
| 1291 | 1292 | ||
| 1293 | if (static_key_false(&udpv6_encap_needed) && up->encap_type) { | ||
| 1294 | void (*encap_destroy)(struct sock *sk); | ||
| 1295 | encap_destroy = ACCESS_ONCE(up->encap_destroy); | ||
| 1296 | if (encap_destroy) | ||
| 1297 | encap_destroy(sk); | ||
| 1298 | } | ||
| 1299 | |||
| 1292 | inet6_destroy_sock(sk); | 1300 | inet6_destroy_sock(sk); |
| 1293 | } | 1301 | } |
| 1294 | 1302 | ||
