diff options
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/dhclient.c | 14 | ||||
-rw-r--r-- | sbin/dhclient/dhcpd.h | 8 | ||||
-rw-r--r-- | sbin/dhclient/dispatch.c | 16 | ||||
-rw-r--r-- | sbin/dhclient/packet.c | 6 |
4 files changed, 19 insertions, 25 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index df3118a6765..d1beddfc07f 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.564 2018/02/11 22:00:19 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.565 2018/02/28 22:16:56 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -373,7 +373,7 @@ routehandler(struct interface_info *ifi, int routefd) linkstat = interface_status(ifi->name); if (linkstat != ifi->linkstat) { - DPRINTF("%s: link %s -> %s", log_procname, + log_debug("%s: link %s -> %s", log_procname, (ifi->linkstat != 0) ? "up" : "down", (linkstat != 0) ? "up" : "down"); ifi->linkstat = linkstat; @@ -810,7 +810,7 @@ dhcpoffer(struct interface_info *ifi, struct option_data *options, const char *src) { if (ifi->state != S_SELECTING) { - DPRINTF("%s: unexpected DHCPOFFER from %s - state #%d", + log_debug("%s: unexpected DHCPOFFER from %s - state #%d", log_procname, src, ifi->state); return; } @@ -824,7 +824,7 @@ bootreply(struct interface_info *ifi, struct option_data *options, const char *src) { if (ifi->state != S_SELECTING) { - DPRINTF("%s: unexpected BOOTREPLY from %s - state #%d", + log_debug("%s: unexpected BOOTREPLY from %s - state #%d", log_procname, src, ifi->state); return; } @@ -882,7 +882,7 @@ dhcpack(struct interface_info *ifi, struct option_data *options, if (ifi->state != S_REBOOTING && ifi->state != S_REQUESTING && ifi->state != S_RENEWING) { - DPRINTF("%s: unexpected DHCPACK from %s - state #%d", + log_debug("%s: unexpected DHCPACK from %s - state #%d", log_procname, src, ifi->state); return; } @@ -913,13 +913,13 @@ dhcpnak(struct interface_info *ifi, const char *src) if (ifi->state != S_REBOOTING && ifi->state != S_REQUESTING && ifi->state != S_RENEWING) { - DPRINTF("%s: unexpected DHCPNAK from %s - state #%d", + log_debug("%s: unexpected DHCPNAK from %s - state #%d", log_procname, src, ifi->state); return; } if (ifi->active == NULL) { - DPRINTF("%s: unexpected DHCPNAK from %s - no active lease", + log_debug("%s: unexpected DHCPNAK from %s - no active lease", log_procname, src); return; } diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h index 92336535a85..89d6cc5063a 100644 --- a/sbin/dhclient/dhcpd.h +++ b/sbin/dhclient/dhcpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcpd.h,v 1.253 2018/02/10 23:25:15 krw Exp $ */ +/* $OpenBSD: dhcpd.h,v 1.254 2018/02/28 22:16:56 krw Exp $ */ /* * Copyright (c) 2004 Henning Brauer <henning@openbsd.org> @@ -152,12 +152,6 @@ struct interface_info { struct client_lease_tq lease_db; }; -#ifdef DEBUG -#define DPRINTF(...) log_debug(__VA_ARGS__) -#else -#define DPRINTF(...) do {} while(0) -#endif - #define _PATH_DHCLIENT_CONF "/etc/dhclient.conf" #define _PATH_LEASE_DB "/var/db/dhclient.leases" diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index fed4b49d2aa..14303ac4eb8 100644 --- a/sbin/dhclient/dispatch.c +++ b/sbin/dhclient/dispatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dispatch.c,v 1.149 2018/01/28 23:12:36 krw Exp $ */ +/* $OpenBSD: dispatch.c,v 1.150 2018/02/28 22:16:56 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -200,26 +200,26 @@ packethandler(struct interface_info *ifi) ifrom.s_addr = from.sin_addr.s_addr; if (packet->hlen != ETHER_ADDR_LEN) { - DPRINTF("%s: discarding packet with hlen == %u", log_procname, + log_debug("%s: discarding packet with hlen == %u", log_procname, packet->hlen); return; } else if (memcmp(&ifi->hw_address, packet->chaddr, sizeof(ifi->hw_address))) { - DPRINTF("%s: discarding packet with chaddr == %s", + log_debug("%s: discarding packet with chaddr == %s", log_procname, ether_ntoa((struct ether_addr *)packet->chaddr)); return; } if (ifi->xid != packet->xid) { - DPRINTF("%s: discarding packet with XID != %u (%u)", + log_debug("%s: discarding packet with XID != %u (%u)", log_procname, ifi->xid, packet->xid); return; } TAILQ_FOREACH(ap, &config->reject_list, next) if (ifrom.s_addr == ap->addr.s_addr) { - DPRINTF("%s: discarding packet from address on reject " + log_debug("%s: discarding packet from address on reject " "list (%s)", log_procname, inet_ntoa(ifrom)); return; } @@ -235,7 +235,7 @@ packethandler(struct interface_info *ifi) ((options[i].len != config->send_options[i].len) || memcmp(options[i].data, config->send_options[i].data, options[i].len) != 0)) { - DPRINTF("%s: discarding packet with client-identifier %s'", + log_debug("%s: discarding packet with client-identifier %s'", log_procname, pretty_print_option(i, &options[i], 0)); return; } @@ -258,14 +258,14 @@ packethandler(struct interface_info *ifi) dhcpack(ifi, options, src); break; default: - DPRINTF("%s: discarding DHCP packet of unknown type " + log_debug("%s: discarding DHCP packet of unknown type " "(%d)", log_procname, options[i].data[0]); break; } } else if (packet->op == BOOTREPLY) { bootreply(ifi, options, src); } else { - DPRINTF("%s: discarding packet which is neither DHCP nor " + log_debug("%s: discarding packet which is neither DHCP nor " "BOOTP", log_procname); } diff --git a/sbin/dhclient/packet.c b/sbin/dhclient/packet.c index fa2f5d10ebb..903b719c772 100644 --- a/sbin/dhclient/packet.c +++ b/sbin/dhclient/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.43 2018/01/29 13:41:30 krw Exp $ */ +/* $OpenBSD: packet.c,v 1.44 2018/02/28 22:16:56 krw Exp $ */ /* Packet assembly code, originally contributed by Archie Cobbs. */ @@ -160,7 +160,7 @@ decode_udp_ip_header(unsigned char *buf, uint32_t buflen, memcpy(&from->sin_addr, &ip->ip_src, sizeof(from->sin_addr)); if (ntohs(ip->ip_len) != buflen) - DPRINTF("%s: ip length %hu disagrees with bytes received %d", + log_debug("%s: ip length %hu disagrees with bytes received %d", log_procname, ntohs(ip->ip_len), buflen); /* Assure that the entire IP packet is within the buffer. */ @@ -200,7 +200,7 @@ decode_udp_ip_header(unsigned char *buf, uint32_t buflen, return -1; } if (len + data != buf + buflen) - DPRINTF("%s: accepting packet with data after udp payload", + log_debug("%s: accepting packet with data after udp payload", log_procname); usum = udp->uh_sum; |