From patchwork Mon Jan 13 13:59:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gabriel Sanches X-Patchwork-Id: 13937415 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2075.outbound.protection.outlook.com [40.107.21.75]) (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 AEF3E1CAA87 for ; Mon, 13 Jan 2025 13:59:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736776802; cv=fail; b=l9C6h+cNadtqjhz5tUApMyYIXXuggp1jao56qBBRtm3Qmw6OyE+j0tPeeHlQKRtLDYYlv4BKqv1aZKPty2blNCr0zChScn7trDvikiBOLodeOZMNDc2/tT4E6oJjBIA+rwUlmY0XGlaOi4i8zOuV8/uZeTg/c63cnAUyDntOfbA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736776802; c=relaxed/simple; bh=WHcQan89LrLpQjr5J+m1LIQH1w3fQo+4MZ+zog9FIag=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=nlBLELpWvRZMcc0vOQqNxX+/QP4Nu8ejHIgZe1FhINmZdLavZlNmKgvqtXdj6bBRI8iIkf33hVhVXS1fsDZ4kfiUCECm81beSRyxZmZY/MNoF3SmowX2vNWpmeqpfJPhkktb//i+N7/qCPi36ORZeCTdzOEgjcPg5VNRMsJK/Yw= 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=KYAs94bO; arc=fail smtp.client-ip=40.107.21.75 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="KYAs94bO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZfZThVm0aQ4kqH7TeW83a7ZKKbIYOojmSIF+3AiDfpu/7xp305HoSP3x1YD4CQXElskuQhUkgWUu01KZ6ca7u47clJgeeJvARVwTKjEy+ZhS8l7Z27lvHzU49c4F3X125ImdRvMCxlt0jwXZpCo5AsBkKkh6VU1M0I/aowQz67m0mD2Q9ULfeVaXfY6gNNQDENkxvUd01yE0RRPR72icQnDbgQHZ8wRMBbdWLg/Zrmd74xygvS2jJM6fW6rhahUKeS+la2Mci9ha2qRTpXEmeiDGFOJ14Bt8JUnjmp6seLaats/WEhoA5+DpIVa5+U5wIQfpbnJ2vP6ZpeC3y3Q6lA== 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=bleJRbkdRRG/BrGz+oTcBzdBrR2thSuJvWRSawmjvo0=; b=iVB7eBy8zdkIg7QJs6RJbI2SwhyDl9tKbb5aFU9tfO65FPw/MdVw99/4br+LbWpXmM3CB2Zb6F6mLLp11lA+GdCYqLks++iFJo0pHoT0XGnKRj4Q/Om4vdCEIBLoevJmiGXbruHu7T2t4tjJEiHx5qkyz52Sr1wTjYYi/NlLO8v2394ABx3xCEmk2v6Yta+4vRXlnkGxAkWjR9FSnTRJ3HCkNv/yeZwp0TkDxz3u6mdtQ4kmsRpD94lhEgwJaf03HOUFW9K4gI/yWDV3gEl0P3adHr0bL7UaYnn1BEKexxbI4Ppzy4gr6OegUjIldUanSmZm1zGDdeGcUbIPPPm4TQ== 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=bleJRbkdRRG/BrGz+oTcBzdBrR2thSuJvWRSawmjvo0=; b=KYAs94bO+xC7TCbOvApgiyxAUX0UkaT8b6zIzYm1sog068eQU6wsVOiV1KmC3vFwzSWN6BqtYC2Nt0JwU7pVftqHQh+3n0AqRx2dd+FJK/Db5FLp1UwR+zZ0MQ+hsXUwowFIHIj0fCupZq5TWK8VbhkGMkiHqGUmGrRKBMVWPbA= Received: from DB6PR10MB1845.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:6:39::11) by PAXPR10MB5541.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:23f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.11; Mon, 13 Jan 2025 13:59:55 +0000 Received: from DB6PR10MB1845.EURPRD10.PROD.OUTLOOK.COM ([fe80::88c0:b27c:804f:1925]) by DB6PR10MB1845.EURPRD10.PROD.OUTLOOK.COM ([fe80::88c0:b27c:804f:1925%4]) with mapi id 15.20.8356.010; Mon, 13 Jan 2025 13:59:55 +0000 From: Gabriel Sanches To: "connman@lists.linux.dev" Subject: [PATCH] gateway: Fix typo when setting 'is_vpn6' Thread-Topic: [PATCH] gateway: Fix typo when setting 'is_vpn6' Thread-Index: AQHbZcGgb3qCR9F2HUWHK07I+FeKIQ== Date: Mon, 13 Jan 2025 13:59:55 +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_|PAXPR10MB5541:EE_ x-ms-office365-filtering-correlation-id: 1ff84a6a-1285-438e-d7e4-08dd33da8ef9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|366016|376014|10070799003|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?AneIfOpEqWRUKpRfksA9Y+IXA3?= =?iso-8859-1?q?imvZTRBKlzDECJneANuxATW5u733ZZLC1RCHcHW1MmIIg8M5zKqT5vJQrV4v?= =?iso-8859-1?q?+5gKSDLt74EGsCkF4quXgQB2QRWgTrK0OVctP1/98ZQX+AI3m2M/IA8bsQ6z?= =?iso-8859-1?q?P2Cf7kjRURq1125BD7UvvCLMGbGtbhQV0jwMEM56jI209P4CBQmmqeazA39k?= =?iso-8859-1?q?KcPRE7/AIRA2uVpgvdFNNioifmuXnBez0YQwsNPz0hiXhG8p6IjV/7ls3Zg3?= =?iso-8859-1?q?7XVe2Ikyrq6CvV4VK0MmBNG5jqVnOHBx/uxUgdg19tWuEPoa5f9zeT2DBxVX?= =?iso-8859-1?q?cm24r32FOhFStZ3RMWoKpE7/jsmL4vytVO1kdbQMTflPJl9WQTFh4szAgFG0?= =?iso-8859-1?q?FgUBKL87KGKRmYyCRaaM3xk6Lis1SXR90WNP+oqYCYo9uHm06U+2fE/6pZej?= =?iso-8859-1?q?jgXlfJ0875sDsipQT8eJ2iJIEBF/7x5nJrtHMsn0RnnvYaTLNCePxyOiBJOf?= =?iso-8859-1?q?TE6fkVkJOgnuPAtOkSyqSL1siCdE92SpV7NJINpcjB08SuPLJcaWB7pt3osE?= =?iso-8859-1?q?1jASstSlg3ja6DWZExJThm6YdBdOV3e9nK/cjK88A+ZaG8QXZn48w8aAJ1bZ?= =?iso-8859-1?q?jN3qsG8x4t5mjIV8v/8Rgb5VXycrkLsl8pQzJWVwK5GEfhhTyrhi/2Qywb1r?= =?iso-8859-1?q?zdcZtZQh1CWlfXZFfwTRcsESKJLSZf25O3KfJ8g7HClwvEK4GmfUwzZKCq8e?= =?iso-8859-1?q?8V58kPg8okjbUVnNxsYiaNSWUseBe88jqrQhV4SM9hqDHBcxWwethyjCwyDy?= =?iso-8859-1?q?+jip7qt8ZhV6REiPz8uyevJfV1uVNeNJBfbJU2r1jqHJapj68QynhfDPWf/f?= =?iso-8859-1?q?ZfNd/MWQrJeG3W7vyC94qa4eQURsu86yCvbiz+8hAMjPGYD9KI4gf3W8WlVY?= =?iso-8859-1?q?uWVO3I0F9k2TuFCvfS5hdeIGy0gB7U70jjtQHpwHbjn5RGacXp+TZe4BXUWR?= =?iso-8859-1?q?57B0mWZmOi0etnL6TAIffQPRADkAifiRxG6krjalhvQdinXP4aA9PgyeCY6Z?= =?iso-8859-1?q?7mWM/qhr4b5WtyqPCJI667cq3w0X8mWUeKTgxgLDXkbmLRHTloV9cVbKBNqP?= =?iso-8859-1?q?+FKHLaKUHh564NhFY4stqNlk0W1S1AnhChFJxdFUZxMlkHtG5/vLSgF2q5kl?= =?iso-8859-1?q?v3q+e3AB3Jj+1c621qpUFrbAeXVtu13d7Y5451DzjFFVvoQl/PrZSXv8XNjl?= =?iso-8859-1?q?tz87+sQVzNFd1mR05ey35TMcc3eRd5zUg6m+x8Q3QL166c/3MhrXaat4D7UW?= =?iso-8859-1?q?j4o00uYA+hem0XLO4bAC0fDSu9vFe0NCkz3vmuZt76kIjZpGs3jvGZX1TLvk?= =?iso-8859-1?q?2xzMHCMDadnMc0FDPPVBBMJR10zOiVmysFp/frpslLJVCHJnGcTE68q+8Wgb?= =?iso-8859-1?q?RmyXVb1tQrJdo7EueUIgv+OwR6v7MtXiuoRJK0l1SX2xcaVOaskOmcg3S1IR?= =?iso-8859-1?q?H9YpWC?= 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)(1800799024)(366016)(376014)(10070799003)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?vh+eAKzc/wt1IDqh/ahJH5o?= =?iso-8859-1?q?UbL9qxt+7CDvOVRsHSUBEwBDkotCkEoQ8Oud8sB+DFcfEoHraKIkVm3uB3ct?= =?iso-8859-1?q?5xyvquLdAsVU8otXpilcF2doZeJ3vtQcE1eFr+34xR5yw8OS6F5O4vAMlwzP?= =?iso-8859-1?q?RrivP8a06Ep2iVOeR32B2XcSAWyZ2ATuMkdma4chwlyMNJTY8ZCcAixzM221?= =?iso-8859-1?q?9I2d8kYJBVeROOd6PZ9lrTaIkIKsJkKgVoO3YzuZXeX7Jwph6amlcGdc41tk?= =?iso-8859-1?q?gc/eGykoRgS3isnzlqObFL3F4OssijQ2XUem2aFiq4iWYOLAbRv5K+XT6cH4?= =?iso-8859-1?q?WMthn2BNc+rNMp77x6DJobizhsxaYrxwzJLA1dE481iuV4kb0bjZ4iTm/+hk?= =?iso-8859-1?q?ZLuRTD7LQIVvcYY2OTqFQKHPI+2p+hOPIw/ex+Q4qJL7R0s2voNeXaXt721g?= =?iso-8859-1?q?3UTje8gicHKMFMLPFOk8CoEgEY398JmwflRRKXeE+/bqfWDXocTsvw6Me2Ue?= =?iso-8859-1?q?+Wazosh5v3umj6NnG7E9yiUPcHIIN60nEXrq98bhKcOu1X3PyUn6YpYdY59K?= =?iso-8859-1?q?eh1oi0+7jlkr9qHAMOyKhGRYhPucL/u3KDUcuCS9u4JYjH4kSYR3KZa8GTIC?= =?iso-8859-1?q?9gmNG3KSoJh/j+H2wdMKsgE3klhhxv7a/O1d6K04JsZNcec8MmJZO5nF+YPx?= =?iso-8859-1?q?PrSjkmhHxBT6veJkKL4a7pRfKyOKT/VYONhWhlGMIer5/dnJWn18/NCtll8A?= =?iso-8859-1?q?C6C78aOd8JI56ljDsieQNd5lgp4+Z+fl3sTtRzP9DJwxolr/WJuZDpb/l29Y?= =?iso-8859-1?q?8lq91otObqwMeLpk0FM0cdGD8oMJMJAsB2FP0BMiNJ5d5Ee0lODlPwFKVV1K?= =?iso-8859-1?q?hQLBXsZg368tB430WHonmdY6jxUslTzkUv629b27PHfCDWfPm2p5iUs2uGPV?= =?iso-8859-1?q?MDQUi9WlYUN/XrCLTdrDXNRsr0Tu7HhWnAg2I/gzx9pbuLxdZyOlE4s2m851?= =?iso-8859-1?q?xpVfiWyWH0FZi7ljuasTLNLNpSkkHOQvnC7Jas5fdZzvdQcbCr1arTnoprni?= =?iso-8859-1?q?620djAfXEy/5l368hfFUQa+w2TbBANSnmyquwdM4H9MgLTp1mCdB0uUxCOei?= =?iso-8859-1?q?/Z2bCIdfZIAUQ5aOn1TQLIH6d3tL9wMHK18333ydrI5yM9dnAtwX35Y6BVaj?= =?iso-8859-1?q?hBgU8UNjAA5WnvfgdTvaafIeIhtDVYTeYdX/AgQMDrkoJmv2PQZD3d45ZPas?= =?iso-8859-1?q?grcd3oPzuvKAdodwxRSxhEE9aNV+sT3LJoBr+cbi5n6NE5N2LKnZfVclfbIJ?= =?iso-8859-1?q?M25VHBnRECelnAn54EaTtV7dXv486TMrSlKL/RKCZWFGB70JWWL2sbIL2SSR?= =?iso-8859-1?q?UxO5sZWKDrM6NDWkS5/0pMA2dNXrpQHx0g8sqTuRgpa9L/pgoo/G5hpKPGWZ?= =?iso-8859-1?q?+oHVb1UpKw8420HHdVbPw/fHoy4+fQ5xyhudXSeoFW7PyI6xdlx2tHeC/Ckn?= =?iso-8859-1?q?FEWesP+QfCKe+L2edaJTo9eUZoAURlFJhQDyP16FuolikpI5ajzPb5jxobmd?= =?iso-8859-1?q?pbZ/2WezvbIeY9sKq+RASt37MEgpf1SbTLADutB1gVYV+6qT5DLSGn7i6Jc5?= =?iso-8859-1?q?BV+fus1p5m3hiIyBFONknvK8hSQH29E6J9gR7vF+bhb0cTV1XU834vJ0/7Db?= =?iso-8859-1?q?+ZKIiMYMvSQ9prpYOiw/r?= 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: 1ff84a6a-1285-438e-d7e4-08dd33da8ef9 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jan 2025 13:59:55.0836 (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: WS/yRCiQ2nHsW2siWkY5jRZczglGZV5YgWn5TGZnp5GuZ/TSOAJYIZYVx9Q8vQHA9bUrTmohfxLQuRb8deRwomxMNMZFabknNTv8NsSzrzY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR10MB5541 Hi,   I was testing connman's wireguard plugin and got a segmentation fault. Looking at the backtrace revealed that there are some typos in the `src/gateway.c` file where `is_vpn6` was incorrectly set using ipv4 variables instead of ipv6 regarding vpn. I simply changed them to ipv6 and got it working. not related to the patch: I had to manually add ip route so the other devices could be pinged The plugin adds routes for the WireGuard.DNS configuration setting # ip route 1.1.1.1 dev wg0 scope link 8.8.8.8 dev wg0 scope link 10.42.0.0/24 dev end1 proto kernel scope link src 10.42.0.83 10.42.0.1 dev end1 scope link via 10.42.0.1 dev end1 the missing route added manually: ip route add 10.33.0.0/16 dev wg0 scope link an equivalent wireguard file adds it properly (using wg-quick) Is the plugin lacking some implementation? 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)