aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ipcalc.c2
1 files changed, 1 insertions, 1 deletions
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));
}
/*!