summaryrefslogtreecommitdiff
path: root/sbin/dhclient/dhclient.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2009-03-10 23:19:37 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2009-03-10 23:19:37 +0000
commit6d115faf82e04383d16fc79b2a088e50832dd304 (patch)
treeccc8eda89dcdc18979832e70c8873908767418cc /sbin/dhclient/dhclient.c
parentc6977743257ce3292ee135a68fdf73453058c074 (diff)
Add 6-byte MAC address to the log entries for DHCP ACK/NAK/OFFER.
Log the packets before checking the client state. Makes it easy to find MACs for 'surprise' DHCP servers. Positive comments from mbalmer@, jasper@.
Diffstat (limited to 'sbin/dhclient/dhclient.c')
-rw-r--r--sbin/dhclient/dhclient.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index d0c5974c379..5e7726cc39a 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.123 2009/02/01 12:10:14 miod Exp $ */
+/* $OpenBSD: dhclient.c,v 1.124 2009/03/10 23:19:36 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -602,17 +602,12 @@ dhcpack(struct iaddr client_addr, struct option_data *options)
{
struct client_lease *lease;
- if (client->xid != client->packet.xid)
- return;
-
if (client->state != S_REBOOTING &&
client->state != S_REQUESTING &&
client->state != S_RENEWING &&
client->state != S_REBINDING)
return;
- note("DHCPACK from %s", piaddr(client_addr));
-
lease = packet_to_lease(client_addr, options);
if (!lease) {
note("packet_to_lease failed.");
@@ -744,14 +739,9 @@ dhcpoffer(struct iaddr client_addr, struct option_data *options)
char *name = options[DHO_DHCP_MESSAGE_TYPE].len ? "DHCPOFFER" :
"BOOTREPLY";
- if (client->xid != client->packet.xid)
- return;
-
if (client->state != S_SELECTING)
return;
- note("%s from %s", name, piaddr(client_addr));
-
/* If this lease doesn't supply the minimum required parameters,
blow it off. */
for (i = 0; config->required_options[i]; i++) {
@@ -922,17 +912,12 @@ packet_to_lease(struct iaddr client_addr, struct option_data *options)
void
dhcpnak(struct iaddr client_addr, struct option_data *options)
{
- if (client->xid != client->packet.xid)
- return;
-
if (client->state != S_REBOOTING &&
client->state != S_REQUESTING &&
client->state != S_RENEWING &&
client->state != S_REBINDING)
return;
- note("DHCPNAK from %s", piaddr(client_addr));
-
if (!client->active) {
note("DHCPNAK with no active lease.");
return;