return 1;
}
-static void print_mac(unsigned char macaddress[ETH_ALEN])
+static void print_mac(const unsigned char macaddress[ETH_ALEN])
{
unsigned int i;
static void
mac_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
+ const struct xt_mac_info *info = (void *)match->data;
printf("MAC ");
- if (((struct xt_mac_info *)match->data)->invert)
+ if (info->invert)
printf("! ");
- print_mac(((struct xt_mac_info *)match->data)->srcaddr);
+ print_mac(info->srcaddr);
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
static void mac_save(const void *ip, const struct xt_entry_match *match)
{
- if (((struct xt_mac_info *)match->data)->invert)
+ const struct xt_mac_info *info = (void *)match->data;
+
+ if (info->invert)
printf("! ");
printf("--mac-source ");
- print_mac(((struct xt_mac_info *)match->data)->srcaddr);
+ print_mac(info->srcaddr);
}
static struct xtables_match mac_match = {