summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorzhouji92 <[email protected]>2021-01-18 15:02:28 +0800
committerzhouji92 <[email protected]>2021-01-20 10:07:55 +0800
commit74691ea7831fe155a54d5784939ad523cca1c3c7 (patch)
treedb677b2ba5768ab5bb733ac7988498d5f3cfd3cc /components
parenta18714b04a3f9643b0c40a1cba1b24712537c263 (diff)
[fix] 修复使用lwip 2.1.2作为协议栈,并使能dhcp server选项时,编译报错问题。
Diffstat (limited to 'components')
-rw-r--r--components/net/lwip_dhcpd/SConscript2
-rw-r--r--components/net/lwip_dhcpd/dhcp_server.c16
2 files changed, 17 insertions, 1 deletions
diff --git a/components/net/lwip_dhcpd/SConscript b/components/net/lwip_dhcpd/SConscript
index 16c673036a..837eb043e4 100644
--- a/components/net/lwip_dhcpd/SConscript
+++ b/components/net/lwip_dhcpd/SConscript
@@ -2,7 +2,7 @@ from building import *
cwd = GetCurrentDir()
-if GetDepend('RT_USING_LWIP202') or GetDepend('RT_USING_LWIP210') :
+if GetDepend('RT_USING_LWIP202') or GetDepend('RT_USING_LWIP212') :
src = ['dhcp_server_raw.c']
else:
src = ['dhcp_server.c']
diff --git a/components/net/lwip_dhcpd/dhcp_server.c b/components/net/lwip_dhcpd/dhcp_server.c
index 93b4ad16f0..b37d038b86 100644
--- a/components/net/lwip_dhcpd/dhcp_server.c
+++ b/components/net/lwip_dhcpd/dhcp_server.c
@@ -80,6 +80,22 @@
#define LWIP_DHCP 1
#include <lwip/dhcp.h>
+#ifndef DHCP_CLIENT_PORT
+#define DHCP_CLIENT_PORT 68
+#endif
+
+#ifndef DHCP_SERVER_PORT
+#define DHCP_SERVER_PORT 67
+#endif
+
+#ifndef ETHADDR32_COPY
+#define ETHADDR32_COPY(dst, src) SMEMCPY(dst, src, ETH_HWADDR_LEN)
+#endif
+
+#ifndef ETHADDR16_COPY
+#define ETHADDR16_COPY(dst, src) SMEMCPY(dst, src, ETH_HWADDR_LEN)
+#endif
+
/* buffer size for receive DHCP packet */
#define BUFSZ 1024