代码拉取完成,页面将自动刷新
From b8f23521a5454ba0b7b1d262dfad8aa59eb328ed Mon Sep 17 00:00:00 2001
From: wuchangye <wuchangye@huawei.com>
Date: Fri, 8 Dec 2023 09:43:43 +0800
Subject: [PATCH] Fixed an issue where no packet is sent or received when UDP
traffic is sent
---
src/lstack/core/lstack_lwip.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c
index 026c870..c4b1ebc 100644
--- a/src/lstack/core/lstack_lwip.c
+++ b/src/lstack/core/lstack_lwip.c
@@ -443,6 +443,7 @@ static inline ssize_t app_buff_write(struct lwip_sock *sock, void *buf, size_t l
for (int i = 0; i < write_num; i++) {
pbufs[i]->addr.u_addr.ip4.addr = saddr->sin_addr.s_addr;
pbufs[i]->port = lwip_ntohs((saddr)->sin_port);
+ IP_SET_TYPE(&pbufs[i]->addr, IPADDR_TYPE_V4);
}
} else if (addr->sa_family == AF_INET6) {
struct sockaddr_in6 *saddr = (struct sockaddr_in6 *)addr;
@@ -450,6 +451,7 @@ static inline ssize_t app_buff_write(struct lwip_sock *sock, void *buf, size_t l
memcpy_s(pbufs[i]->addr.u_addr.ip6.addr, sizeof(pbufs[i]->addr.u_addr.ip6.addr),
saddr->sin6_addr.s6_addr, sizeof(saddr->sin6_addr.s6_addr));
pbufs[i]->port = lwip_ntohs((saddr)->sin6_port);
+ IP_SET_TYPE(&pbufs[i]->addr, IPADDR_TYPE_V6);
}
} else {
return 0;
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。