From 7b14c2dec7c2a113d3bb4c50690b66fd566c302c Mon Sep 17 00:00:00 2001 From: Huge_Dream <534463586@qq.com> Date: Sat, 13 May 2023 10:08:04 +0000 Subject: [PATCH] fix compile problem Signed-off-by: Huge_Dream <534463586@qq.com> Change-Id: Id93f43ab6c330ca0ad87a8d168294ff1bb214b34 --- src/api/tcpip.c | 10 ++++------ src/core/ipv6/mld6.c | 2 -- src/core/ipv6/nd6.c | 3 --- src/core/lowpower.c | 5 ++--- src/core/tcp.c | 8 +++++--- 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/api/tcpip.c b/src/api/tcpip.c index e794cd1..237399d 100644 --- a/src/api/tcpip.c +++ b/src/api/tcpip.c @@ -49,6 +49,9 @@ #include "lwip/pbuf.h" #include "lwip/etharp.h" #include "netif/ethernet.h" +#if LWIP_LOWPOWER +#include "lwip/lowpower.h" +#endif #define TCPIP_MSG_VAR_REF(name) API_VAR_REF(name) #define TCPIP_MSG_VAR_DECLARE(name) API_VAR_DECLARE(struct tcpip_msg, name) @@ -242,11 +245,6 @@ tcpip_send_msg_na(enum lowpower_msg_type type) LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_send_msg_na alloc faild\n")); return; } - if (!sys_dual_mbox_valid(MBOXPTR)) { - LWIP_DEBUGF(TCPIP_DEBUG, ("tcpip_send_msg_na mbox invalid\n")); - memp_free(MEMP_TCPIP_MSG_LOWPOWER, msg); - return; - } /* just wake up thread if nonblock */ msg->type = TCPIP_MSG_NA; @@ -261,7 +259,7 @@ tcpip_send_msg_na(enum lowpower_msg_type type) } } - if (TCPIP_MBOX_TRYPOST(MBOXPTR, msg) != ERR_OK) { + if (sys_mbox_trypost(&tcpip_mbox, msg) != ERR_OK) { if (type == LOW_BLOCK) { LOWPOWER_SEM_FREE(msg->msg.lowpower.wait_up); } diff --git a/src/core/ipv6/mld6.c b/src/core/ipv6/mld6.c index 0918da7..fb001bf 100644 --- a/src/core/ipv6/mld6.c +++ b/src/core/ipv6/mld6.c @@ -536,8 +536,6 @@ u32_t mld6_tmr_tick(void) { struct netif *netif = netif_list; - struct mld6_listener *listener = NULL; - u32_t val = 0; u32_t tick = 0; while (netif != NULL) { diff --git a/src/core/ipv6/nd6.c b/src/core/ipv6/nd6.c index 9f33adb..2497d34 100644 --- a/src/core/ipv6/nd6.c +++ b/src/core/ipv6/nd6.c @@ -1220,9 +1220,6 @@ nd6_tmr_tick(void) /* Process our own addresses, updating address lifetimes and/or DAD state. */ NETIF_FOREACH(netif) { - if ((netif->flags & NETIF_FLAG_LOOPBACK) != 0) { - continue; - } for (i = 0; i < LWIP_IPV6_NUM_ADDRESSES; ++i) { u8_t addr_state; #if LWIP_IPV6_ADDRESS_LIFETIMES diff --git a/src/core/lowpower.c b/src/core/lowpower.c index 75f9c3b..c426d77 100644 --- a/src/core/lowpower.c +++ b/src/core/lowpower.c @@ -26,7 +26,6 @@ #include "lwip/sys.h" #include "lwip/pbuf.h" #include "netif/lowpan6.h" -#include "lwip/nat64.h" #include "lwip/api.h" #if LWIP_LOWPOWER @@ -341,7 +340,7 @@ tcpip_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg) again: if (g_timer_header == NULL) { UNLOCK_TCPIP_CORE(); - (void)sys_arch_mbox_fetch_ext(mbox, msg, 0, 0); + (void)sys_arch_mbox_fetch(mbox, msg, 0); LOCK_TCPIP_CORE(); return; } @@ -353,7 +352,7 @@ again: sys_timeout_set_wake_time(TIMEOUT_MAX); UNLOCK_TCPIP_CORE(); - ret = sys_arch_mbox_fetch_ext(mbox, msg, sleeptime, 0); + ret = sys_arch_mbox_fetch(mbox, msg, sleeptime); LOCK_TCPIP_CORE(); set_timer_state(LOW_TMR_TIMER_HANDLING, 0); now = sys_now(); diff --git a/src/core/tcp.c b/src/core/tcp.c index b66264b..e8372cb 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -111,6 +111,9 @@ #include "lwip/ip6.h" #include "lwip/ip6_addr.h" #include "lwip/nd6.h" +#if LWIP_LOWPOWER +#include "lwip/priv/api_msg.h" +#endif #include @@ -344,7 +347,7 @@ tcp_slow_tmr_tick(void) pcb = tcp_active_pcbs; while (pcb != NULL) { if (((pcb->state == SYN_SENT) && (pcb->nrtx >= TCP_SYNMAXRTX)) || - (((pcb->state == FIN_WAIT_1) || (pcb->state == CLOSING)) && (pcb->nrtx >= TCP_FW1MAXRTX)) || + ((pcb->state == FIN_WAIT_1) || (pcb->state == CLOSING)) || (pcb->nrtx >= TCP_MAXRTX)) { return 1; } @@ -386,8 +389,7 @@ tcp_fast_tmr_tick(void) /* send delayed ACKs or send pending FIN */ if ((pcb->flags & TF_ACK_DELAY) || (pcb->flags & TF_CLOSEPEND) || - (pcb->refused_data != NULL) || - (pcb->tcp_pcb_flag & TCP_PBUF_FLAG_TCP_FIN_RECV_SYSPOST_FAIL) + (pcb->refused_data != NULL) ) { LOWPOWER_DEBUG(("%s:%d tmr tick: 1\n", __func__, __LINE__)); return 1; -- GitLab