代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/lwip 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 97608b76168fc80d25f1871f4c8c17fd0457c9f9 Mon Sep 17 00:00:00 2001
From: hantwofish <hankangkang5@huawei.com>
Date: Tue, 25 Jun 2024 15:25:18 +0800
Subject: [PATCH] [virtio]: record local_port for port_map of virtio
---
src/core/udp.c | 8 ++++++++
src/include/reg_sock.h | 2 ++
2 files changed, 10 insertions(+)
diff --git a/src/core/udp.c b/src/core/udp.c
index 086e7e0..6b11bf6 100644
--- a/src/core/udp.c
+++ b/src/core/udp.c
@@ -1191,6 +1191,11 @@ udp_bind(struct udp_pcb *pcb, const ip_addr_t *ipaddr, u16_t port)
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("udp_bind: bound to "));
ip_addr_debug_print_val(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, pcb->local_ip);
LWIP_DEBUGF(UDP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, (", port %"U16_F")\n", pcb->local_port));
+#if GAZELLE_ENABLE
+ struct gazelle_quintuple qtuple = {0};
+ qtuple.src_port = lwip_htons(pcb->local_port);
+ vdev_reg_xmit(REG_RING_UDP_BIND, &qtuple);
+#endif
return ERR_OK;
}
@@ -1373,6 +1378,9 @@ udp_remove(struct udp_pcb *pcb)
}
}
#if GAZELLE_UDP_ENABLE
+ struct gazelle_quintuple qtuple = {0};
+ qtuple.src_port = lwip_htons(pcb->local_port);
+ vdev_reg_xmit(REG_RING_UDP_BIND_CLOSE, &qtuple);
udp_release_port(pcb->local_port);
#endif
memp_free(MEMP_UDP_PCB, pcb);
diff --git a/src/include/reg_sock.h b/src/include/reg_sock.h
index 466a2c2..04d1a8f 100644
--- a/src/include/reg_sock.h
+++ b/src/include/reg_sock.h
@@ -79,6 +79,8 @@ enum reg_ring_type {
REG_RING_TCP_LISTEN_CLOSE,
REG_RING_TCP_CONNECT,
REG_RING_TCP_CONNECT_CLOSE,
+ REG_RING_UDP_BIND,
+ REG_RING_UDP_BIND_CLOSE,
RING_REG_MAX,
};
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。