nft: A non valid if index should not be handled
PATCH 1/1 nft: A non valid if index should not be handled
Signed-off-by Tomasz Bursztyka <[email protected]>
--- iptables/nft-shared.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
iptables/nft-shared.c +4 -6
@@ -226,18 +226,16 @@ void parse_meta(struct nft_rule_expr *e, uint8_t key, char *iniface,if (nft_rule_expr_get_u8 (e,NFT_EXPR_CMP_OP ) ==NFT_CMP_NEQ ) *invflags |=IPT_INV_VIA_IN ; -if_indextoname (value, iniface); - -memset (iniface_mask,0xff ,strlen (iniface)+1 ); +if (if_indextoname (value, iniface) !=NULL ) +memset (iniface_mask,0xff ,strlen (iniface)+1 );break ;case NFT_META_OIF : value =nft_rule_expr_get_u32 (e,NFT_EXPR_CMP_DATA );if (nft_rule_expr_get_u8 (e,NFT_EXPR_CMP_OP ) ==NFT_CMP_NEQ ) *invflags |=IPT_INV_VIA_OUT ; -if_indextoname (value, outiface); - -memset (outiface_mask,0xff ,strlen (outiface)+1 ); +if (if_indextoname (value, outiface) !=NULL ) +memset (outiface_mask,0xff ,strlen (outiface)+1 );break ;case NFT_META_IIFNAME : ifname =nft_rule_expr_get (e,NFT_EXPR_CMP_DATA , &len);
Signature · 1 line
1.8.3.2
Pablo Neira Ayuso
maintainerHi Tomasz,
Quoted 10 lines · Tomasz Bursztyka
Signed-off-by Tomasz Bursztyka <[email protected]>--- iptables/nft-shared.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)iptables/nft-shared.c +0
-0
iptables/nft-shared.c void parse_meta(struct nft_rule_expr *e, uint8_t key, char *iniface, · line 230
Quoted 8 lines
iptables/nft-shared.c +2
-3@@ -226,18 +226,16 @@ void parse_meta(struct nft_rule_expr *e, uint8_t key, char *iniface,if (nft_rule_expr_get_u8 (e,NFT_EXPR_CMP_OP ) ==NFT_CMP_NEQ ) *invflags |=IPT_INV_VIA_IN ; -if_indextoname (value, iniface); - -memset (iniface_mask,0xff ,strlen (iniface)+1 ); +if (if_indextoname (value, iniface) !=NULL ) +memset (iniface_mask,0xff ,strlen (iniface)+1 );
We have to convert iptables-nftables to use NFT_META_IIFNAME instead of NFT_META_IIF to make it behave like iptables. This was somewhere in my list of pending things.
Would you have a look at that?
Thanks.
Quoted 21 lines
iptables/nft-shared.c +2
-3break ;case NFT_META_OIF : value =nft_rule_expr_get_u32 (e,NFT_EXPR_CMP_DATA );if (nft_rule_expr_get_u8 (e,NFT_EXPR_CMP_OP ) ==NFT_CMP_NEQ ) *invflags |=IPT_INV_VIA_OUT ; -if_indextoname (value, outiface); - -memset (outiface_mask,0xff ,strlen (outiface)+1 ); +if (if_indextoname (value, outiface) !=NULL ) +memset (outiface_mask,0xff ,strlen (outiface)+1 );break ;case NFT_META_IIFNAME : ifname =nft_rule_expr_get (e,NFT_EXPR_CMP_DATA , &len);Signature · 6 lines
1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Pablo,
Quoted 5 lines
We have to convert iptables-nftables to use
NFT_META_IIFNAMEinstead ofNFT_META_IIFto make it behave like iptables. This was somewhere in my list of pending things.Would you have a look at that?
Sure.
Tomaz