]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: Rework xt_TEE netdevice notifier
authorKirill Tkhai <ktkhai@virtuozzo.com>
Thu, 29 Mar 2018 14:03:35 +0000 (17:03 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 30 Mar 2018 14:59:23 +0000 (10:59 -0400)
commitb78ffc00d24120d0bfb8b38975275a176d84f110
treefa627671f16e4c0a566150c51bde1e7f29400544
parent19e6db8b3a1c159b6d6d9b2a994b3efa6811801c
netfilter: Rework xt_TEE netdevice notifier

Register netdevice notifier for every iptable entry
is not good, since this breaks modularity, and
the hidden synchronization is based on rtnl_lock().

This patch reworks the synchronization via new lock,
while the rest of logic remains as it was before.
This is required for the next patch.

Tested via:

while :; do
unshare -n iptables -t mangle -A OUTPUT -j TEE --gateway 1.1.1.2 --oif lo;
done

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/xt_TEE.c