diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2008-09-01 14:18:01 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-09-01 14:18:01 +0200 |
commit | 161143d88c4c6f8b25ef191971757803dc5c7c2d (patch) | |
tree | 441e921f18fb0d55bdbfca6ec62020087c0e5d2e | |
parent | a47bb4a9fa24db2f3ba6559c9175f3f1144ee74c (diff) |
libxt_mac: flatten casts in libxt_mac
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r-- | extensions/libxt_mac.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/extensions/libxt_mac.c b/extensions/libxt_mac.c index a842ee9b..bc91f0f4 100644 --- a/extensions/libxt_mac.c +++ b/extensions/libxt_mac.c @@ -74,7 +74,7 @@ mac_parse(int c, char **argv, int invert, unsigned int *flags, return 1; } -static void print_mac(unsigned char macaddress[ETH_ALEN]) +static void print_mac(const unsigned char macaddress[ETH_ALEN]) { unsigned int i; @@ -96,22 +96,25 @@ static void mac_check(unsigned int flags) 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 = { |