From bb01a9e28a690e1a550ddcbcafe58d02597d18f4 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 18 Nov 2014 07:25:01 -0600 Subject: DHCPD: Remove dhcpd_addoption_n. It uses C features not supported by all compilers --- apps/netutils/dhcpd/dhcpd.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'apps/netutils') diff --git a/apps/netutils/dhcpd/dhcpd.c b/apps/netutils/dhcpd/dhcpd.c index 817c5d1c0..5ab9c831e 100644 --- a/apps/netutils/dhcpd/dhcpd.c +++ b/apps/netutils/dhcpd/dhcpd.c @@ -755,31 +755,6 @@ static int dhcpd_addoption32(uint8_t code, uint32_t value) return dhcpd_addoption(option); } -/**************************************************************************** - * Name: dhcpd_addoption_n - ****************************************************************************/ - -#if HAVE_DNSIP -static int dhcpd_addoption_n(uint8_t code, uint8_t *value, uint8_t len) -{ - /* REVISIT: This form may not be supported by older compilers. It may - * need to be replaced with malloc() and free() for portability. - */ - - uint8_t option[len+2]; - - /* Construct the option sequence */ - - option[DHCPD_OPTION_CODE] = code; - option[DHCPD_OPTION_LENGTH] = len; - memcpy(&option[DHCPD_OPTION_DATA], value, len); - - /* Add the option sequence to the response */ - - return dhcpd_addoption(option); -} -#endif - /**************************************************************************** * Name: dhcpd_soclet ****************************************************************************/ @@ -1024,7 +999,7 @@ static inline int dhcpd_sendoffer(in_addr_t ipaddr, uint32_t leasetime) dhcpd_addoption32(DHCP_OPTION_ROUTER, htonl(CONFIG_NETUTILS_DHCPD_ROUTERIP)); #endif #if HAVE_DNSIP - dhcpd_addoption_n(DHCP_OPTION_DNS_SERVER, (uint8_t*)&dnsaddr, DHCP_OPTION_DNS_SERVER_L); + dhcpd_addoption32(DHCP_OPTION_DNS_SERVER, (uint8_t*)&dnsaddr); #endif /* Send the offer response */ @@ -1086,7 +1061,7 @@ int dhcpd_sendack(in_addr_t ipaddr) dhcpd_addoption32(DHCP_OPTION_ROUTER, htonl(CONFIG_NETUTILS_DHCPD_ROUTERIP)); #endif #if HAVE_DNSIP - dhcpd_addoption_n(DHCP_OPTION_DNS_SERVER, (uint8_t*)&dnsaddr, DHCP_OPTION_DNS_SERVER_L); + dhcpd_addoption32(DHCP_OPTION_DNS_SERVER, (uint8_t*)&dnsaddr); #endif #ifdef CONFIG_NETUTILS_DHCPD_IGNOREBROADCAST -- cgit v1.2.3