diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2015-08-25 14:22:41 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-09-29 20:39:26 +0200 |
commit | d3d2bee2d9ebd565e006f213c76cfa316b5e5ab1 (patch) | |
tree | ba853d38ef24d856cc24a1fd8365cc41749126c4 /src/conntrack/parse_mnl.c | |
parent | ca8fa0b9f03968d5077af162010d670631089b6a (diff) |
conntrack: add zone attribute to tuple
This patch adds the front-end to the recent ctnetlink interface
changes that add the zone attribute into the tuple.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/conntrack/parse_mnl.c')
-rw-r--r-- | src/conntrack/parse_mnl.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/conntrack/parse_mnl.c b/src/conntrack/parse_mnl.c index 2582cd7..56a575e 100644 --- a/src/conntrack/parse_mnl.c +++ b/src/conntrack/parse_mnl.c @@ -254,7 +254,12 @@ static int nfct_parse_tuple_attr_cb(const struct nlattr *attr, void *data) if (mnl_attr_validate(attr, MNL_TYPE_NESTED) < 0) return MNL_CB_ERROR; break; + case CTA_TUPLE_ZONE: + if (mnl_attr_validate(attr, MNL_TYPE_U16) < 0) + return MNL_CB_ERROR; + break; } + tb[type] = attr; return MNL_CB_OK; } @@ -278,6 +283,18 @@ nfct_parse_tuple(const struct nlattr *attr, struct __nfct_tuple *tuple, return -1; } + if (tb[CTA_TUPLE_ZONE]) { + tuple->zone = ntohs(mnl_attr_get_u16(tb[CTA_TUPLE_ZONE])); + switch(dir) { + case __DIR_ORIG: + set_bit(ATTR_ORIG_ZONE, set); + break; + case __DIR_REPL: + set_bit(ATTR_REPL_ZONE, set); + break; + } + } + return 0; } |