]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables_netdev: unregister hooks on net_device removal
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 15 Jun 2015 10:12:01 +0000 (12:12 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 15 Jun 2015 21:02:35 +0000 (23:02 +0200)
commit8aacb7c035840b4f81288171a7c5a2ea427d150d
treec37020898a8d31211877daef0fc7609bc118c878
parent6f0cad19edd06cc8c0dc5510a6293a84bf1484c4
netfilter: nf_tables_netdev: unregister hooks on net_device removal

In case the net_device is gone, we have to unregister the hooks and put back
the reference on the net_device object. Once it comes back, register them
again. This also covers the device rename case.

This patch also adds a new flag to indicate that the basechain is disabled, so
their hooks are not registered. This flag is used by the netdev family to
handle the case where the net_device object is gone. Currently this flag is not
exposed to userspace.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/netfilter/nf_tables.h
net/netfilter/nf_tables_api.c
net/netfilter/nf_tables_netdev.c