gazelle/0160-warp-add-configuration-check-with-host_addr-and-serv.patch
yinbin6 491b6eeeb1 sync fix vlan filter can be added when vlan_mode=-1
(cherry picked from commit b8d978e49349fa34b9e40f561d20ea47c3e359fd)
2024-04-08 11:39:47 +08:00

30 lines
1006 B
Diff

From 7604fb6e3917bd2b745f9dd5591de5a3b244c51e Mon Sep 17 00:00:00 2001
From: hantwofish <hankangkang5@huawei.com>
Date: Mon, 25 Mar 2024 16:07:09 +0800
Subject: [PATCH] warp: add configuration check with host_addr and server_ip
for ipv6
---
src/lstack/api/lstack_wrap.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/lstack/api/lstack_wrap.c b/src/lstack/api/lstack_wrap.c
index 49bbf91..2d5ef83 100644
--- a/src/lstack/api/lstack_wrap.c
+++ b/src/lstack/api/lstack_wrap.c
@@ -259,6 +259,11 @@ bool is_dst_ip_localhost(const struct sockaddr *addr)
if (get_global_cfg_params()->host_addr.addr == ((struct sockaddr_in *)addr)->sin_addr.s_addr) {
return true;
}
+ } else if (addr->sa_family == AF_INET6) {
+ if (memcmp(get_global_cfg_params()->host_addr6.addr, &((struct sockaddr_in6 *)addr)->sin6_addr,
+ sizeof(struct in6_addr)) == 0) {
+ return true;
+ }
}
if (getifaddrs(&ifap) == -1) {
--
2.33.0