From 3f451932703b38b27b6c72aa8feb1eedfa9875ba Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Thu, 11 Aug 2011 18:35:48 +0000 Subject: small changes to remove warnings when optimization is on (thanks to Peter Volkov) --- extensions/ebt_among.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'extensions/ebt_among.c') diff --git a/extensions/ebt_among.c b/extensions/ebt_among.c index b98f65b..f97d07e 100644 --- a/extensions/ebt_among.c +++ b/extensions/ebt_among.c @@ -247,7 +247,7 @@ static struct ebt_mac_wormhash *create_wormhash(const char *arg) ebt_print_error("IP parse error: %.20s", anchor); return NULL; } - if (*(uint32_t*)ip == 0) { + if (ip[0] == 0 && ip[1] == 0 && ip[2] == 0 && ip[3] == 0) { ebt_print_error("Illegal IP 0.0.0.0"); return NULL; } @@ -258,7 +258,7 @@ static struct ebt_mac_wormhash *create_wormhash(const char *arg) /* we have collected MAC and IP, so we add an entry */ memcpy(((char *) workcopy->pool[nmacs].cmp) + 2, mac, 6); - workcopy->pool[nmacs].ip = *(const uint32_t *) ip; + memcpy(&(workcopy->pool[nmacs].ip), ip, 4); nmacs++; /* re-allocate memory if needed */ @@ -313,8 +313,8 @@ static int parse(int c, char **argv, int argc, struct ebt_mac_wormhash *wh; struct ebt_entry_match *h; int new_size; - long flen; - int fd; + long flen = 0; + int fd = -1; switch (c) { case AMONG_DST_F: -- cgit v1.2.3