summaryrefslogtreecommitdiffstats
path: root/userspace/ebtables2/extensions/ebt_among.c
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
commite3f9743830dc5f1dfe05c85d38ff3d7f3e07ab75 (patch)
treef01b247a7b38110c7f7213f8f9cddaf9f741e4a5 /userspace/ebtables2/extensions/ebt_among.c
parent920ab8c98a4d81d97171d28be77e40373e3d9d61 (diff)
small changes to remove warnings when optimization is on (thanks to Peter Volkov)
Diffstat (limited to 'userspace/ebtables2/extensions/ebt_among.c')
-rw-r--r--userspace/ebtables2/extensions/ebt_among.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/userspace/ebtables2/extensions/ebt_among.c b/userspace/ebtables2/extensions/ebt_among.c
index b98f65b..f97d07e 100644
--- a/userspace/ebtables2/extensions/ebt_among.c
+++ b/userspace/ebtables2/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: