replace qtuple addr with gz_addr_t
(cherry picked from commit 2ab1e6c03b9a15507ed53de797a8c121bfa8d1aa)
This commit is contained in:
parent
2dff53fecf
commit
92647e6852
69
0100-replace-qtuple-addr-with-gz_addr_t.patch
Normal file
69
0100-replace-qtuple-addr-with-gz_addr_t.patch
Normal file
@ -0,0 +1,69 @@
|
||||
diff -Nur lwip-gz-addr/src/include/lwip/priv/tcp_priv.h lwip-qtuple/src/include/lwip/priv/tcp_priv.h
|
||||
--- lwip-gz-addr/src/include/lwip/priv/tcp_priv.h 2023-12-04 14:08:00.672481010 +0800
|
||||
+++ lwip-qtuple/src/include/lwip/priv/tcp_priv.h 2023-12-11 11:19:34.552481010 +0800
|
||||
@@ -347,24 +347,12 @@
|
||||
LWIP_ASSERT("Invalid parameter", pcb != NULL);
|
||||
|
||||
struct gazelle_quintuple qtuple;
|
||||
- if (IP_IS_V4_VAL(pcb->local_ip)) {
|
||||
- qtuple.protocol = 0;
|
||||
- qtuple.src_ip = ip_2_ip4(&pcb->local_ip)->addr;
|
||||
- qtuple.src_port = lwip_htons(pcb->local_port);
|
||||
- qtuple.dst_ip = ip_2_ip4(&pcb->remote_ip)->addr;
|
||||
- qtuple.dst_port = lwip_htons(pcb->remote_port);
|
||||
- } else {
|
||||
-#if LWIP_IPV6
|
||||
- qtuple.protocol = 1;
|
||||
- qtuple.src_port = lwip_htons(pcb->local_port);
|
||||
- qtuple.dst_port = lwip_htons(pcb->remote_port);
|
||||
|
||||
- for (int i = 0; i < 4; i++) {
|
||||
- qtuple.src_ip6[i] = pcb->local_ip.u_addr.ip6.addr[i];
|
||||
- qtuple.dst_ip6[i] = pcb->remote_ip.u_addr.ip6.addr[i];
|
||||
- }
|
||||
-#endif
|
||||
- }
|
||||
+ qtuple.protocol = IP_IS_V4_VAL(pcb->local_ip) ? GZ_ADDR_TYPE_V4 : GZ_ADDR_TYPE_V6;
|
||||
+ qtuple.src_ip = *((gz_addr_t *)&pcb->local_ip);
|
||||
+ qtuple.src_port = lwip_htons(pcb->local_port);
|
||||
+ qtuple.dst_ip = *((gz_addr_t *)&pcb->remote_ip);
|
||||
+ qtuple.dst_port = lwip_htons(pcb->remote_port);
|
||||
|
||||
#if GAZELLE_TCP_REUSE_IPPORT
|
||||
if (reg_type == REG_RING_TCP_CONNECT_CLOSE) {
|
||||
diff -Nur lwip-gz-addr/src/include/reg_sock.h lwip-qtuple/src/include/reg_sock.h
|
||||
--- lwip-gz-addr/src/include/reg_sock.h 2023-12-06 19:41:19.792481010 +0800
|
||||
+++ lwip-qtuple/src/include/reg_sock.h 2023-12-11 16:17:59.860481010 +0800
|
||||
@@ -37,6 +37,16 @@
|
||||
|
||||
#include "lwipopts.h"
|
||||
|
||||
+/* compatible with lwip_ip_addr_type */
|
||||
+enum gz_ip_addr_type {
|
||||
+ /** IPv4 */
|
||||
+ GZ_ADDR_TYPE_V4 = 0U,
|
||||
+ /** IPv6 */
|
||||
+ GZ_ADDR_TYPE_V6 = 6U,
|
||||
+ /** IPv4+IPv6 ("dual-stack") */
|
||||
+ GZ_ADDR_TYPE_ANY = 46U
|
||||
+};
|
||||
+
|
||||
/* compatible with ip4_addr_t */
|
||||
struct gz_ip4 {
|
||||
uint32_t addr;
|
||||
@@ -78,13 +88,8 @@
|
||||
uint16_t src_port;
|
||||
uint16_t dst_port;
|
||||
|
||||
- /* TODO: replace with gz_addr_t */
|
||||
- uint32_t src_ip;
|
||||
- uint32_t dst_ip;
|
||||
-#if LWIP_IPV6
|
||||
- uint32_t src_ip6[4];
|
||||
- uint32_t dst_ip6[4];
|
||||
-#endif
|
||||
+ gz_addr_t src_ip;
|
||||
+ gz_addr_t dst_ip;
|
||||
};
|
||||
|
||||
struct reg_ring_msg {
|
||||
@ -4,7 +4,7 @@
|
||||
Summary: lwip is a small independent implementation of the TCP/IP protocol suite
|
||||
Name: lwip
|
||||
Version: 2.1.3
|
||||
Release: 104
|
||||
Release: 105
|
||||
License: BSD
|
||||
URL: http://savannah.nongnu.org/projects/lwip/
|
||||
Source0: http://download.savannah.nongnu.org/releases/lwip/%{name}-%{version}.zip
|
||||
@ -113,6 +113,7 @@ Patch9095: 0096-tcp_send_fin-add-the-fin-to-the-last-unsent-segment.patch
|
||||
Patch9096: 0097-Mod-the-issue-that-2w-connection-unable-to-establish.patch
|
||||
Patch9097: 0098-remove-duplicate-lwip-log.patch
|
||||
Patch9098: 0099-fix-rte_ring_create-time-consuming.patch
|
||||
Patch9099: 0100-replace-qtuple-addr-with-gz_addr_t.patch
|
||||
|
||||
Patch6005: backport-tcp_in-fix-ooseq-update-error.patch
|
||||
|
||||
@ -145,6 +146,9 @@ cd %{_builddir}/%{name}-%{version}/src
|
||||
%{_libdir}/liblwip.a
|
||||
|
||||
%changelog
|
||||
* Tue Jan 02 2024 zhengjiebing <zhengjiebing@cmss.chinamobile.com> - 2.1.3-103
|
||||
- replace qtuple addr with gz_addr_t
|
||||
|
||||
* Tue Jan 02 2024 jiangheng <jiangheng14@huawei.com> - 2.1.3-104
|
||||
- tcp_in: fix ooseq update error
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user