nft: replace nft_rule_attr_get_u8
PATCH 1/1 nft: replace nft_rule_attr_get_u8
Since the family declaration has been modified in libnftnl, from commit 3cd9cd06625f8181c713489cec2c1ce6722a7e16 the assertion is failed for {ip,ip6,arp}tables-compat when printing rules.
iptables-compat -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
libnftnl: attribute 0 assertion failed in rule.c:273
ip6tables-compat -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
libnftnl: attribute 0 assertion failed in rule.c:273
arptables-compat -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
libnftnl: attribute 0 assertion failed in rule.c:273
--- iptables/nft-arp.c | 2 +- iptables/nft-shared.c | 2 +- iptables/nft.c | 2 +- iptables/xtables-events.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
iptables/nft-arp.c +1 -1
@@ -369,7 +369,7 @@ void nft_rule_to_arpt_entry(struct nft_rule *r, struct arpt_entry *fw) {struct nft_rule_expr_iter *iter;struct nft_rule_expr *expr; -int family =nft_rule_attr_get_u8 (r,NFT_RULE_ATTR_FAMILY ); +int family =nft_rule_attr_get_u32 (r,NFT_RULE_ATTR_FAMILY ); iter =nft_rule_expr_iter_create (r);if (iter ==NULL )
iptables/nft-shared.c +1 -1
@@ -458,7 +458,7 @@ void nft_rule_to_iptables_command_state(struct nft_rule *r, {struct nft_rule_expr_iter *iter;struct nft_rule_expr *expr; -int family =nft_rule_attr_get_u8 (r,NFT_RULE_ATTR_FAMILY ); +int family =nft_rule_attr_get_u32 (r,NFT_RULE_ATTR_FAMILY ); iter =nft_rule_expr_iter_create (r);if (iter ==NULL )
iptables/nft.c +1 -1
@@ -1045,7 +1045,7 @@ nft_rule_print_save(const void *data, unsigned int format) {const char *chain =nft_rule_attr_get_str (r,NFT_RULE_ATTR_CHAIN ); -int family =nft_rule_attr_get_u8 (r,NFT_RULE_ATTR_FAMILY ); +int family =nft_rule_attr_get_u32 (r,NFT_RULE_ATTR_FAMILY );struct nft_family_ops *ops;/* print chain name */
iptables/xtables-events.c +1 -1
@@ -75,7 +75,7 @@ static int rule_cb(const struct nlmsghdr *nlh, int type) goto err_free; } - family =nft_rule_attr_get_u8 (r,NFT_RULE_ATTR_FAMILY ); + family =nft_rule_attr_get_u32 (r,NFT_RULE_ATTR_FAMILY );switch (family) {case AF_INET :case AF_INET6 :
Signature · 1 line
1.8.3.2
Quoted 15 lines · Giuseppe Longo
Since the family declaration has been modified in libnftnl, from commit
3cd9cd06625f8181c713489cec2c1ce6722a7e16the assertion is failed for {ip,ip6,arp}tables-compat when printing rules.iptables-compat -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
libnftnl: attribute 0 assertion failed in rule.c:273ip6tables-compat -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
libnftnl: attribute 0 assertion failed in rule.c:273
Quoted 4 lines
arptables-compat -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
libnftnl: attribute 0 assertion failed in rule.c:273
Applied, thanks Giuseppe.