summaryrefslogtreecommitdiffstats
path: root/usr.sbin/dhcpd/dhcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/dhcpd/dhcp.c')
-rw-r--r--usr.sbin/dhcpd/dhcp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.sbin/dhcpd/dhcp.c b/usr.sbin/dhcpd/dhcp.c
index 2790ea4f2d1..7d0eddf419a 100644
--- a/usr.sbin/dhcpd/dhcp.c
+++ b/usr.sbin/dhcpd/dhcp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcp.c,v 1.27 2008/07/21 16:51:18 millert Exp $ */
+/* $OpenBSD: dhcp.c,v 1.28 2009/09/01 08:42:31 reyk Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998, 1999
@@ -1145,6 +1145,19 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer,
state->options[i]->tree = NULL;
}
+ /* Echo back the relay agent information, if present */
+ i = DHO_RELAY_AGENT_INFORMATION;
+ if (state->giaddr.s_addr && !state->options[i] &&
+ packet->options[i].data && packet->options[i].len) {
+ state->options[i] = new_tree_cache("relay-agent-information");
+ state->options[i]->flags = TC_TEMPORARY;
+ state->options[i]->value = packet->options[i].data;
+ state->options[i]->len = packet->options[i].len;
+ state->options[i]->buf_size = packet->options[i].len;
+ state->options[i]->timeout = -1;
+ state->options[i]->tree = NULL;
+ }
+
lease->state = state;
/* If this is a DHCPOFFER, ping the lease address before actually