|
@@ -3091,6 +3091,10 @@ static int packet_do_bind(struct sock *sk, const char *name, int ifindex,
|
|
if (need_rehook) {
|
|
if (need_rehook) {
|
|
if (po->running) {
|
|
if (po->running) {
|
|
rcu_read_unlock();
|
|
rcu_read_unlock();
|
|
|
|
+ /* prevents packet_notifier() from calling
|
|
|
|
+ * register_prot_hook()
|
|
|
|
+ */
|
|
|
|
+ po->num = 0;
|
|
__unregister_prot_hook(sk, true);
|
|
__unregister_prot_hook(sk, true);
|
|
rcu_read_lock();
|
|
rcu_read_lock();
|
|
dev_curr = po->prot_hook.dev;
|
|
dev_curr = po->prot_hook.dev;
|
|
@@ -3099,6 +3103,7 @@ static int packet_do_bind(struct sock *sk, const char *name, int ifindex,
|
|
dev->ifindex);
|
|
dev->ifindex);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ BUG_ON(po->running);
|
|
po->num = proto;
|
|
po->num = proto;
|
|
po->prot_hook.type = proto;
|
|
po->prot_hook.type = proto;
|
|
|
|
|