[PATCH] gateway: fix calculation of is_vpn6

Gabriel Sanches <[email protected]>
Newsgroups dev.linux.lists.connman
Message-ID <DB6PR10MB1845EBB07DB785B580B3F6ECE1E02@DB6PR10MB1845.EURPRD10.PROD.OUTLOOK.COM>
Fix is_vpn6 to use ipv6 variables not ipv4 variables. This stops
the WireGuard plugin from faulting on startup.

Fixes: commit 823d5a2a8cc4 ("connection: Refactor ‘__connman_connection_gateway_add’”)”

Signed-of-by: Gabriel Sanches <[email protected]>
Tested-by: Christian Hewitt <[email protected]>

---
 src/gateway.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gateway.c b/src/gateway.c
index 16c87f83..b2c211e2 100644
--- a/src/gateway.c
+++ b/src/gateway.c
@@ -3704,10 +3704,10 @@ int __connman_gateway_add(struct connman_service *service,
                                         is_gateway_config_vpn(
                                                 new_gateway->ipv4_config);
 
-               is_vpn6 = do_ipv4 &&
-                                       new_gateway->ipv4_config &&
+               is_vpn6 = do_ipv6 &&
+                                       new_gateway->ipv6_config &&
                                         is_gateway_config_vpn(
-                                               new_gateway->ipv4_config);
+                                               new_gateway->ipv6_config);
 
         } else {
                 if (do_ipv4 && new_gateway->ipv4_config)
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.