socket: synchronize net on socket tear down

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2017-01-24 04:25:00 +01:00
parent 58e9c95423
commit 8906775bd1

View File

@@ -413,6 +413,7 @@ void socket_uninit(struct wireguard_device *wg)
rcu_assign_pointer(wg->sock6, NULL);
mutex_unlock(&wg->socket_update_lock);
synchronize_rcu();
synchronize_net();
sock_free(old4);
sock_free(old6);
}