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.
This commit is contained in:
parent
e0998e3c23
commit
5439580833
|
@ -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" {
|
||||
|
|
Loading…
Reference in New Issue