udhcp: change UDHCP_DEBUG into int, make verbosity selectable with -v
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
diff --git a/networking/udhcp/socket.c b/networking/udhcp/socket.c
index de494ca..6b15766 100644
--- a/networking/udhcp/socket.c
+++ b/networking/udhcp/socket.c
@@ -57,7 +57,7 @@
}
our_ip = (struct sockaddr_in *) &ifr.ifr_addr;
*nip = our_ip->sin_addr.s_addr;
- DEBUG("ip of %s = %s", interface, inet_ntoa(our_ip->sin_addr));
+ log1("IP %s", inet_ntoa(our_ip->sin_addr));
}
if (ifindex) {
@@ -65,7 +65,7 @@
close(fd);
return -1;
}
- DEBUG("adapter index %d", ifr.ifr_ifindex);
+ log1("Adapter index %d", ifr.ifr_ifindex);
*ifindex = ifr.ifr_ifindex;
}
@@ -75,7 +75,7 @@
return -1;
}
memcpy(mac, ifr.ifr_hwaddr.sa_data, 6);
- DEBUG("adapter hardware address %02x:%02x:%02x:%02x:%02x:%02x",
+ log1("MAC %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
}
@@ -90,7 +90,7 @@
int fd;
struct sockaddr_in addr;
- DEBUG("Opening listen socket on *:%d %s", port, inf);
+ log1("Opening listen socket on *:%d %s", port, inf);
fd = xsocket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
setsockopt_reuseaddr(fd);