Skip to content
Commit eff3c558 authored by Felix Huettner's avatar Felix Huettner Committed by Pablo Neira Ayuso
Browse files

netfilter: ctnetlink: support filtering by zone



conntrack zones are heavily used by tools like openvswitch to run
multiple virtual "routers" on a single machine. In this context each
conntrack zone matches to a single router, thereby preventing
overlapping IPs from becoming issues.
In these systems it is common to operate on all conntrack entries of a
given zone, e.g. to delete them when a router is deleted. Previously this
required these tools to dump the full conntrack table and filter out the
relevant entries in userspace potentially causing performance issues.

To do this we reuse the existing CTA_ZONE attribute. This was previous
parsed but not used during dump and flush requests. Now if CTA_ZONE is
set we filter these operations based on the provided zone.
However this means that users that previously passed CTA_ZONE will
experience a difference in functionality.

Alternatively CTA_FILTER could have been used for the same
functionality. However it is not yet supported during flush requests and
is only available when using AF_INET or AF_INET6.

Co-developed-by: default avatarLuca Czesla <luca.czesla@mail.schwarz>
Signed-off-by: default avatarLuca Czesla <luca.czesla@mail.schwarz>
Co-developed-by: default avatarMax Lamprecht <max.lamprecht@mail.schwarz>
Signed-off-by: default avatarMax Lamprecht <max.lamprecht@mail.schwarz>
Signed-off-by: default avatarFelix Huettner <felix.huettner@mail.schwarz>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 08e4c8c5
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment