From: Jin-Seong Kim Date: Mon, 27 Mar 2017 07:32:14 +0000 (+0900) Subject: net/lwip: fix DHCP packet handling problem on lwIP X-Git-Tag: 1.1_Public_Release~614^2~196 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=781551ff139974b0cc8f1741149d674b7a0277ab;p=rtos%2Ftinyara.git net/lwip: fix DHCP packet handling problem on lwIP This commit is to fix dhcp packet handling problem on lwIP stack - to pass dhcp packets regardless of destination address, IP_ACCEPT_LINK_LAYER_ADDRESSING is needed - dhcp packets are addressed using link layer addressing (such as Ethernet MAC) so we must not filter on IP Change-Id: If67298aed453876adf7792bf67de75face0903e6 Signed-off-by: Jin-Seong Kim --- diff --git a/os/net/lwip/src/core/ipv4/ip.c b/os/net/lwip/src/core/ipv4/ip.c index 7288ea5..9a968ff 100644 --- a/os/net/lwip/src/core/ipv4/ip.c +++ b/os/net/lwip/src/core/ipv4/ip.c @@ -107,7 +107,18 @@ #endif /* LWIP_DHCP && defined(LWIP_IP_ACCEPT_UDP_PORT) */ #else /* LWIP_DHCP */ +/* + * To handle DHCP packets on netutils applications, + * enable IP_ACCEPT_LINK_LAYER_ADDRESSING configurations for either NETUTILS DHCPC or NETUTILS DHCPD + */ +#if defined (CONFIG_NETUTILS_DHCPC) || defined (CONFIG_NETUTILS_DHCPD) +#define IP_ACCEPT_LINK_LAYER_ADDRESSING 1 +#define DHCP_CLIENT_PORT 68 +#define IP_ACCEPT_LINK_LAYER_ADDRESSED_PORT(port) ((port) == PP_NTOHS(DHCP_CLIENT_PORT)) +#else #define IP_ACCEPT_LINK_LAYER_ADDRESSING 0 +#endif /* defined (CONFIG_NETUTILS_DHCPC) || defined (CONFIG_NETUTILS_DHCPS) */ + #endif /* LWIP_DHCP */ /**