From patchwork Tue Jan 3 20:23:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2970 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp7196804dyk; Tue, 3 Jan 2023 12:23:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXvCzFhp3BNJsoimM5Hsa3K0IbU1f/GG88Pco1ZOfUUw582a11OZX/CsyADgc7qtWDfbORA3 X-Received: by 2002:a05:6a21:e313:b0:af:9538:ec5f with SMTP id cb19-20020a056a21e31300b000af9538ec5fmr56242053pzc.38.1672777435913; Tue, 03 Jan 2023 12:23:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672777435; cv=none; d=google.com; s=arc-20160816; b=m/PKf0dOqdjy/h4k0TIgThix34ubd6n6nOtREdvlnAqTD1g6iaOqLhlJ/Ke3b0UIT0 qtn5b85kkviJFG3JECYe9DpxhMJ5LztrGifp/eyoWsFsc46SG5wRoj7h6qzC+GZQWqsJ GVEYIUjgsncwp4bkAKZNlEBlBVHB1pNkGKZ39eMwDj1Lf/OY8n7Ip1WExqRiYLL2rDOB 3NgdBR9wnMJlPGeiX3qOp/sk0wcDv4bKRzQU1vpNKpGCPf064bGgnMIsZRNGHL8h6mUe G5RbOxzHMYWkSalwR/bTSHAHZgm2BcKnlwYbEyZpOcr/SM1v1gfZdtk0r//0jsjG/aBY B7og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:cc: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 :dkim-signature; bh=3rwMEorGFB8YSiBllP7zWY9S75xD6gE6nTunI+YcTSY=; b=ldT4igDIUhYKEmv7jZsG/aYbYk+psWNuDP4PP3WPn3wyq9dc5g1UZb1JldN6sqj3K9 vktlaCay428kWnNri9ufB+9T3IIbiC/8Djq58cNnMfaOK9qGwsSeYB38fyv8Fw4lYoYg gYWBzDvQ3zAkgwlv9LW/lEF29PjPHtP+x4BqMPyTI4v5H5P0a2BZHBqTDNPo7VK9ihxx LIxkxszf/uFxeeXVd7+uiki9pWfKCT1jsFQSGsoX/1Keo0P9WXBrNXY5SyfVDy4w4ENo Y10KCIGaU66yBfhgNZrg9nfv6KHg+gkqRwW22ImBtDRPHDDKNK+fonnHFvYaiv8nVASX zKzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=OtS8k4Hc; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=FYzP4T1z; dkim=fail header.i=@unstable.cc header.s=20220809-q8oc header.b=cpAztnM1; 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 q5-20020a654945000000b0048be2e2a01esi34392831pgs.174.2023.01.03.12.23.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2023 12:23:55 -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=OtS8k4Hc; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=FYzP4T1z; dkim=fail header.i=@unstable.cc header.s=20220809-q8oc header.b=cpAztnM1; 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 1pCnor-00034c-88; Tue, 03 Jan 2023 20:23:33 +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 1pCnoq-00034S-13 for openvpn-devel@lists.sourceforge.net; Tue, 03 Jan 2023 20:23:32 +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:Cc:To:From:Sender:Reply-To: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=co5qKncLDveICc3LfQKGDSejE1ekRMPwPzeL9YDRM6Y=; b=OtS8k4Hc7u8je2wC9vRL92DAJN 81Jnw1hZpqFwZ6pRle4UGEZh24DyZF8CVKZmKTvIP+ycYmldILr4hKguc0qFm5EytdLfCbdQoys3t ohq+ZIcTTHimUEavSV0kwHGahpQl26k93h8P9wuJxdMZqzmVryK1GmO85t2W5J2EWYxE=; 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:Cc:To:From :Sender:Reply-To: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=co5qKncLDveICc3LfQKGDSejE1ekRMPwPzeL9YDRM6Y=; b=F YzP4T1z74f9YajdU5wVzajxVLGFnMem5+PfzLlh9zTRycyBm12zfsPBpSKWODUrgmNnerIerQmyWy fV/+eXmruEUY8N9ahLcD4ww/fFRISRcCBfOOeZBASPQ+7Y8a3HE4yg8SJUtsRi0q9bJepHRhMk2Ni PotCxP47ANpVpbpM=; Received: from wilbur.contactoffice.com ([212.3.242.68]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pCnoh-003hFf-7f for openvpn-devel@lists.sourceforge.net; Tue, 03 Jan 2023 20:23:31 +0000 Received: from smtpauth2.co-bxl (smtpauth2.co-bxl [10.2.0.24]) by wilbur.contactoffice.com (Postfix) with ESMTP id 13085A22; Tue, 3 Jan 2023 21:23:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1672777393; s=20220809-q8oc; d=unstable.cc; i=a@unstable.cc; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Transfer-Encoding; l=767; bh=co5qKncLDveICc3LfQKGDSejE1ekRMPwPzeL9YDRM6Y=; b=cpAztnM1Y1rkbcGd8ozhcbi3TFkxXR2eXGnUC5BJNZy6eKtj4r0sLxw2ftziN5JA Cqc7aFGYl8TBoPsvH9YF0G+iI6YO3hBJEb9HKSfaqb2xT5fnZi03/IlVlYod6uddAFu PVt733FxalBSMVYnUvCIoOoTggOHKJVH7x43sVBo0Rv7pVyiLCtQAZwJv9AkoUA0rtk Al/u++KjGbmGKnOqvYvwEzFs7L7i0WR+Fdo5bMiBXm9CwbX66O7Jrba01ywExa8SAgj 6n98fnFd0WANB8LO86iEUTDEf5AVkgakdN4ugbe3g36fwZ3IyUys+byN1S7id2Cakxq zC67zdXppw== Received: by smtp.mailfence.com with ESMTPSA ; Tue, 3 Jan 2023 21:23:10 +0100 (CET) From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Tue, 3 Jan 2023 21:23:28 +0100 Message-Id: <20230103202330.1835-1-a@unstable.cc> X-Mailer: git-send-email 2.38.2 MIME-Version: 1.0 X-Spam-Flag: NO X-Spam-Status: No, hits=-2.9 required=4.7 symbols=ALL_TRUSTED, BAYES_00 device=10.2.0.1 X-ContactOffice-Account: com:375058688 X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.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: After processing a message, all fields of the dco object should be re-initialized so that future processings are not affected by stale values. This includes dco_del_peer_reason. Since its values can start at 0, re-initialize it with -1. Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.3.242.68 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-Headers-End: 1pCnoh-003hFf-7f Subject: [Openvpn-devel] [PATCH 1/3] dco: properly re-initialize dco_del_peer_reason 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: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1754034272810592963?= X-GMAIL-MSGID: =?utf-8?q?1754034272810592963?= After processing a message, all fields of the dco object should be re-initialized so that future processings are not affected by stale values. This includes dco_del_peer_reason. Since its values can start at 0, re-initialize it with -1. Signed-off-by: Antonio Quartulli Acked-By: Arne Schwabe --- src/openvpn/multi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 3658e1d5..27676de5 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -3301,6 +3301,7 @@ multi_process_incoming_dco(struct multi_context *m) dco->dco_message_type = 0; dco->dco_message_peer_id = -1; + dco->dco_del_peer_reason = -1; dco->dco_read_bytes = 0; dco->dco_write_bytes = 0; return ret > 0; From patchwork Tue Jan 3 20:23:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2972 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp7196809dyk; Tue, 3 Jan 2023 12:23:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXuvpRUEncjNhw/Mc702z+BmUr+IfiH1MlicnNhL89NYP63MXybpJqH1xLqF39iC4ib4pVhm X-Received: by 2002:a05:6a20:4e04:b0:9d:efbf:786a with SMTP id gk4-20020a056a204e0400b0009defbf786amr51038013pzb.31.1672777436430; Tue, 03 Jan 2023 12:23:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672777436; cv=none; d=google.com; s=arc-20160816; b=WHzJ3aLDcjhhFV+UIJmkxA2zdFdSzDM+5H32qQgWFjxpLJtd92q+tNqLNIP/dOpJ9u 4+gv20Lg/aHJ6+x4HLEgQNwmSCt1jy/AeoUZ/r/mLyqO4Iu6XVP6NbSsvQ7I4f+tfLLR Udh062Cyp4gnWJg8xknNa/FLW3wArQqjuPmQyV9YA2GzYPsdbX3LWWU/8HCb8f7ZdJ6Z sMIv4vGjw7QVW5r+yiISMIjs+z1so4hT/7Zf3Ba4EXFhxl0/uBAZbLe77RFKYxFFy0sx kEfjL2UGr/DMFxIL3HnQj5vTvRJUSNcNaAWMuohkNF+5DQhdEyf0K2P9zQ099hU5hJEm IHXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:cc: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:dkim-signature; bh=vw2HVF2Qvv957CpPIOYS+FHypZPy6Q6FQua+Eptcy5A=; b=hjEKVEabConyghTNbxziZexM/LeptX/c3s6wc/h8s5Bef3gpPbYxSZ/KNaLD9DxXcd wkgeDuojSUv6ytWil5+LSEumERqiy1LL19jTy54masMECkB0W4na1IBadAj5AtnnyYYt qrl7IupzNgA3fyf6tmt1Jv9O+vU+nEDcuYnxeTYm4TAp0lqhY6o1/yrUB5oADcowM9ez 7Low1KFjEpadUCKVs4msIq90xFTUnvS09UhP8kaZdzWFZl2C3pZSrFF6fAmK0wz2Z9eI cVT3kDZM6ZDK1nkK22DCcwGl1hcDa55R4cJTg16r3LIL37aTnxVE9vqheSwEneZ0dL3/ izCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=ORwLd+kq; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=J+HhSQkb; dkim=fail header.i=@unstable.cc header.s=20220809-q8oc header.b="YRtWP/Nh"; 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 e2-20020a636902000000b004771126e2f7si30575802pgc.142.2023.01.03.12.23.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2023 12:23:56 -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=ORwLd+kq; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=J+HhSQkb; dkim=fail header.i=@unstable.cc header.s=20220809-q8oc header.b="YRtWP/Nh"; 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 1pCnop-00028x-KW; Tue, 03 Jan 2023 20:23:31 +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 1pCnom-00028q-Dd for openvpn-devel@lists.sourceforge.net; Tue, 03 Jan 2023 20:23:28 +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:Cc:To:From:Sender:Reply-To: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=W7vkX7hQZgG5UvzydxWQovr08M+JJIwG52rBq9Y5NTM=; b=ORwLd+kqVGsKdq7uaJ3dY+JC0t 7t0Y/O5A+qhalvMl5kXkqwNLFJz5ois5dxlWbzZm81LoL1winmZ8Q/nX4YpTRtlZ/DbnqV1pQIhPg Blya0PZ4SmEDT4W/FQm1L5aC4CjNQwpHn64/26bMf7LZ/ioDHTk/EGempqkcQl2RobsQ=; 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:Cc:To:From:Sender:Reply-To: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=W7vkX7hQZgG5UvzydxWQovr08M+JJIwG52rBq9Y5NTM=; b=J+HhSQkbPyVuFN/8b65ufyKSmy i3woXT2SODx+D+KPY4Xhrwk1EIOVTf0T5x8hvMZYFMaSvZsLBLsXAghrXsgwulmD9pY1hOi3ZwDFK M5EG0tn5wuhPTGsZ9vP/AjM4VeNPkLAMVVJav4OtQFrZfmirTpTppQfMpZHfr0INBvPI=; Received: from wilbur.contactoffice.com ([212.3.242.68]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pCnoe-0000lf-7R for openvpn-devel@lists.sourceforge.net; Tue, 03 Jan 2023 20:23:28 +0000 Received: from smtpauth2.co-bxl (smtpauth2.co-bxl [10.2.0.24]) by wilbur.contactoffice.com (Postfix) with ESMTP id 110DD9FA; Tue, 3 Jan 2023 21:23:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1672777393; s=20220809-q8oc; d=unstable.cc; i=a@unstable.cc; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; l=1208; bh=W7vkX7hQZgG5UvzydxWQovr08M+JJIwG52rBq9Y5NTM=; b=YRtWP/Nh5+P49S6/H3rw6c+Y01RfslAB2tSWMtbXtBf3GBw/dvh1aKqq4MKl7rbK rpMuEOKEEpZK/EwGYg3842CnGfN++ne/fDEc6ariu0dSccrY4daTTJrBKZLcYppr9Li GP9FSsiqlz28I364qWzvZzcyfmHv23NQpx4FzFWOiyMRwaAIfTfR432MwGG18m17+v0 T+j7P01VaQoWQhGdmRvxIyhA7vq8O0WCmZdNUO+mTJy8dUcFMIocfqKWJqzB/9rhcM1 8vLRUJBuuoXO3TiWyd2X2Pksjf9I+RsYz1wet34SEvfllufhHvS1AYy+PZXREtCfShO Sfp0EzaF+g== Received: by smtp.mailfence.com with ESMTPSA ; Tue, 3 Jan 2023 21:23:11 +0100 (CET) From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Tue, 3 Jan 2023 21:23:29 +0100 Message-Id: <20230103202330.1835-2-a@unstable.cc> X-Mailer: git-send-email 2.38.2 In-Reply-To: <20230103202330.1835-1-a@unstable.cc> References: <20230103202330.1835-1-a@unstable.cc> MIME-Version: 1.0 X-Spam-Flag: NO X-Spam-Status: No, hits=-2.9 required=4.7 symbols=ALL_TRUSTED, BAYES_00 device=10.2.0.20 X-ContactOffice-Account: com:375058688 X-Spam-Score: -0.9 (/) 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: multi_process_incoming_dco() is currently partly processing messages that were actually discarded. This results in a bogus message being printed: "Received packet for peer-id unknown to OpenVPN: -1, type 0, reason 2" Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.3.242.68 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1pCnoe-0000lf-7R Subject: [Openvpn-devel] [PATCH 2/3] dco: bail out when no peer-specific message is delivered 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: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1754034273212495303?= X-GMAIL-MSGID: =?utf-8?q?1754034273212495303?= multi_process_incoming_dco() is currently partly processing messages that were actually discarded. This results in a bogus message being printed: "Received packet for peer-id unknown to OpenVPN: -1, type 0, reason 2" Change the flow so that we bail out immediately when we know that no message was truly delivered by DCO. Currently this can be verified by chacking that the peed_is is greater than -1. Signed-off-by: Antonio Quartulli Acked-By: Arne Schwabe --- src/openvpn/multi.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index 27676de5..b10a6d8d 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -3270,7 +3270,15 @@ multi_process_incoming_dco(struct multi_context *m) int peer_id = dco->dco_message_peer_id; - if ((peer_id >= 0) && (peer_id < m->max_clients) && (m->instances[peer_id])) + /* no peer-specific message delivered -> nothing to process. + * bail out right away + */ + if (peer_id < 0) + { + return ret > 0; + } + + if ((peer_id < m->max_clients) && (m->instances[peer_id])) { mi = m->instances[peer_id]; if (dco->dco_message_type == OVPN_CMD_PACKET) From patchwork Tue Jan 3 20:23:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2971 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp7196803dyk; Tue, 3 Jan 2023 12:23:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXshhGS4xBWTtsTlCxjkQPOgeOEEM6kzTAXqDvSLeOFdBRrMFJnJta2sshCWgt6uMaEcXLHO X-Received: by 2002:a05:6a20:9e05:b0:af:9391:449 with SMTP id ms5-20020a056a209e0500b000af93910449mr55027508pzb.45.1672777435911; Tue, 03 Jan 2023 12:23:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672777435; cv=none; d=google.com; s=arc-20160816; b=k7Ei2D2N52V3b8/DQS7u05+LMYxtL8F6t0Q5Zskvv70LZMfVFKceuqb0o8WxyYlDuN PwRgsR2mWl7frJz4ih2i5e8yPHoHcJK8UeSC+DXUFF1tOvPZE6MJ/0IJ3tm1TOM0Zxpd FUxBe5NLFNQw4DRSZ7CWWmje+RCrUFYL+Dg2Sjt0A343xHQVA++gDyQjmM85egEcxlAo 3/VFBiIYxQrkQ18FZLGBh240nD/Xpjd8R/j2P5LJ7C7Vfmq7VzzIep9kccLYCaXSromY 1c7Z8p0EjoVr4ntwfSuGNNBPRQ2XcYd8+FZonJB1tHnYte9X43Yyx0zJxW8wqpla8qUb lueQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:cc: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:dkim-signature; bh=dB+Xb1h0Txk3JsZFq61i7v6Ilo7A+RBbVQi7pWfTus0=; b=spPDkFGA4OaIxPPnpecESDfTvxVI+yf5J+7zP/FqN5aZZCS1WMUDHm4CiET/OYTXgJ qyLcVYnJU4AtoMfTX9+cwPlRsq8ajue4QTrTlXTmINsnAc82p4cZq8p3cUDrIytxrIrh 7aCYZj2c8y/qHfstmE6fvbCg48Xy5os8mjZzXqXAWF3l1EL4IHkn1h1e4nlHulOxtzG0 S8LlL4d6T16mgcCf/RGeDhSuGVvu7EAW/eu641i7Dz/cccmSj9iz17zuKLMLUyEfAebM LKQ0AEq9SE3+0G8Q9ku20OTh04tMjR7WmXu6fICs2vXxF29alvOTkbThH78VGR4htVep Vbig== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=XKm4ETeq; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=UXlIv4SK; dkim=fail header.i=@unstable.cc header.s=20220809-q8oc header.b=dHS6grwB; 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 p1-20020a63c141000000b004770fe95989si33470965pgi.496.2023.01.03.12.23.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2023 12:23:55 -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=XKm4ETeq; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=UXlIv4SK; dkim=fail header.i=@unstable.cc header.s=20220809-q8oc header.b=dHS6grwB; 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 1pCnoo-0000NZ-NJ; Tue, 03 Jan 2023 20:23:30 +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 1pCnom-0000NS-Cm for openvpn-devel@lists.sourceforge.net; Tue, 03 Jan 2023 20:23:28 +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:Cc:To:From:Sender:Reply-To: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=2/1bR3Nw4/aAKGM16lgoQ8o1pk5sxVrlbGRioZQrWrY=; b=XKm4ETeqsStUqUmUBJdwVnnm6o AysPB+iv9xQoeTBUMJiH6r8Js8GDStPuA1QSAR52tHJyj6AsMhNejvvc/9cdVzpNozIF8jvaBLJ/W mVbBqfAJ/lqcg7AJtjzjfkABJJfGUkMMxMlifF4hxhOkSVINowOEWgACvlPmP8Dd8w28=; 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:Cc:To:From:Sender:Reply-To: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=2/1bR3Nw4/aAKGM16lgoQ8o1pk5sxVrlbGRioZQrWrY=; b=UXlIv4SKZAPTq4U5at4lhK+JIC KOwY9dM5pesvfahTGirbpdUrhT7CeHuXZJHzrV9P0c6uGBzhsJo9QkYYQVkXLCt9piXMiHrj0v7cn yaxZTttmSZVM/UXCFLsL8zHk3Cb9VuLZIZY3RXlcHXdWVQhYz31IpmgGo8g5vgutIs90=; Received: from wilbur.contactoffice.com ([212.3.242.68]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pCnof-0000lk-PI for openvpn-devel@lists.sourceforge.net; Tue, 03 Jan 2023 20:23:28 +0000 Received: from smtpauth2.co-bxl (smtpauth2.co-bxl [10.2.0.24]) by wilbur.contactoffice.com (Postfix) with ESMTP id 9E4341614; Tue, 3 Jan 2023 21:23:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1672777395; s=20220809-q8oc; d=unstable.cc; i=a@unstable.cc; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; l=1472; bh=2/1bR3Nw4/aAKGM16lgoQ8o1pk5sxVrlbGRioZQrWrY=; b=dHS6grwBkOUXo8JyhG4cauVthBHWwkIgq8Jp9IfWKkaen7b1Jx+SCBWO0bJWwVK6 pADc3ZBMFYWjfqJEoC27r5+00F1qCJAJnn6B145Zxz+a7CFHytiMPu2F/gp1gzAm+mI TOiXVl5G+xHNOKxVfb9zd8bJxlwMoJauaJB23lrC9+nS/MC6X5QPQqeUb9ypyF6ef7x YaDbQoIcip85P4J0/e5e/xfNxzLCd2rNKvTRF/fIEBr6/5ot5oWAQ8RVlA8wZQwccgU m06ZQNme8X0wyIUiZj71ProMt41vW50fgt+feWwZqN15qswwFLWBdVCG5WmsPsY+xdp SdMsZbPfhg== Received: by smtp.mailfence.com with ESMTPSA ; Tue, 3 Jan 2023 21:23:12 +0100 (CET) From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Tue, 3 Jan 2023 21:23:30 +0100 Message-Id: <20230103202330.1835-3-a@unstable.cc> X-Mailer: git-send-email 2.38.2 In-Reply-To: <20230103202330.1835-1-a@unstable.cc> References: <20230103202330.1835-1-a@unstable.cc> MIME-Version: 1.0 X-Spam-Flag: NO X-Spam-Status: No, hits=-2.9 required=4.7 symbols=ALL_TRUSTED, BAYES_00 device=10.2.0.21 X-ContactOffice-Account: com:375058688 X-Spam-Score: -0.9 (/) 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: While at it also improve the debug message itself to be more self-explanatory. Signed-off-by: Antonio Quartulli --- src/openvpn/multi.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.3.242.68 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1pCnof-0000lk-PI Subject: [Openvpn-devel] [PATCH 3/3] dco: improve comment about hidden debug message 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: , Cc: Antonio Quartulli Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1754034272896842760?= X-GMAIL-MSGID: =?utf-8?q?1754034272896842760?= While at it also improve the debug message itself to be more self-explanatory. Signed-off-by: Antonio Quartulli Acked-By: Arne Schwabe --- src/openvpn/multi.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index b10a6d8d..8facc66f 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -3296,12 +3296,17 @@ multi_process_incoming_dco(struct multi_context *m) if (dco->dco_message_type == OVPN_CMD_DEL_PEER && dco->dco_del_peer_reason == OVPN_DEL_PEER_REASON_USERSPACE) { - /* we get notified after we kill the peer ourselves and probably - * have already forgotten about it. This is expected */ + /* we receive OVPN_CMD_DEL_PEER message with reason USERSPACE + * after we kill the peer ourselves. This peer may have already + * been deleted, so we end up here. + * In this case, print the following debug message with DCO_DEBUG + * level only to avoid polluting the standard DCO level with this + * harmless event. + */ msglevel = D_DCO_DEBUG; } - msg(msglevel, "Received packet for peer-id unknown to OpenVPN: %d, " - "type %d, reason %d", peer_id, dco->dco_message_type, + msg(msglevel, "Received DCO message for unknown peer-id: %d, " + "type %d, del_peer_reason %d", peer_id, dco->dco_message_type, dco->dco_del_peer_reason); /* Also clear the buffer if this was incoming packet for a dropped peer */ buf_init(&dco->dco_packet_in, 0);