* src: flatten casts in libxt_mac
@ 2008-08-15 22:56 Jan Engelhardt
2008-09-01 12:18 ` Patrick McHardy
0 siblings, 1 reply; 2+ messages in thread
From: Jan Engelhardt @ 2008-08-15 22:56 UTC (permalink / raw)
To: kaber; +Cc: Netfilter Developer Mailing List
commit bea784eff0e167fc8ba28e6ff6d216d95def610b
Author: Jan Engelhardt <jengelh@medozas.de>
Date: Fri Aug 15 18:48:35 2008 -0400
src: flatten casts in libxt_mac
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
---
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 a842ee9..bc91f0f 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 = {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: src: flatten casts in libxt_mac
2008-08-15 22:56 src: flatten casts in libxt_mac Jan Engelhardt
@ 2008-09-01 12:18 ` Patrick McHardy
0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2008-09-01 12:18 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Netfilter Developer Mailing List
Jan Engelhardt wrote:
> src: flatten casts in libxt_mac
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-01 12:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-15 22:56 src: flatten casts in libxt_mac Jan Engelhardt
2008-09-01 12:18 ` Patrick McHardy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.