PATCH: fix invert flag on match mac save
Hi there,
I've been having problems using iptables-restore with the match mac
extension, which I narrowed down to the position of the invert flag on save. Looks like this one's been hanging around for a while now.
===================================================================
libipt_mac.c 2003-06-01 17:55:43.000000000 +0100 renamed from libipt_mac.c 2003-06-01 17:47:52.000000000 +0100 +0 -0
@@ -118,9 +118,10 @@ /* Saves the union ipt_matchinfo in parsable form to stdout. */ static void save(const struct ipt_ip *ip, const struct ipt_entry_match
*match)
{
+ if (((struct ipt_mac_info *)match->data)->invert)
+ printf("! ");
printf("--mac-source ");
- print_mac(((struct ipt_mac_info *)match->data)->srcaddr,
- ((struct ipt_mac_info *)match->data)->invert);
+ print_mac(((struct ipt_mac_info *)match->data)->srcaddr,0);
}
static
libip6t_mac.c 2003-06-01 17:57:04.000000000 +0100 renamed from libip6t_mac.c 2003-06-01 17:56:15.000000000 +0100 +0 -0
@@ -118,9 +118,10 @@ /* Saves the union ip6t_matchinfo in parsable form to stdout. */ static void save(const struct ip6t_ip6 *ip, const struct
ip6t_entry_match *match)
{
+ if (((struct ip6t_mac_info *)match->data)->invert)
+ printf("! ");
printf("--mac-source ");
- print_mac(((struct ip6t_mac_info *)match->data)->srcaddr,
- ((struct ip6t_mac_info *)match->data)->invert);
+ print_mac(((struct ip6t_mac_info *)match->data)->srcaddr,0);
}
static
===================================================================
David Zambonini
Martin Josefsson
AppliedQuoted 4 lines · Dave
Hi there,
I've been having problems using iptables-restore with the match mac
extension, which I narrowed down to the position of the invert flag on save. Looks like this one's been hanging around for a while now.
I applied a slightly modified version, thanks.
Signature · 1 line
/Martin