From 52475f30c4ef70fc938e8837f953e1a32f916066 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Mon, 22 Aug 2005 16:01:43 +0000 Subject: Added code for calculating ip subnets. --- src/ipnets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ipnets.c') diff --git a/src/ipnets.c b/src/ipnets.c index 97196fa..5a4a0a1 100644 --- a/src/ipnets.c +++ b/src/ipnets.c @@ -71,9 +71,9 @@ int block_ntoa(const char* s, struct in_addr* addr, /* If we've been asked to truncate and the IP's netmask is on a unit, then we can truncate */ if(format & INET_BLOCK_TRUNC && - zb(ntohl(netmask.s_addr)) % 8 == 0) + zb(ntohl(netmask->s_addr)) % 8 == 0) { - in_addr_t ip = ntohl(in_addr.s_addr); + in_addr_t ip = ntohl(addr->s_addr); /* Loop through and print relevant octets */ int octets = (32 - zb(ip)) / 8; -- cgit v1.2.3