--- libelwix/inc/elwix/anet.h 2013/06/03 11:48:26 1.2.2.3 +++ libelwix/inc/elwix/anet.h 2013/06/03 14:00:26 1.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: anet.h,v 1.2.2.3 2013/06/03 11:48:26 misho Exp $ +* $Id: anet.h,v 1.3 2013/06/03 14:00:26 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -63,7 +63,10 @@ typedef union { #define E_SOCKADDR_INIT { .ss = { 0 } } typedef union { - struct in_addr in; + union { + in_addr_t s_addr; + u_char s4_addr[sizeof(in_addr_t)]; + } in; struct in6_addr in6; } inaddr_t; @@ -71,8 +74,7 @@ typedef struct { sockaddr_t addr; inaddr_t mask; } netaddr_t; - -#define E_CIDRMASK(x) ((((1 << (x)) - 1) << (32 - (x))) & 0xFFFFFFFF) +#define E_CIDRMASK(x) htonl((((1 << (x)) - 1) << (32 - (x))) & 0xFFFFFFFF) /*