aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2003-01-14 05:28:55 +0000
committerBill Nottingham <notting@redhat.com>2003-01-14 05:28:55 +0000
commit4a4059c3051332e858cf0699aa2441a93c8a2620 (patch)
tree7d7291b6902e9acb8b9481d9a9165cb8bfd471df /src
parent3de5afef5691795074dd5796bc4bc6ec7228ceb3 (diff)
downloadinitscripts-4a4059c3051332e858cf0699aa2441a93c8a2620.tar
initscripts-4a4059c3051332e858cf0699aa2441a93c8a2620.tar.gz
initscripts-4a4059c3051332e858cf0699aa2441a93c8a2620.tar.bz2
initscripts-4a4059c3051332e858cf0699aa2441a93c8a2620.tar.xz
initscripts-4a4059c3051332e858cf0699aa2441a93c8a2620.zip
fix calculation of /32 addresses (#76646)
Diffstat (limited to 'src')
-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));
}
/*!