From 3d9f094022854ca06d02f34c688896abde9e1b20 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 4 Jul 2016 13:15:05 +0100 Subject: [dhcp] Allow for variable encapsulation of architecture-specific options DHCPv4 and DHCPv6 share some values in common for the architecture- specific options (such as the client system architecture type), but use different encapsulations: DHCPv4 has a single byte for the option length while DHCPv6 has a 16-bit field for the option length. Move the containing DHCP_OPTION() and related wrappers from the individual dhcp_arch.h files to dhcp.c, thus allowing for the architecture-specific values to be reused in dhcpv6.c. Signed-off-by: Michael Brown --- src/net/udp/dhcp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/net') diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c index 9342ad21e..0c6cea0f1 100644 --- a/src/net/udp/dhcp.c +++ b/src/net/udp/dhcp.c @@ -82,9 +82,9 @@ static uint8_t dhcp_request_options_data[] = { DHCP_MESSAGE_TYPE, DHCP_BYTE ( 0 ), DHCP_MAX_MESSAGE_SIZE, DHCP_WORD ( ETH_MAX_MTU - 20 /* IP header */ - 8 /* UDP header */ ), - DHCP_CLIENT_ARCHITECTURE, DHCP_ARCH_CLIENT_ARCHITECTURE, - DHCP_CLIENT_NDI, DHCP_ARCH_CLIENT_NDI, - DHCP_VENDOR_CLASS_ID, DHCP_ARCH_VENDOR_CLASS_ID, + DHCP_CLIENT_ARCHITECTURE, DHCP_WORD ( DHCP_ARCH_CLIENT_ARCHITECTURE ), + DHCP_CLIENT_NDI, DHCP_OPTION ( DHCP_ARCH_CLIENT_NDI ), + DHCP_VENDOR_CLASS_ID, DHCP_STRING ( DHCP_ARCH_VENDOR_CLASS_ID ), DHCP_USER_CLASS_ID, DHCP_STRING ( 'i', 'P', 'X', 'E' ), DHCP_PARAMETER_REQUEST_LIST, DHCP_OPTION ( DHCP_SUBNET_MASK, DHCP_ROUTERS, DHCP_DNS_SERVERS, -- cgit v1.2.3-55-g7522