]> www.infradead.org Git - users/jedix/linux-maple.git/commit
netfilter: nf_tables: Handle NETDEV_CHANGENAME events
authorPhil Sutter <phil@nwl.cc>
Wed, 21 May 2025 20:44:30 +0000 (22:44 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 23 May 2025 11:57:13 +0000 (13:57 +0200)
commit7b4856493d7801018c48bab6f8ab8482aba8be76
treef75c1559dc170e612ca4c244afc9df4bcce16818
parent9669c1105b16fa9e02bc599464b3f96988c92ed0
netfilter: nf_tables: Handle NETDEV_CHANGENAME events

For the sake of simplicity, treat them like consecutive NETDEV_REGISTER
and NETDEV_UNREGISTER events. If the new name matches a hook spec and
registration fails, escalate the error and keep things as they are.

To avoid unregistering the newly registered hook again during the
following fake NETDEV_UNREGISTER event, leave hooks alone if their
interface spec matches the new name.

Note how this patch also skips for NETDEV_REGISTER if the device is
already registered. This is not yet possible as the new name would have
to match the old one. This will change with wildcard interface specs,
though.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c
net/netfilter/nft_chain_filter.c