diff --git a/arpwatch.c b/arpwatch.c index c570ce8..d2500f7 100644 --- a/arpwatch.c +++ b/arpwatch.c @@ -730,11 +730,12 @@ addnet(register const char *str) /* XXX hack */ n = ntohl(inet_addr(tstr)); - while ((n & 0xff000000) == 0) { - n <<= 8; - if (n == 0) - return (0); - } + if (n || width != 32) + while ((n & 0xff000000) == 0) { + n <<= 8; + if (n == 0) + return (0); + } n = htonl(n); if (width != 0) {