From 4a4059c3051332e858cf0699aa2441a93c8a2620 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 14 Jan 2003 05:28:55 +0000 Subject: fix calculation of /32 addresses (#76646) --- src/ipcalc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipcalc.c b/src/ipcalc.c index d981be83..93905ae2 100644 --- a/src/ipcalc.c +++ b/src/ipcalc.c @@ -70,7 +70,7 @@ \return a network mask, in network byte order. */ unsigned long int prefix2mask(int prefix) { - return htonl(~((2 << (31 - prefix)) - 1)); + return htonl(~((1 << (32 - prefix)) - 1)); } /*! -- cgit