From a72401cc95007729f267df9b79b7078542b28c8d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 3 Jun 2015 21:26:49 +0200 Subject: clean up comments --- dyndhcpd.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dyndhcpd.c b/dyndhcpd.c index 9869121..79b345d 100644 --- a/dyndhcpd.c +++ b/dyndhcpd.c @@ -138,23 +138,19 @@ int main(int argc, char ** argv) { if (!(ifa->ifa_flags & IFF_RUNNING)) fprintf(stderr, "Warning: Interface %s is not connected.\n", interface); - /* get variables in place for address */ + /* get variables in place for address and convert from binary to text */ s4 = (struct sockaddr_in *)ifa->ifa_addr; memcpy(&address.i, &s4->sin_addr, sizeof(struct in_addr)); - - /* convert address from binary to text form */ if (!inet_ntop(AF_INET, &address.i, address.c, INET_ADDRSTRLEN)) fprintf(stderr, "%s: inet_ntop failed!\n", ifa->ifa_name); - /* get variables in place for netmask */ + /* get variables in place for netmask and convert from binary to text */ s4 = (struct sockaddr_in *)ifa->ifa_netmask; memcpy(&netmask.i, &s4->sin_addr, sizeof(struct in_addr)); - - /* convert netmask from binary to text form */ if (!inet_ntop(AF_INET, &netmask.i, netmask.c, INET_ADDRSTRLEN)) fprintf(stderr, "%s: inet_ntop failed!\n", ifa->ifa_name); - /* calculate broadcast and net address */ + /* calculate broadcast and netaddress */ broadcast.i.s_addr = address.i.s_addr |~ netmask.i.s_addr; netaddress.i.s_addr = address.i.s_addr & netmask.i.s_addr; -- cgit v1.2.3-70-g09d2