summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2015-06-03 21:26:49 +0200
committerGravatar Christian Hesse <mail@eworm.de>2015-06-03 21:26:49 +0200
commita72401cc95007729f267df9b79b7078542b28c8d (patch)
treebab445214b91954b76ef7dd0aae745bd34cfdea5
parent659bbd0bef562badec1bc2d3c092a0d8781f6878 (diff)
downloaddyndhcpd-a72401cc95007729f267df9b79b7078542b28c8d.tar.gz
dyndhcpd-a72401cc95007729f267df9b79b7078542b28c8d.tar.zst
clean up comments
-rw-r--r--dyndhcpd.c10
1 files 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;