代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 8cd5427107511b6daed9905590c2812346a3a57d Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng14@huawei.com>
Date: Thu, 27 Jun 2024 19:52:02 +0800
Subject: [PATCH] fix coredump when get empty from udp sendring
---
src/lstack/core/lstack_lwip.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/lstack/core/lstack_lwip.c b/src/lstack/core/lstack_lwip.c
index db948b0..3728100 100644
--- a/src/lstack/core/lstack_lwip.c
+++ b/src/lstack/core/lstack_lwip.c
@@ -255,17 +255,16 @@ struct pbuf *do_lwip_udp_get_from_sendring(struct lwip_sock *sock, uint16_t rema
struct pbuf *pbufs[count];
int actual_count = gazelle_ring_sc_dequeue(sock->send_ring, (void **)&pbufs, count);
- if (unlikely(actual_count != count)) {
+ /* it's impossible to enter this branch theoretically */
+ if (unlikely((actual_count != count) ||
+ ((actual_count != 0) && pbufs[0]->tot_len != remain_size))) {
LSTACK_LOG(ERR, LSTACK, "udp get pbuf from sendring error, expected: %d, actual: %d\n",
count, actual_count);
+ LSTACK_LOG(ERR, LSTACK, "udp get pbuf size error, expected: %d, actual: %d\n",
+ remain_size, actual_count == 0 ? 0 : pbufs[0]->tot_len);
}
- if (unlikely(pbufs[0]->tot_len != remain_size)) {
- LSTACK_LOG(ERR, LSTACK, "udp get pbuf size error, expected: %d, actual: %d\n",
- remain_size, pbufs[0]->tot_len);
- }
-
- for (int i = 0; get_protocol_stack_group()->latency_start && i < count; i++) {
+ for (int i = 0; get_protocol_stack_group()->latency_start && i < actual_count; i++) {
calculate_lstack_latency(&sock->stack->latency, pbufs[i], GAZELLE_LATENCY_WRITE_LWIP, 0);
}
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。