71 lines
1.9 KiB
Diff
71 lines
1.9 KiB
Diff
From 74d87ad663f013e792a9ea5d004eae139cd2e0a0 Mon Sep 17 00:00:00 2001
|
|
From: compile_success <980965867@qq.com>
|
|
Date: Sat, 9 Mar 2024 06:45:25 +0000
|
|
Subject: [PATCH] support loop mode
|
|
|
|
---
|
|
src/core/netif.c | 8 ++++++++--
|
|
src/include/lwip/netif.h | 4 ++++
|
|
2 files changed, 12 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/core/netif.c b/src/core/netif.c
|
|
index 8302bd5..79f2317 100644
|
|
--- a/src/core/netif.c
|
|
+++ b/src/core/netif.c
|
|
@@ -1117,6 +1117,10 @@ netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_callb
|
|
*/
|
|
err_t
|
|
netif_loop_output(struct netif *netif, struct pbuf *p)
|
|
+#else
|
|
+err_t
|
|
+udp_netif_loop_output(struct netif *netif, struct pbuf *p)
|
|
+#endif
|
|
{
|
|
struct pbuf *r;
|
|
err_t err;
|
|
@@ -1218,7 +1224,6 @@ netif_loop_output(struct netif *netif, struct pbuf *p)
|
|
|
|
return ERR_OK;
|
|
}
|
|
-#endif
|
|
|
|
#if LWIP_HAVE_LOOPIF
|
|
#if LWIP_IPV4
|
|
@@ -1249,6 +1254,10 @@ netif_loop_output_ipv6(struct netif *netif, struct pbuf *p, const ip6_addr_t *ad
|
|
*/
|
|
void
|
|
netif_poll(struct netif *netif)
|
|
+#else
|
|
+void
|
|
+udp_netif_poll(struct netif *netif)
|
|
+#endif
|
|
{
|
|
/* If we have a loopif, SNMP counters are adjusted for it,
|
|
* if not they are adjusted for 'netif'. */
|
|
@@ -1312,7 +1321,6 @@ netif_poll(struct netif *netif)
|
|
}
|
|
SYS_ARCH_UNPROTECT(lev);
|
|
}
|
|
-#endif
|
|
|
|
#if !LWIP_NETIF_LOOPBACK_MULTITHREADING
|
|
/**
|
|
diff --git a/src/include/lwip/netif.h b/src/include/lwip/netif.h
|
|
index d10d4e8..d8f1f45 100644
|
|
--- a/src/include/lwip/netif.h
|
|
+++ b/src/include/lwip/netif.h
|
|
@@ -538,6 +538,10 @@ void netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_
|
|
#if ENABLE_LOOPBACK
|
|
err_t netif_loop_output(struct netif *netif, struct pbuf *p);
|
|
void netif_poll(struct netif *netif);
|
|
+#if GAZELLE_ENABLE
|
|
+err_t udp_netif_loop_output(struct netif *netif, struct pbuf *p);
|
|
+void udp_netif_poll(struct netif *netif);
|
|
+#endif
|
|
#if !LWIP_NETIF_LOOPBACK_MULTITHREADING
|
|
void netif_poll_all(void);
|
|
#endif /* !LWIP_NETIF_LOOPBACK_MULTITHREADING */
|
|
--
|
|
2.33.0
|
|
|