summaryrefslogtreecommitdiffstats
path: root/host.c
diff options
context:
space:
mode:
Diffstat (limited to 'host.c')
-rw-r--r--host.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/host.c b/host.c
index c4e4284..9fc2cad 100644
--- a/host.c
+++ b/host.c
@@ -106,7 +106,7 @@ unsigned long long int ri (unsigned long long int v, int s) { /* 000 100 010 110
unsigned long long int localnumber (struct in_net n) {
unsigned long long int r = 0;
for (int i = 31; i >= 0; i--)
- if (n.mask.s_addr & 1 << i && n.addr.s_addr & 1 << i)
+ if (!(ntohl(n.mask.s_addr) & 1 << i) && ntohl(n.addr.s_addr) & 1 << i)
r |= 1 << i;
return r;
}