]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: ctnetlink: Support L3 protocol-filter on flush
authorKristian Evensen <kristian.evensen@gmail.com>
Mon, 3 Sep 2018 16:28:20 +0000 (18:28 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 17 Sep 2018 10:04:14 +0000 (12:04 +0200)
commitf83c431f84e7e5c33d3a3e8c488f43fabbb2da66
tree29ab6d518212b5bfecff80e93f1beb2a593a4248
parent2cb3c7fbb5e4aa1557e7ca568e3f3ec8d9969886
netfilter: ctnetlink: Support L3 protocol-filter on flush

The same connection mark can be set on flows belonging to different
address families. This commit adds support for filtering on the L3
protocol when flushing connection track entries. If no protocol is
specified, then all L3 protocols match.

In order to avoid code duplication and a redundant check, the protocol
comparison in ctnetlink_dump_table() has been removed. Instead, a filter
is created if the GET-message triggering the dump contains an address
family. ctnetlink_filter_match() is then used to compare the L3
protocols.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_netlink.c