From patchwork Thu Jan 23 11:38:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gabriel Sanches X-Patchwork-Id: 13948187 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2054.outbound.protection.outlook.com [40.107.249.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9FA620E6FD for ; Thu, 23 Jan 2025 11:38:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737632290; cv=fail; b=OiBxWYA4Ezeym2jUwB7qgbQXO0lZw5acvapQQ1PF8FYkAvdj4n3VVEufRPoX/AuGcIt4tQ39H+BMUVj5enACa7FRa+JGsOOxjUeVvHrvMX5Sro1xx1UbK/wNbuB76wDQ/v3w9HcxVVkmJO4ezesD5Mdt+6ncSIWkYfuwDiRPSzg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737632290; c=relaxed/simple; bh=CMjskL/j5361Qp4DHQfnNPAAVRfznB5iythIyTYQSoQ=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=d6/XADPey3oSNxf5QQ1KesidPKIOPSRTnxdaYlcI8zynyurUsme3qFCxvitduI5k6NCYFGdLZnfM0BezIlXfotEq7xtIW+O8vZ/OoxCUVH/9SXCFe3sYAUgZEPE+QJWgjJjnh2GNJjHkuju7W/YyOFXsWC7O+MkwPSc6bjf22G8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=prevas.dk; spf=pass smtp.mailfrom=prevas.dk; dkim=pass (1024-bit key) header.d=prevas.dk header.i=@prevas.dk header.b=QemWnEIa; arc=fail smtp.client-ip=40.107.249.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=prevas.dk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=prevas.dk header.i=@prevas.dk header.b="QemWnEIa" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CVZ2D0FyMK76bHYkI5/1a1QRQgIijQD+V8x1wBWrxZsXlPFR36DpPo6xozryUNoLg8x+3psanDGNr/tCeorLZ478Cm3gHXIoPvkc1fn+xxtim15dBFGVCDTw4H/nlRlqI6Koqs5rx2412Wtbdt+gdRM0YG+M4Ey6p/H7cPzDeTGnppO/xbUxi/vJCSeO99T8n+07rxR6iyicZ3WvRHptaeyK/w7lZQDWR08o2i/dFzh5PCuCyW2Q9PkatTG3vfuOol9t3fQZD3J9/uLm3+e6QNZefRgMiJH64oJsrNwFeIZhe7dzxxI5Ocywe6pBB1KVPWDD6gINf/b/fVITdPnB+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JM7ltuHF6PJIvQVrt18zIOzMtiw5z0X/EIFqZ1rn8Cc=; b=nC43DSp7zzn3w8CaAI339c83dUmpjbG/jnSfnjge8i4dj7rLts76XNoo3L6Tq5AmPnbRDbNkJTxJQvVmK85+K20g5jSa0mpziFdVAnohjywhb/0L20YOHlEyKkcyKkQsy2K3zY9Dchu++4y88pQWiSjsc09cs5oEqXmD5d8H8CoTdPFZR67E6MiqLhD4ktklf8M0abVDBCtUUES1GlrKlrU06dJ5UFHgTYz0IzPIzY1+FoNRt/2taQwl186VAQyG4WPihvOWWCrfVwG7Om1u9JwT32nRQE3WAnmveQ43NjH4zsy+nqOeAteNRGl3bwDyNnhBWPao2kJScb28mxUE4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JM7ltuHF6PJIvQVrt18zIOzMtiw5z0X/EIFqZ1rn8Cc=; b=QemWnEIayZjVoXImnafmMn5mv2CiqV4Uv4wtsGRHa3CRYca0sEP6QJDItMB4jr9I7vBAen2MkOyAoNJANSINLtzW6rkYOknar1mPi1KmwAhoreNMW7JCmiYLpFqsIy4sEOQG52pyJPFREI//OHuC0sj2McuROGyWuUVgyY4rMBc= Received: from DB6PR10MB1845.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:6:39::11) by GV1PR10MB8461.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:150:1cb::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.13; Thu, 23 Jan 2025 11:38:00 +0000 Received: from DB6PR10MB1845.EURPRD10.PROD.OUTLOOK.COM ([fe80::88c0:b27c:804f:1925]) by DB6PR10MB1845.EURPRD10.PROD.OUTLOOK.COM ([fe80::88c0:b27c:804f:1925%5]) with mapi id 15.20.8377.009; Thu, 23 Jan 2025 11:38:00 +0000 From: Gabriel Sanches To: "connman@lists.linux.dev" Subject: [PATCH] gateway: fix calculation of is_vpn6 Thread-Topic: [PATCH] gateway: fix calculation of is_vpn6 Thread-Index: AQHbbYrTCUk9amR0HUaegw+gngQgAg== Date: Thu, 23 Jan 2025 11:38:00 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=prevas.dk; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DB6PR10MB1845:EE_|GV1PR10MB8461:EE_ x-ms-office365-filtering-correlation-id: 1c3c6c22-3175-477c-b18b-08dd3ba263c8 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003|38070700018; x-microsoft-antispam-message-info: =?windows-1252?q?fgnnLQqEMy9Md1sAvyBsmSsm?= =?windows-1252?q?lMyjGWLh2LXX860cadj+P09od/1QqCacKOerYeWVt1UJkv3RmRyH5y3pwt?= =?windows-1252?q?DfGpkdoCzpbqc0rOvSkl+Vn2ENKymdyK2buMPVB1fsZr/UeVhubtGGuYlw?= =?windows-1252?q?xsXC0i4vBz5C57jiLGKCOvGsaOtNAZ/s3KXND9xRTT+Atq4c1lG89cg8T3?= =?windows-1252?q?rwYA0dmX5Dp+lI+2GNbDohpXpo5sQjYp4+zGsTp7ECTESkQRGrRGk+lm/H?= =?windows-1252?q?cxRBQ7fIUGOYRRGV5bk6TPrgMlNNiTGTUcFpJyy4kRJDnVPYKPCt3meIdF?= =?windows-1252?q?dHOE2fgS5C/+673IsDmg3mdTdJkmV8iHl4Uu4kqdmkYR0+hGGbRxFGRw13?= =?windows-1252?q?mxDTC9FjXqd8prqYt0YOiLj42zI08Z6A1MMYXufUzchtCktDEzY6NN1qzp?= =?windows-1252?q?8Q1xzKQpnIZzsCWDa29mkPQS00rDuaBdzaKARVdGO3O6oNpF5rgLBEhIWt?= =?windows-1252?q?x0nvcnJUm/RsGttMhFtQjR9376nGE38iuc16t6no91WdFtQh/qtJ+00ylI?= =?windows-1252?q?jxto8lO2pC5dUzFacMI+WXuA4d6/JFteJgX0eT389nFei0nNuXEtxXcUEW?= =?windows-1252?q?fsaGFrh6hey8O6LQ0iWidAH1DXIwPyHOXDHegTEAhhZi1NhJKhPzoX6APP?= =?windows-1252?q?iHP/7T0cwEMjpnjP5fIrl90LbHyc6KWba08nOV/gYVrCb9rcIfcIe2gBty?= =?windows-1252?q?bRb4PZvDUr6tLp8FA92uydm3Xs8iuplVx/iDjgxcnNdChdZ76DmrL3NPIM?= =?windows-1252?q?oe9MNjt5DEJq9/e1r+lWQ6wlJAjIr+dgXlMSD8h183JGpDMOIXSbNKndKv?= =?windows-1252?q?3qBQLzXIBTPDlw9oJZXwq/HC0kDu/YzXIx0f0qkdp9eG1rtP4NtZ5+S03V?= =?windows-1252?q?0vYHuKZSAW7eXX7TOpPhiPA5lY9qneL9wHuP38OK/Xqd4fUHzIyJr3vMwq?= =?windows-1252?q?r43eT9ZoTpCucCKIxAoyw91ULYzbH1MozGY3QEmoJgbhTB9ZQ98YzsWwv9?= =?windows-1252?q?4U7ViJe5R/AWQIZ0GbC5/uwqG1GNh1pLMZ57gRZY+VL0mzgkhilg9p1GYs?= =?windows-1252?q?WbBNS7hiAtGdTp4gqhKvW6X9M9JcxQaNzBoCnfdAuCN2+awIm5SPK83TJn?= =?windows-1252?q?uKfEynmzsXSl/M20KDftdurHGXSsHANRbEOW7Le+eynlx2ob2gBUQu5Q8/?= =?windows-1252?q?pxqhBd1Q5cFq+5AceT/n+ILfNZJwXPKHvoZckn8u8ByEYJ5OtZ7+QuxAs3?= =?windows-1252?q?g6mmL+yv8ipJ6kgPf2fq8yJGskUkws3iWhnA2e+x46m/zDfitQhYr1/v9h?= =?windows-1252?q?7QdtDpzaRLXuzjsIIyZTofMc179yTE1ZVfHVgonfm0axv/Tk7yRbf/mNXu?= =?windows-1252?q?oCxVMPYV9oU301uUEIsK5S4dMYUBYzG8yv79Q59Zx+GPCQ4VgVaPI37mn2?= =?windows-1252?q?8D6X+JHC0USDQCAIHEt+6A7vdDHkk50Vv6WMHZ7r9bgktlbyExBghjNF?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB6PR10MB1845.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(10070799003)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?windows-1252?q?gX4juSaRJypCwy1dktnBW?= =?windows-1252?q?4xZfQBT0d9flGDkoOgz0MrO8wCJkYkBbaDrBNAytZO+vourspa2L8VjM5/?= =?windows-1252?q?98oBf1oWQxyg4F97vJ8l84cf8hEgvHM4QL/KRzBBRtJSMNnLaHEkh8Z9Yi?= =?windows-1252?q?UuA1thLLdZQpVoCfMnzG0sTj3A2qw1bGiEFmxvPoGnn8BatZ7PelCDy6w9?= =?windows-1252?q?zSmMKgGMfeqI6LRxukraQD7GzmOmW48WAKTFLO5+N2tz65CulsA3Pqh4+X?= =?windows-1252?q?R0kyPEnVz70rQEEo017SprMCfJabNn9JUP2agyH7/N7jNEOW3b9yVfWK7o?= =?windows-1252?q?JazQVqIA+VAughW35hnKf10MpJ/u+lQJmGgzDDSOGIV5qiLD1HnfxAjHYY?= =?windows-1252?q?jVIERDN1H0R8wBR/k6AP8X/Sra9T2E3L7TqXHHtJC4gOlIq56F2R+3AG5B?= =?windows-1252?q?xYR6GQEBPF/WikwWxcT/XO06z8MHhzOYH5jZ0lWO9Q5ba2VpHazr9DhMg4?= =?windows-1252?q?qtgUhD7tBISsa3s2nVjvmxhc+DQpPuWZIGL/goV5xnL26Pj0kXpPhVNyYR?= =?windows-1252?q?WYnOSO7Vot0kHOA9+V5/VVfLehBcSnQarDPMuC4FmqfzNevC4SL/RmjvsI?= =?windows-1252?q?SHxd9/x2MzGA7DxsTfuKKx3iiMoM0rUv3ifurMNIlsjFggZGBVAUMIEJjz?= =?windows-1252?q?+TL34/gB7zBmldfau2wLR1JLHauqtrgk3/JdHGSGdh2lAAqPKuqRsQ9NS0?= =?windows-1252?q?7HIeNcE6tbOOwiUN/9l1OXOsXnPYrCnYKF7yF5IqacEIplwtzzVpaGGaMs?= =?windows-1252?q?QKxALigJVtOq6YeHAEOKSGvMzceJVZhQtaqBBnbSCgYIqOCu+yv6oB6d79?= =?windows-1252?q?4uEmMgbTxlCITW5ZOc/NLW+taulVP9gjkgk/uZ/cxf7S9B2jYrbtGCr9ur?= =?windows-1252?q?CnIVKGZkPUnXON1MIaP/OIq3YEk4LORO1oFlSBFb0mCjrlz+ebdCRsveAf?= =?windows-1252?q?QoCfz2jSdLj57NNWO1gmJ0C08EmxEA+DBVDOMJzX1r3ajOBHUiQ5fYFr5z?= =?windows-1252?q?L2iIsiS6LQqD+iaZeo8SRrtt9I58l8LIbz2JwTFnfUPaqxv6nbZZMR1jK0?= =?windows-1252?q?L3K4EKcAXsHReiKjHjRr5GKqJdFgVAYHg3L5mr291ZRlxGy1eqP2HoK+L8?= =?windows-1252?q?R9VF3htvGVlgZ6xTL6KDiUa7VrSJozwRMHWA3DWCQWIHAxK1jWYjV3avmL?= =?windows-1252?q?c9OIqQMCOya1dFwNYFvSnkCqeTpsKecPu/xqB/X3toMonaj3mRxkaaV5LY?= =?windows-1252?q?Vk18hEjB1Y223T3B6I2X5jbtYb2E+2ys8cHZXLI/Qhv2ef4whrvPqLzHqU?= =?windows-1252?q?Res23lm+TMGyFAaxglBJJlkuWU7b0TwMfpvycMhLYiZH/ZTra7N9/3tjZN?= =?windows-1252?q?+6ctXxfhPQiGE5VltpatHh1pkZgXrs6bnQFpK1T/zdrvh4Y9ffogIyjsSj?= =?windows-1252?q?ZQtty5K/mDH6S4xVVz3USqwBXE0TJwyJO2khNg61wyw22TIlznpOsSU1dS?= =?windows-1252?q?NCVMXKjD1pZGDsBND44PvIP0eZQ8YX9YRG1reNa+sy5r9SmnHX8Ye2O1E5?= =?windows-1252?q?eJWE6GatAmIQemL6WJXxOHB9BT634WcFKoN3RLRw4AOxl33HSuhb4rfAiK?= =?windows-1252?q?Zw/414Vk1PuzYRStW4UUd7gH5pLd8nwSTxC3PKHcp1VXvY9rrJe6eGXdPz?= =?windows-1252?q?bptNY9LCfgwjaj1fgLz?= Precedence: bulk X-Mailing-List: connman@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: prevas.dk X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB6PR10MB1845.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 1c3c6c22-3175-477c-b18b-08dd3ba263c8 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jan 2025 11:38:00.1104 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 2ySId+xTn6dr0vMp2zOarXQP/X3oYW0xkDsKAoeJ58c0GaxzCZ8wty3voDiGDEB5kfw1GWLRE7dP+P6T5HkkxLOEHxLb7rmDcmkRsH6EuXQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR10MB8461 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 Tested-by: Christian Hewitt --- 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)