diff -Naur arptables_jf-0.0.8.orig/arptables.c arptables_jf-0.0.8.new/arptables.c --- arptables_jf-0.0.8/arptables.c.byteorder 2009-12-04 13:40:59.000000000 +0100 +++ arptables_jf-0.0.8/arptables.c 2009-12-04 14:14:30.000000000 +0100 @@ -740,7 +740,7 @@ for ( i = 0; table[i].name; i++ ) { if ( ! strcasecmp ( name, table[i].name ) ) { - *value = table[i].value; + *value = htons(table[i].value); *mask = 0xFFFF; return; } @@ -748,7 +748,7 @@ if ( strlen ( name ) == 4 ) { for ( i = 0; table[i].name; i++ ) { if ( ! strncasecmp ( name, table[i].name, 4 ) ) { - *value = table[i].value; + *value = htons(table[i].value); *mask = 0xFFFF; return; } @@ -770,23 +770,21 @@ if ( isxdigit(ch3) ) { if ( isxdigit(ch4) ) { v = (digit_to_bits(ch1)<<12) | (digit_to_bits(ch2)<<8) | ( digit_to_bits(ch3)<<4) | digit_to_bits(ch4); - p = &name[4]; + p += 4; } else { v = (digit_to_bits(ch1)<<8) | (digit_to_bits(ch2)<<4) | ( digit_to_bits(ch3)<<0); - p = &name[3]; + p += 3; } } else { v = (digit_to_bits(ch1)<<4) | (digit_to_bits(ch2)<<0); - p = &name[2]; + p += 2; } } else { v = (digit_to_bits(ch1)<<0); - p = &name[1]; + p++; } - } else { + } else v = 0; - p = name; - } if ( *p == '/' ) { p++; ch1 = p[0]; diff -up arptables_jf-0.0.8/arptables-save.c.byteorder arptables_jf-0.0.8/arptables-save.c --- arptables_jf-0.0.8/arptables-save.c.byteorder 2013-01-08 19:14:01.000000000 +0100 +++ arptables_jf-0.0.8/arptables-save.c 2013-01-08 19:16:39.333712621 +0100 @@ -171,12 +171,12 @@ static void print_rule(const struct arpt print_uint8 ( "-a", e->arp.arhln, e->arp.arhln_mask, e->arp.invflags & ARPT_INV_ARPHLN ); - print_uint16 ( "-p", e->arp.arpop, e->arp.arpop_mask, + print_uint16 ( "-p", ntohs(e->arp.arpop), ntohs(e->arp.arpop_mask), e->arp.invflags & ARPT_INV_ARPOP ); - print_uint16 ( "-H", e->arp.arhrd, e->arp.arhrd_mask, + print_uint16 ( "-H", ntohs(e->arp.arhrd), ntohs(e->arp.arhrd_mask), e->arp.invflags & ARPT_INV_ARPHRD ); - print_uint16 ( "-w", e->arp.arpro, e->arp.arpro_mask, + print_uint16 ( "-w", ntohs(e->arp.arpro), ntohs(e->arp.arpro_mask), e->arp.invflags & ARPT_INV_ARPPRO ); print_hwaddr_and_mask ( "-z", e->arp.src_devaddr.addr, e->arp.src_devaddr.mask,