netfilter: nf_conntrack: add efficient mark to zone mapping
This work adds the possibility of deriving the zone id from the skb->mark field in a scalable manner. This allows for having only a single template serving hundreds/thousands of different zones, for example, instead of the need to have one match for each zone as an extra CT jump target. Note that we'd need to have this information attached to the template as at the time when we're trying to lookup a possible ct object, we already need to know zone information for a possible match when going into __nf_conntrack_find_get(). This work provides a minimal implementation for a possible mapping. In order to not add/expose an extra ct->status bit, the zone structure has been extended to carry a flag for deriving the mark. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
committed by
Pablo Neira Ayuso
parent
deedb59039
commit
5e8018fc61
@@ -8,9 +8,11 @@ enum {
|
||||
XT_CT_NOTRACK_ALIAS = 1 << 1,
|
||||
XT_CT_ZONE_DIR_ORIG = 1 << 2,
|
||||
XT_CT_ZONE_DIR_REPL = 1 << 3,
|
||||
XT_CT_ZONE_MARK = 1 << 4,
|
||||
|
||||
XT_CT_MASK = XT_CT_NOTRACK | XT_CT_NOTRACK_ALIAS |
|
||||
XT_CT_ZONE_DIR_ORIG | XT_CT_ZONE_DIR_REPL,
|
||||
XT_CT_ZONE_DIR_ORIG | XT_CT_ZONE_DIR_REPL |
|
||||
XT_CT_ZONE_MARK,
|
||||
};
|
||||
|
||||
struct xt_ct_target_info {
|
||||
|
||||
Reference in New Issue
Block a user