summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2014-11-11 19:59:47 +0000
committerkrw <krw@openbsd.org>2014-11-11 19:59:47 +0000
commitc9109787927d2733b3f3949ed7b74f6486b26d19 (patch)
tree448300549a29e20d7491576106758cc53b8b3421
parentf{read,write} take a number of items and an item size as arguments, and (diff)
downloadwireguard-openbsd-c9109787927d2733b3f3949ed7b74f6486b26d19.tar.xz
wireguard-openbsd-c9109787927d2733b3f3949ed7b74f6486b26d19.zip
Tweak the the DHCPACK to DHCPINFORM log entry so that it is
less threatening and more informative. e.g. DHCPACK on <null address> to 5c:51:4f:56:81:c3 via em0 changes to DHCPACK to 192.168.19.62 (3c:97:0e:0c:0c:d7) via em0 Issue noted and diff tested by Marc Peters. Thanks! ok yasuoka@ millert@
-rw-r--r--usr.sbin/dhcpd/dhcp.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/usr.sbin/dhcpd/dhcp.c b/usr.sbin/dhcpd/dhcp.c
index 6dbd479b334..0500c7e4d46 100644
--- a/usr.sbin/dhcpd/dhcp.c
+++ b/usr.sbin/dhcpd/dhcp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcp.c,v 1.40 2014/11/10 13:03:51 krw Exp $ */
+/* $OpenBSD: dhcp.c,v 1.41 2014/11/11 19:59:47 krw Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998, 1999
@@ -1306,13 +1306,22 @@ dhcp_reply(struct lease *lease)
raw.op = BOOTREPLY;
/* Say what we're doing... */
- note("%s on %s to %s via %s",
- (state->offer ? (state->offer == DHCPACK ? "DHCPACK" : "DHCPOFFER") :
- "BOOTREPLY"),
- piaddr(lease->ip_addr),
- print_hw_addr(lease->hardware_addr.htype, lease->hardware_addr.hlen,
- lease->hardware_addr.haddr),
- state->giaddr.s_addr ? inet_ntoa(state->giaddr) : state->ip->name);
+ if ((state->offer == DHCPACK) && (lease->flags & INFORM_NOLEASE))
+ note("DHCPACK to %s (%s) via %s",
+ inet_ntoa(state->ciaddr),
+ print_hw_addr(lease->hardware_addr.htype,
+ lease->hardware_addr.hlen, lease->hardware_addr.haddr),
+ state->giaddr.s_addr ? inet_ntoa(state->giaddr) :
+ state->ip->name);
+ else
+ note("%s on %s to %s via %s",
+ (state->offer ? (state->offer == DHCPACK ? "DHCPACK" :
+ "DHCPOFFER") : "BOOTREPLY"),
+ piaddr(lease->ip_addr),
+ print_hw_addr(lease->hardware_addr.htype,
+ lease->hardware_addr.hlen, lease->hardware_addr.haddr),
+ state->giaddr.s_addr ? inet_ntoa(state->giaddr) :
+ state->ip->name);
memset(&to, 0, sizeof to);
to.sin_family = AF_INET;