diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-10-10 15:53:37 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-10-10 15:53:37 +0000 |
commit | afa8324c7eda51a056334b982e493ceffa551b90 (patch) | |
tree | 3b2ac579181106614a5afc3d89f2a1162e489fc7 | |
parent | e19ca337014e3db5d20359ca9dd23f3c22647d9c (diff) |
Stop pretending we use RFC 3046/Option 82/Relay Agent Information.
RFC 3042 says servers that do not understand the option will not
echo it.
Plus, our desultory attempt at echoing was almost certainly broken
for OFFERs (use after free of packet data) and not even attempted
for NACKs.
ok millert@
-rw-r--r-- | usr.sbin/dhcpd/dhcp.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/usr.sbin/dhcpd/dhcp.c b/usr.sbin/dhcpd/dhcp.c index 9db0106124d..58c8fb05cbe 100644 --- a/usr.sbin/dhcpd/dhcp.c +++ b/usr.sbin/dhcpd/dhcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcp.c,v 1.49 2016/10/06 16:12:43 krw Exp $ */ +/* $OpenBSD: dhcp.c,v 1.50 2016/10/10 15:53:36 krw Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998, 1999 @@ -1224,18 +1224,12 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer, state->options[i]->tree = NULL; } - /* Echo back the relay agent information, if present */ + /* + * RFC 3046: MUST NOT echo relay agent information if the server + * does not understand/use the data. We don't. + */ 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; - } + memset(&state->options[i], 0, sizeof(state->options[i])); /* Echo back the client-identifier as RFC 6842 mandates. */ i = DHO_DHCP_CLIENT_IDENTIFIER; |