From patchwork Tue Dec 27 14:02:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2948 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp2650241dyk; Tue, 27 Dec 2022 06:03:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXsiVHDUJ7gYs83ItSN/Sgra0PxZhE+JGbWhxDLwCkx+D3fIk53YwQz46+HWn9CVyAZZoQFb X-Received: by 2002:a05:6808:1807:b0:35e:da33:21f with SMTP id bh7-20020a056808180700b0035eda33021fmr12894729oib.15.1672149813455; Tue, 27 Dec 2022 06:03:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672149813; cv=none; d=google.com; s=arc-20160816; b=ckMoFRrU4nHupqlArJqb5PNvIOWWoMh/xuuYuTyGNzI+ZDXwcR6bd0H5fnJ4i4lpek 22/qvhU6X9hrOvB4wO1xsVWS4uO9de5Z4MilpkWiMoGiNhFB6qK5rwmJaYK9yCF9LDg+ djgsaf02lMv8fhBGYkTtuUm1NB02vVWasxGvOl3VzE8ggoe8NNF0m0DNUmLz9Rc/HJIx mPEF11lvqVhtHEGzz8W20LPQlmP1ebQCvgGjvCM0/LwSWC9TA/ZvBRsLUo9CjwAb1mjS ZagC3PxPCiaRW97sZf6658GmCJL8VkfFkRn4LeahkGqgbEXlVrrf/61hxhgHUcvZI1dK 2AIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:dkim-signature; bh=1LyjkD2bdu6adeJZhAhxcNfOMuru641ZQMXhvLHYm8k=; b=oANjKAJojLHMY0At3BFtmOgYAqHd8mMVMYwDVjmf6PHlizFoNyMg9F3aWF/x5nxTPY DZen5d5sFp7cl9Yu4iuwQfw781GF7BFsXcV+NcYv1YNbHNQ7t893k4C1IU4zL2nSzTe8 MiFVF2edVovGZgZ1mEZqg+fK/ymrjuIrRhDqWdK66aPpH5z/4tS2Jjw8G/if6VszlxC4 pwYGyCdQNaqG/RiYqCW16LfKk1QU1xUMYoobDWS1x8XXkWLzjx2gAQXBNFdp2lfvPa0d MmlA1t5ORze6JvPLM2w6SKLj1JIuaWd8LKS8nAr4DfPvGxcCPeF/KLPXJuxpUfaZPAwZ d3hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Z0A3xl6P; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=UXGc17n9; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id j15-20020a056808034f00b0035bbf2e5931si10007876oie.287.2022.12.27.06.03.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2022 06:03:33 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Z0A3xl6P; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=UXGc17n9; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pAAXm-0003NL-Hk; Tue, 27 Dec 2022 14:03:02 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pAAXh-00032T-ID for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 14:02:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=tIAHvbNusgg8d25zvOuHrFUx5HPPP9q+C8xX//l5Z1Q=; b=Z0A3xl6P5H46pdFKpQJpvGG82w YAfPjFHiaebaSHc/Mew/JvfU0JKzvK86Wupf80DGyuHsiOkJZMyVrXibFPxdakI660wqCKfWdjT7q SVQb+Wcm2sXLze7znRbrhdPNhDXQOqtRAaBT2KfbUrL61OtHTsvFTCylMPLQFUCJ6VH4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=tIAHvbNusgg8d25zvOuHrFUx5HPPP9q+C8xX//l5Z1Q=; b=U XGc17n9nJ8md4SWtmHlr5sy3j4dZqgS543fPiguEI3zAh1WeTqxAEVQ7Mx9Qtc8RuRH50C2NN01IU GU5zzXFyxoxs0Pxhmd2Gf3vnHUNviEwJ+jTORXfR011pc17Tor1hOyAW2/muEebcVNAuuvp0gBFKF c9xdSZMQlfG9DiR0=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pAAXg-00E5SC-Jf for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 14:02:57 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from ) id 1pAAXZ-0004uG-6B for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 15:02:49 +0100 Received: (nullmailer pid 3524989 invoked by uid 10006); Tue, 27 Dec 2022 14:02:49 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Tue, 27 Dec 2022 15:02:44 +0100 Message-Id: <20221227140249.3524943-1-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Score: 0.3 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Signed-off-by: Arne Schwabe --- src/openvpn/manage.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c index be9a38952..7e326702f 100644 --- a/src/openvpn/manage.c +++ b/src/openvpn/manage.c @@ -865, 8 +865, 6 @@ man_remote_entry_count(struct manag [...] Content analysis details: (0.3 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1pAAXg-00E5SC-Jf Subject: [Openvpn-devel] [PATCH 1/2] Replace custom min macro and use more C99 style in man_remote_entry_get X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1753376162883493548?= X-GMAIL-MSGID: =?utf-8?q?1753376162883493548?= Signed-off-by: Arne Schwabe Acked-by: Gert Doering --- src/openvpn/manage.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c index be9a38952..7e326702f 100644 --- a/src/openvpn/manage.c +++ b/src/openvpn/manage.c @@ -865,8 +865,6 @@ man_remote_entry_count(struct management *man) } } -#define min(a, b) ((a) < (b) ? (a) : (b)) - static void man_remote_entry_get(struct management *man, const char *p1, const char *p2) { @@ -875,12 +873,10 @@ man_remote_entry_get(struct management *man, const char *p1, const char *p2) if (man->persist.callback.remote_entry_get && man->persist.callback.remote_entry_count) { - bool res; - unsigned int from, to; unsigned int count = (*man->persist.callback.remote_entry_count)(man->persist.callback.arg); - from = (unsigned int) atoi(p1); - to = p2 ? (unsigned int) atoi(p2) : from + 1; + unsigned int from = (unsigned int) atoi(p1); + unsigned int to = p2 ? (unsigned int) atoi(p2) : from + 1; if (!strcmp(p1, "all")) { @@ -888,10 +884,10 @@ man_remote_entry_get(struct management *man, const char *p1, const char *p2) to = count; } - for (unsigned int i = from; i < min(to, count); i++) + for (unsigned int i = from; i < min_uint(to, count); i++) { char *remote = NULL; - res = (*man->persist.callback.remote_entry_get)(man->persist.callback.arg, i, &remote); + bool res = (*man->persist.callback.remote_entry_get)(man->persist.callback.arg, i, &remote); if (res && remote) { msg(M_CLIENT, "%u,%s", i, remote); From patchwork Tue Dec 27 14:02:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2950 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp2650248dyk; Tue, 27 Dec 2022 06:03:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXscgPQMS58pn1GkE5QW0Inq4M2nmXx9YmfvnLiCH0pmnKgP5JLrKgrCBLPdwXAhKOSf8QWH X-Received: by 2002:a05:6808:1907:b0:35e:1ca6:ff6d with SMTP id bf7-20020a056808190700b0035e1ca6ff6dmr13338327oib.5.1672149813805; Tue, 27 Dec 2022 06:03:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672149813; cv=none; d=google.com; s=arc-20160816; b=ckAu5e1VB3Iw9dCdLUVSS6ZgiSPjT4KcjK4C4T7GtaE/sEJdos7fCW07gPHcJQDFPC 0s+64n1WwHn7hYpDCKVIUh3OMD7YY9cb9Dt1c+rBhVEuP39GdK3XsLXDIiLc3jucV4B1 /pJ7Kk69FUjz+wfCLs8Od5W0PFgZhWw2gjFn2sZmCfyiDIcgFx9S3ZENw9Om9cJrMkTQ YgNscpXTzpugycwDzaoO4OPrpHA88Zxruuu9dYLElNqt0vnxwQO0AwXZCvCOPzhcKNKf 0RFXw8o+zu1L4neN7EMz7HKKI5ev/u0FslArC9sZr7M9kWGDFPPoA+0JPnHC+Kz2XYZb 42fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=dG8jnEUPlJMZNpdPo3jJ7+guru0S0IfNIfsYBGVLczM=; b=xN2DB8IXOVpHNN8nOyiOHBsB5P+ZEK5AloYdcFE5kfNUVUG0Zb5W9JMAMITKoxEzgc BRA8ckdSPszMCfDcQU26EcNpS9FDrD+9K/H6+8OO+KyztHrTIUAHEIbh40t1x11srb7y zk7yLtLbSCgP4HJNhaN/qoFFdzHbhulf5Q615s9GJfxhkHA221VIsMIgp//QvHwqKoQa hrLLbQir54XWRwX8vSEPEvd6+Hl5bOqy8N6WFfIPamLz62MkZ9xideDtmFYu/bZuZYdD 6VZc9bSYuxb324IwM/BeFLmpynpVGt9N7raDzGxaseYs3IT8ctNNF53Jq/65qYadQB5s 21rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=SdqGNcH0; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=a6LeSjn8; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id i1-20020aca0c41000000b0035a31d82948si9575842oiy.83.2022.12.27.06.03.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2022 06:03:33 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=SdqGNcH0; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=a6LeSjn8; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pAAXk-0007lE-4w; Tue, 27 Dec 2022 14:03:00 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pAAXi-0007kw-2l for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 14:02:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=lqQgkiBdZd6xFqK4UJvEb/XpGvl9w9hUilpgb5nQHzo=; b=SdqGNcH0vllWnGC92jOvjmysIT KF/Ul3ave/YYlaTPRI008Atx8OApcU6a1nFdcPBiKo/oP3IjZhjI8uOfisWODapKw5/cWPdGKDtg5 MHrC5ChUNLYbc8GA4DWADkQi9bR0hUd+wo/enChOfJzjbICDHYOHxuoI7BANMYnYvIfU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=lqQgkiBdZd6xFqK4UJvEb/XpGvl9w9hUilpgb5nQHzo=; b=a6LeSjn8FttJkF2h4ZQu8TBqL/ 0WyVCbhygsbtnrD5fw5zxDEFo+mdu8mthsV9x2Eopg8pi/QvX8YyZrNzvBNAOsxu8LgClcgT/sq0K Vk5OJpuOkEJHt8ovwVZa9VvcLNq+8v84v9uzKqHAQ+4kmia7FSeDT75gDBYZMmDrMffU=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pAAXg-0007sY-LE for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 14:02:58 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from ) id 1pAAXZ-0004uM-8B for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 15:02:49 +0100 Received: (nullmailer pid 3524997 invoked by uid 10006); Tue, 27 Dec 2022 14:02:49 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Tue, 27 Dec 2022 15:02:47 +0100 Message-Id: <20221227140249.3524943-4-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221227140249.3524943-1-arne@rfc2549.org> References: <20221227140249.3524943-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Score: 0.3 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Instead of getting the server in a very weird state, we bail out here. This is only a bandaid solution but better than the alternatives. Signed-off-by: Arne Schwabe --- src/openvpn/mtcp.c | 2 +- src/openvpn/multi.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) Content analysis details: (0.3 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1pAAXg-0007sY-LE Subject: [Openvpn-devel] [PATCH v2 2/4] Bail out when trying to install a TCP socket with residual data to DCO X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1753376163421112547?= X-GMAIL-MSGID: =?utf-8?q?1753376163421112547?= Instead of getting the server in a very weird state, we bail out here. This is only a bandaid solution but better than the alternatives. Signed-off-by: Arne Schwabe --- src/openvpn/mtcp.c | 2 +- src/openvpn/multi.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/openvpn/mtcp.c b/src/openvpn/mtcp.c index 519630544..c07b5d592 100644 --- a/src/openvpn/mtcp.c +++ b/src/openvpn/mtcp.c @@ -591,7 +591,7 @@ multi_tcp_post(struct multi_context *m, struct multi_instance *mi, const int act struct gc_arena gc = gc_new(); msg(M_INFO, "ovpn-dco installed socket with residual read " "len=%d, mi=%s. This connection will probably" - " break.", BLEN(&c->c2.link_socket->stream_buf.residual), + " break.", BLEN(&c->c2.link_socket->stream_buf.buf), multi_instance_string(mi, false, &gc)); gc_free(&gc); break; diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 92e63dd26..6c6385c6e 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -2316,9 +2316,17 @@ multi_client_setup_dco_initial(struct multi_context *m, { if (!dco_enabled(&mi->context.options)) { - /* DCO not enabled, nothing to do, return sucess */ + /* DCO not enabled, nothing to do, return success */ return true; } + + if (socket_read_residual(mi->context.c2.link_socket)) + { + msg(M_INFO, "TCP socket with half read packet. Cannot install to " + "DCO: %s", multi_instance_string(mi, false, gc)); + return false; + } + int ret = dco_multi_add_new_peer(m, mi); if (ret < 0) { From patchwork Tue Dec 27 14:02:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2953 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp2650589dyk; Tue, 27 Dec 2022 06:03:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXvStcj6WJqv3fnlpOplEdnYPRO2LpYkwqVgQKesUJUHOTtj9sn7AobpwPbspHFEqL+VE+cV X-Received: by 2002:a9d:6d90:0:b0:670:5549:9b63 with SMTP id x16-20020a9d6d90000000b0067055499b63mr14643221otp.6.1672149833589; Tue, 27 Dec 2022 06:03:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672149833; cv=none; d=google.com; s=arc-20160816; b=abuxmIF9Vid+MwK4QTDtXhLopn7oBhNQUUEU9sG82fZfxL45FqeUAC6FW7q6noeuX9 Ds5CTsV0eq7ku4kn3Ro8IlbRFWWd0N8zk4VdskrtB4RmCOH0VysncPT0sq4lTNwYPDga chcGSqcUvvJP0C91vptrNuRB0eSHogu4Ms/0+XVn3rAKBsz+emi9yb8M6vBzH29aJRSA 5j1PFLC+UhURrlS4SNR6+uc2XGavLYoBA5SZ0On3nZlMcTSzbnt+zapKaGEviPt5iVVh CJMDvxhf2jL+Jh72TR72oxAlZLSn1m3NGEyxopDDGELNQx+ME36lZjVCJQepVGMpRPHt tgaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=ywxBa0UAKwO0khpgOjEq9Liy6C7G9cjMzY2uH3a/wJs=; b=YChwhZyFW2Q7g3behBmCrj1BRpHSdDp8bB/aTtQ2WfeTLBeRFtc0+Uo8M+DR3bH70e s4vypJwvcK9bNHbizWKlu03ReQkUQSSX5USWWlHmHALRx0tXGFsdi9uvDUcmT7d4s0PS IdmKUe/YQXeotXT9H4trpBkhqsxypyOq/4zTIkHWHGuHwRiq6NpIDIEg9oj+w5btDD6P gSbbQmBfzK2cSjr5m7YCAMxQqVTBMrGfQT89RT+RthOP07OsdM7xTCiano78A+P2Q/E5 yBxst+QHpDoSib8LZ8aKj9uWDsQRbbbw58g+0UI2lAQlaLp2XVfJHxol+XKPS67/QXMq hXrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=PDrevI88; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=k3sdtpUF; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id a21-20020a9d74d5000000b0066c52d18d45si9166403otl.128.2022.12.27.06.03.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2022 06:03:53 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=PDrevI88; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=k3sdtpUF; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pAAXm-0003Pa-Ss; Tue, 27 Dec 2022 14:03:02 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pAAXi-00032c-2K for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 14:02:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7Xv2s85sDzdkU/BT8j25i77TwfMabf0zBEsyomcdXGU=; b=PDrevI889y8jbLKAoKHWWpRnmE tA/uF3f+w1/WvBgsLMA/p/Zo52MqfDm2YCg8kLfVJPUjVT8i8VcOySQwygP9fA6QNioDC95swN4k8 rT3fS94s97KwaamCpkkqc9XPx7QwYW//14muRKE4fLnrzAO7KTJhy8m/Sqzg7JIE+KSY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7Xv2s85sDzdkU/BT8j25i77TwfMabf0zBEsyomcdXGU=; b=k3sdtpUFWOYmW4GWNQh4kVB2eU kMukcvulIJhCvo7DYnZuyQcNEeen3y+bb5xP5XPjsCrcwHAq1U7wcQKWsNgDcV704XgSe1GzkB4ex 7JJWrEK1fVKkzDfkwG4dcurEQfox94HwdyW5Gc6pKxAezlLdO9cH8SZ104+76uLHjLQ4=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pAAXg-00E5SD-Lr for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 14:02:58 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from ) id 1pAAXZ-0004uP-8t for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 15:02:49 +0100 Received: (nullmailer pid 3525000 invoked by uid 10006); Tue, 27 Dec 2022 14:02:49 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Tue, 27 Dec 2022 15:02:48 +0100 Message-Id: <20221227140249.3524943-5-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221227140249.3524943-1-arne@rfc2549.org> References: <20221227140249.3524943-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Score: 0.3 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Signed-off-by: Arne Schwabe --- src/openvpn/multi.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 6c6385c6e..50d88f19a 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -3243, 10 +3243, 19 @@ process_incoming_del_peer(struct mu [...] Content analysis details: (0.3 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1pAAXg-00E5SD-Lr Subject: [Openvpn-devel] [PATCH v2 3/4] Ignore OVPN_DEL_PEER_REASON_USERSPACE to avoid race conditions X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1753376183521439481?= X-GMAIL-MSGID: =?utf-8?q?1753376183521439481?= Signed-off-by: Arne Schwabe --- src/openvpn/multi.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 6c6385c6e..50d88f19a 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -3243,10 +3243,19 @@ process_incoming_del_peer(struct multi_context *m, struct multi_instance *mi, break; case OVPN_DEL_PEER_REASON_USERSPACE: - /* This very likely ourselves but might be another process, so - * still process it */ - reason = "ovpn-dco: userspace request"; - break; + /* We assume that is ourselves. UUnfortunately, sometimes these + * events happen with enough delay that they can have an order of + * + * dco_del_peer x + * [new client connecting] + * dco_new_peer x + * event from dco_del_peer arrives. + * + * if we do not ignore this we get desynced with the kernel + * since we assume the peer-id is free again. The other way would + * be to send a dco_del_peer again + */ + return; } /* When kernel already deleted the peer, the socket is no longer From patchwork Tue Dec 27 14:02:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Schwabe X-Patchwork-Id: 2949 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp2650237dyk; Tue, 27 Dec 2022 06:03:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXuN9W5phQIqAvUtENWtOskNHlI2S+RZOtiZNBeDH8IZsewc09WqS+01E2IS4sXDYHmSWtbt X-Received: by 2002:a05:6870:2b0d:b0:143:95b0:26f9 with SMTP id ld13-20020a0568702b0d00b0014395b026f9mr11281212oab.34.1672149813457; Tue, 27 Dec 2022 06:03:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672149813; cv=none; d=google.com; s=arc-20160816; b=Ucy3DwHPl/Q0QQZPVScCJGe6qolPx3OMFHwGc+Zb3XdxgAPENjkmUPK/T+ggSSO/1o vYUXkdObwxcxqUkY3xjVqPGFvDNbt5aRM1FA5rdQHQVGHtPOJXYoSHqirdECYV/U4N3m e51daBaILrpnSUU2pnbCUxXJKTMzUxM7m56BSAnQJBCNesSu3HBzdpB6BO3YGJ2vGbWd fG4bLrnR9ZwlJ5YgyQVZNeMfkoB1+fnzGSfw19xgy8Itb5T0I7DyVYLfhdAHptRyyZma 4pfiID5TJl9ZxmY9TTYlk9Cf2DRlibeQAaySqX/HESPPbR8alR9T0CZjvYjF+fM9nMqC u6JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=xdgg0K2ljkRnGu70qTnduUVKqWf7rICVOoLDHJBMHQw=; b=JEcAPwNuSQLnr7K31VHo/LPWpjTuzZ3GCRuUlr2Z9qoWpB6gxN8AqZ9yaJNMdLJfpp C7mT5wm3Lc0HwIOlML5+2N1F3eCyqHAAcLPH9LLQLzIezvUZKE91p0PeLfemsjWaenHw Me+olj9RQA20pNqVEPIVi68iDJKh8HLtf2sQNyDSdElcr5tns0rwxbdJEOVMfJItq1Ob bOXvtfeqxJ3rYWiLrz+1ZaC8teirxZ76LgI0kQgS3QSO3KSe1AQK2B6cUeFdAEW/X7fr 3+lNRJpYSI7blQckWV2qYzHE6dKYJt2PxuQSscgBihM0qS3Kl+HGghZBPjfWdAH4VpdL STLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="XjoAR/L8"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Wut1ZREr; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id f20-20020a056870d15400b001369624e246si10481090oac.87.2022.12.27.06.03.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2022 06:03:33 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="XjoAR/L8"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Wut1ZREr; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pAAXi-0002hQ-KZ; Tue, 27 Dec 2022 14:02:58 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pAAXh-0002hJ-Hx for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 14:02:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=hyxCxazwdCYX2DHq09F0tFh/rOvhE6tIv1pWUbyKNKE=; b=XjoAR/L8nEG6Tamuv2uvZ/mqoX UuZ9Etpf/4LqsDfLIs2jICDHbV2rHxc7AGYekab+1EIBguw8Ou0/JzjC/N+sznzwpCYUVeVYyS94o VhMqNM7ak6XldtQ+bKRlkjIsraBqWn2CrAVuVJsyySydy/QBStUDW3S8mJVjSkpaHdzY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=hyxCxazwdCYX2DHq09F0tFh/rOvhE6tIv1pWUbyKNKE=; b=Wut1ZRErZSTw7HJ1HNU5yNogij R3AZuYpHWboF8mB/0D4uWFLzcmh9zHfmCTAKBM5LGO4hLXKYuL0aqT4votTvXoDPsbNQ0AwlDKNrv H6/h/yfR3No/RrHdpUa9VFfp45GgVksbLZHKR6XfCw0Y1WgWny8xK5P1EhssIfGhZ9Lo=; Received: from mail.blinkt.de ([192.26.174.232]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pAAXg-0007sX-KV for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 14:02:57 +0000 Received: from kamera.blinkt.de ([2001:638:502:390:20c:29ff:fec8:535c]) by mail.blinkt.de with smtp (Exim 4.95 (FreeBSD)) (envelope-from ) id 1pAAXZ-0004uR-9f for openvpn-devel@lists.sourceforge.net; Tue, 27 Dec 2022 15:02:49 +0100 Received: (nullmailer pid 3525003 invoked by uid 10006); Tue, 27 Dec 2022 14:02:49 -0000 From: Arne Schwabe To: openvpn-devel@lists.sourceforge.net Date: Tue, 27 Dec 2022 15:02:49 +0100 Message-Id: <20221227140249.3524943-6-arne@rfc2549.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221227140249.3524943-1-arne@rfc2549.org> References: <20221227140249.3524943-1-arne@rfc2549.org> MIME-Version: 1.0 X-Spam-Score: 0.3 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This enables logging the peer id in p2mp mode if dco is enabled and the log level is high enough Signed-off-by: Arne Schwabe --- src/openvpn/multi.c | 6 ++++++ 1 file changed, 6 insertions(+) Content analysis details: (0.3 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1pAAXg-0007sX-KV Subject: [Openvpn-devel] [PATCH v2 4/4] Log peer-id if loglevel is D_DCO_DEBUG and dco is enabled X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1753376162930150102?= X-GMAIL-MSGID: =?utf-8?q?1753376162930150102?= This enables logging the peer id in p2mp mode if dco is enabled and the log level is high enough Signed-off-by: Arne Schwabe --- src/openvpn/multi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 50d88f19a..f8366be28 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -473,6 +473,12 @@ multi_instance_string(const struct multi_instance *mi, bool null, struct gc_aren buf_printf(&out, "%s/", cn); } buf_printf(&out, "%s", mroute_addr_print(&mi->real, gc)); + if (mi->context.c2.tls_multi + && mi->context.options.verbosity >= D_DCO_DEBUG + && dco_enabled(&mi->context.options)) + { + buf_printf(&out, " peer-id=%d", mi->context.c2.tls_multi->peer_id); + } return BSTR(&out); } else if (null)