提交 54395808 编写于 作者: H He Chunhui

fix incompatible unit in LWIP_NAT_TMR_INTERVAL_SEC

LWIP_NAT_TMR_INTERVAL_SEC defined in ipv4_nat.h is in miliseconds,
but ip_nat_check_timeout() thinks it's in seconds.

With this bug, all nat entries will expire immediately when
ip_nat_check_timeout() is called.

Note sys_timeout() is in miliseconds.
上级 e0998e3c
......@@ -229,7 +229,7 @@ nat_timer(void *arg)
LWIP_DEBUGF(TIMERS_DEBUG, ("tcpip: nat_timer()\n"));
ip_nat_tmr();
sys_timeout(LWIP_NAT_TMR_INTERVAL_SEC, nat_timer, NULL);
sys_timeout(LWIP_NAT_TMR_INTERVAL_SEC * 1000, nat_timer, NULL);
}
/** Initialize this module */
......@@ -255,7 +255,7 @@ ip_nat_init(void)
rt_enter_critical();
/* add a lwip timer for NAT */
sys_timeout(LWIP_NAT_TMR_INTERVAL_SEC, nat_timer, NULL);
sys_timeout(LWIP_NAT_TMR_INTERVAL_SEC * 1000, nat_timer, NULL);
/* un-protect */
rt_exit_critical();
......
......@@ -67,7 +67,7 @@
#include "lwip/opt.h"
/** Timer interval at which to call ip_nat_tmr() */
#define LWIP_NAT_TMR_INTERVAL_SEC (30*1000)
#define LWIP_NAT_TMR_INTERVAL_SEC (30)
#ifdef __cplusplus
extern "C" {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册