提交 76a79f20 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #817 from armink/fix_lwip_tftp

[lwIP] Fix LwIP 2.0.2 tftp
......@@ -29,7 +29,6 @@ src/core/udp.c
src/netif/ethernet.c
src/netif/ethernetif.c
src/netif/lowpan6.c
src/netif/slipif.c
""")
ipv4_src = Split("""
......@@ -76,11 +75,6 @@ if GetDepend(['RT_LWIP_PPP']):
src += ppp_src
path += [GetCurrentDir() + '/src/netif/ppp']
# For testing apps
if GetDepend(['RT_USING_NETUTILS']):
src += Glob('./apps/*.c')
stc += Glob('./src/apps/tftp/*.c')
group = DefineGroup('lwIP', src, depend = ['RT_USING_LWIP', 'RT_USING_LWIP202'], CPPPATH = path)
Return('group')
......@@ -226,7 +226,7 @@ recv(void *arg, struct udp_pcb *upcb, struct pbuf *p, const ip_addr_t *addr, u16
case PP_HTONS(TFTP_WRQ):
{
const char tftp_null = 0;
char filename[TFTP_MAX_FILENAME_LEN] = { 0 };
char filename[TFTP_MAX_FILENAME_LEN + 1] = { 0 };
char mode[TFTP_MAX_MODE_LEN] = { 0 };
u16_t filename_end_offset;
u16_t mode_end_offset;
......
......@@ -446,4 +446,22 @@
#define SO_REUSE 0
#endif
/*
------------------------------------
------- Applications options -------
------------------------------------
*/
/**
* Max. length of TFTP filename
*/
#ifdef RT_LWIP_TFTP_MAX_FILENAME_LEN
#define TFTP_MAX_FILENAME_LEN RT_LWIP_TFTP_MAX_FILENAME_LEN
#elif defined(RT_DFS_ELM_MAX_LFN)
#define TFTP_MAX_FILENAME_LEN RT_DFS_ELM_MAX_LFN
#else
#define TFTP_MAX_FILENAME_LEN 64
#endif
#endif /* __LWIPOPTS_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册