summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart De Schuymer <bdschuym@pandora.be>2011-08-11 18:35:48 +0000
committerBart De Schuymer <bdschuym@pandora.be>2011-08-11 18:35:48 +0000
commit3f451932703b38b27b6c72aa8feb1eedfa9875ba (patch)
tree9815ed2402e6a285ff994393beddfd4075ef3f8c
parentfaaa1a642cd7ae131df1098487f01ac74de2b66e (diff)
small changes to remove warnings when optimization is on (thanks to Peter Volkov)
-rw-r--r--extensions/ebt_among.c8
1 files changed, 4 insertions, 4 deletions
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: