代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/lwip 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 1e4e2fe5d7239da26edf89f554f929c10e0d5573 Mon Sep 17 00:00:00 2001
From: yangchen <yangchen145@huawei.com>
Date: Wed, 6 Mar 2024 18:25:19 +0800
Subject: [PATCH] support udp pkglen > mtu: modify netbuf_alloc size
---
src/api/sockets.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/api/sockets.c b/src/api/sockets.c
index 923518c..66f6e2c 100644
--- a/src/api/sockets.c
+++ b/src/api/sockets.c
@@ -1891,7 +1891,13 @@ lwip_sendto(int s, const void *data, size_t size, int flags,
/* make the buffer point to the data that should be sent */
#if LWIP_NETIF_TX_SINGLE_PBUF
/* Allocate a new netbuf and copy the data into it. */
+#if GAZELLE_ENABLE
+ /* In the gazelle scenario, only use buf.p->payload and buf.p->tot_len, and
+ buf.p->payload stores the sock pointer info. Don't need to alloc short_size */
+ if (netbuf_alloc(&buf, 0) == NULL) {
+#else
if (netbuf_alloc(&buf, short_size) == NULL) {
+#endif
err = ERR_MEM;
} else {
#if LWIP_CHECKSUM_ON_COPY
@@ -1905,6 +1911,7 @@ lwip_sendto(int s, const void *data, size_t size, int flags,
/* In the gazelle scenario, the payload is stored in send_ring,
and the payload stores the sock pointer information. */
buf.p->payload = (void *)sock;
+ buf.p->tot_len = short_size;
#else
MEMCPY(buf.p->payload, data, short_size);
#endif
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。