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

