--- libelwix/src/net.c 2017/01/09 12:53:18 1.17 +++ libelwix/src/net.c 2019/01/31 22:19:46 1.19.22.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: net.c,v 1.17 2017/01/09 12:53:18 misho Exp $ +* $Id: net.c,v 1.19.22.1 2019/01/31 22:19:46 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2017 +Copyright 2004 - 2019 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -67,7 +67,7 @@ link_addr(const char *addr, struct sockaddr_dl *sdl) { char *cp = sdl->sdl_data; char *cplim = sdl->sdl_len + (char *)sdl; - int byte = 0, state = NAMING, new; + int byte = 0, state = NAMING, new = 0; bzero((char *)&sdl->sdl_family, sdl->sdl_len - 1); sdl->sdl_family = AF_LINK; @@ -498,8 +498,8 @@ e_innet(netaddr_t * __restrict net, inaddr_t * __restr case AF_INET: for (i = 0; i < sizeof(struct in_addr); i++) { ret = ((caddr_t) &net->addr.sin.sin_addr.s_addr)[i] & - net->mask.in.s4_addr[i]; - ret -= addr->in.s4_addr[i] & net->mask.in.s4_addr[i]; + net->mask.in4.s4_addr[i]; + ret -= addr->in4.s4_addr[i] & net->mask.in4.s4_addr[i]; if (ret) break; } @@ -563,7 +563,7 @@ e_getnet(const char *net) #endif n->addr.sin.sin_family = host->h_addrtype; memcpy(&n->addr.sin.sin_addr, host->h_addr, sizeof n->addr.sin.sin_addr); - if (wrk) + if (wrk && strtol(wrk, NULL, 10) != 32) n->mask.in.s_addr = E_CIDRMASK(strtol(wrk, NULL, 10)); else n->mask.in.s_addr = 0xFFFFFFFF;