diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-02-25 01:02:08 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-02-25 13:40:34 +0100 |
commit | 10bdec0add3dcb7c0115575c24a440c66c24f6fd (patch) | |
tree | 82a0e3c5410b9f1d292261863eca4810f46ae510 /include | |
parent | b9b6092304aef17fea704c25b3d9d7dcdb3995a5 (diff) |
netlink: store set byteorder in NFTA_SET_USERDATA
The integer datatype has neither specific byteorder nor length. This
results in the following broken output:
# nft list ruleset
table ip x {
chain y {
mark set cpu map { 0 : 0x00000001, 16777216 : 0x00000002}
}
}
Currently, with BYTEORDER_INVALID, nft defaults on network byteorder,
hence the output above.
This patch stores the key byteorder in the userdata using a TLV
structure in the NFTA_SET_USERDATA area, so nft can interpret key
accordingly when dumping the set back to userspace.
Thus, after this patch the listing is correct:
# nft list ruleset
table ip x {
chain y {
mark set cpu map { 0 : 0x00000001, 1 : 0x00000002}
}
}
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/rule.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/rule.h b/include/rule.h index 878563d9..f5160daf 100644 --- a/include/rule.h +++ b/include/rule.h @@ -477,4 +477,10 @@ enum udata_type { #define UDATA_COMMENT_MAXLEN 128 +enum udata_set_type { + UDATA_SET_KEYBYTEORDER, + __UDATA_SET_MAX, +}; +#define UDATA_SET_MAX (__UDATA_SET_MAX - 1) + #endif /* NFTABLES_RULE_H */ |