ip6tables: Fix checking existence of rule
PATCH 1/1 ip6tables: Fix checking existence of rule
Pass the proper entry size when creating a match mask for checking the existence of a rule. Failing to do so causes wrong results.
Reported-by Jonathan Caicedo <[email protected]>
Fixes eb2546a846776 ("xshared: Share make_delete_mask() between ip{,6}tables")
Signed-off-by Markus Boehme <[email protected]>
--- iptables/ip6tables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
iptables/ip6tables.c +1 -1
@@ -331,7 +331,7 @@ check_entry(const xt_chainlabel chain, struct ip6t_entry *fw,int ret =1 ;unsigned char *mask; - mask =make_delete_mask (matches, target,sizeof (fw)); + mask =make_delete_mask (matches, target,sizeof (*fw));for (i =0 ; i < nsaddrs; i++) { fw->ipv6.src = saddrs[i]; fw->ipv6.smsk = smasks[i];
Signature · 1 line
2.25.1
Phil Sutter
reviewerQuoted 6 lines · Markus Boehme
Pass the proper entry size when creating a match mask for checking the existence of a rule. Failing to do so causes wrong results.
Reported-by Jonathan Caicedo <[email protected]>Fixes eb2546a846776 ("xshared: Share make_delete_mask() between ip{,6}tables")Signed-off-by Markus Boehme <[email protected]>
Patch applied, thanks!