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)
commit59c08c69c2788612f1afd199c5c87d9df8b8a356
tree29ab6d518212b5bfecff80e93f1beb2a593a4248
parent6c47260250fc6114ce2012db13e1cd3938a27b73
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