diff options
author | 2009-09-01 08:42:31 +0000 | |
---|---|---|
committer | 2009-09-01 08:42:31 +0000 | |
commit | 5b44f46dad3fa8fe61fd7f1f5f74f16728c06d76 (patch) | |
tree | 0458ec671b3fd35b569f2120788d40c9254aadef /usr.sbin/dhcpd/dhcp.c | |
parent | Make rtinit() cope when there is a more specific route available then (diff) | |
download | wireguard-openbsd-5b44f46dad3fa8fe61fd7f1f5f74f16728c06d76.tar.xz wireguard-openbsd-5b44f46dad3fa8fe61fd7f1f5f74f16728c06d76.zip |
Echo back the Relay Agent Information option if present (RFC 3046).
Also add support for the "ipsec-tunnel" hardware type as described in
RFC 3456.
ok henning@ krw@ (but needs more testing from others)
Diffstat (limited to 'usr.sbin/dhcpd/dhcp.c')
-rw-r--r-- | usr.sbin/dhcpd/dhcp.c | 15 |
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 |