From patchwork Wed Feb 11 15:06:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 4756 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:1817:b0:80a:3855:ce6a with SMTP id p23csp206557max; Wed, 11 Feb 2026 07:07:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX7X7t+TCX0xEWXkM+aN9Z0eJDAK0uGWohqRgCVfFXx8ctpQpayDKj/XjplpH+vjXSn1AqqeMnpNmM=@openvpn.net X-Received: by 2002:a05:6870:888a:b0:3e8:8e56:671e with SMTP id 586e51a60fabf-40ea965448dmr1650567fac.54.1770822431156; Wed, 11 Feb 2026 07:07:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1770822431; cv=none; d=google.com; s=arc-20240605; b=lORjlPuoAtGbj3BGiORD4sf/HKL1/qpXwv27Fhjfs/JTly5zeG08VGvYfvIuEEScJW ZwofKtF1uzpSMAPxu3C9BKgsz2TqtaRcSpDW4tmIx/ZhiWfEo3o7vus72bQG3vQVJHS0 s8Ccsc2SazbrC/6bX3maS54+HEwUwnGKYy7N11w7luMTRGyP3d3OmWxRhLHj3396ccK1 HllCfNyOXalzevIGe+zrg3rDcJuBJqcJKpa0efo8K73fT09T0zhLlh/BsSOrWiWKky3R Y+t3paiJE0H01T5aSuTbfmW6o+2rAf1HHfwTMWyQ3nQpqWEKbVctoYqF33dEJFhZQzLF C/sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:dkim-signature; bh=xOQ/Qhyb4FshK3s3JuZHrhcL2mW3jRpLVVfnRDBcSIY=; fh=oHFsXhGO7ECKiwqrShgwGfAGGPWeuBskwCLeyoMLkfU=; b=eNIKLoikcWKgrg8vkOWftZRq08Rbb3ipK2GleaTyKT/zyaDguP4OWB1Hx2VMPkx0F4 rRlMfDWiwH6xd7AA62gRjLCtgrc80CJ4mAkZLAIGlB1TUw05eBDZHkeevvdLyS2JGaBG eAc8jbkUp1lGtxtNVOId0HOrwwsRTEnNJsCTe/hOewfEOTMQtcya51ls3qUl4/qrwSHZ MxykNavg7PX0nIA6GZPDFaFLuVN1bEovPPn1AVrscZurqOV/TbG+Kh/VM6Wkyv2GovxC UIzUq6q4jlC0nWF1Gb9rOJoMSSPeCvpoAnsDwlm5GM59fjnexH0dHa8lP907q9hD4iX2 QQWQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=W8CIgI3B; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="gAmSKr/z"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Muk6m+7B; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=JPQnRIw2; 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 586e51a60fabf-40eaee77c2asi1652777fac.6.2026.02.11.07.07.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2026 07:07:11 -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=pass header.i=@lists.sourceforge.net header.s=beta header.b=W8CIgI3B; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b="gAmSKr/z"; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=Muk6m+7B; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=JPQnRIw2; 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xOQ/Qhyb4FshK3s3JuZHrhcL2mW3jRpLVVfnRDBcSIY=; b=W8CIgI3Bh4RHZoSgUSuzgNmO+N bcW6rMzXeFanC0Ep7t1wmSWl6E1fpmEvS5RpVAKDgwjk8TgU8N/hc5k33LIN1aj6OiuCjhO00I9KL wJEPiLV6wOUWtZzMG4ocPB0ZQIwXBMtYDR3kwtTP5A95/LUSy600xk3DIe9l3zPOqH1c=; 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 1vqBny-0004iw-U4; Wed, 11 Feb 2026 15:07:03 +0000 Received: from [172.30.29.66] (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 1vqBnw-0004ib-K6 for openvpn-devel@lists.sourceforge.net; Wed, 11 Feb 2026 15:07:02 +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=J1yyN5ofjqeyXsRq0HDPZhx8kdcYIbGLhqEMT8x9wnI=; b=gAmSKr/z4G6Hz5ARPPlD6OrHVV KN5hRciUTDVwN1igACGjPbXxIGrPb8HHnofe8tQMpBpxyObmJ1PKcz/00qxrf5QYIX+s+5385DIEh b6J5n9kWunjAiTafYn9nt06Hj5VjrTGwlJVN48Cbz2KgajrO0NkUfMf8+OFjmFi7T4qA=; 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=J1yyN5ofjqeyXsRq0HDPZhx8kdcYIbGLhqEMT8x9wnI=; b=Muk6m+7BihghAWv1riXg5e94Cv r7Y1mXZ9Wrb6yUU1Ykotrfu6y1SU0hDfojoVg6Hto90AxVBNfGYGmY18u+w3YxyjCLxg7PTJ3wNgl d/eoHRabdxlxfKsM9uozEwEp3o7qM7pPLuSUkaS6jdYD3EbQqmnHeAwV7lm8YNpriVTE=; Received: from mout-p-101.mailbox.org ([80.241.56.151]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1vqBnv-0002Rk-FY for openvpn-devel@lists.sourceforge.net; Wed, 11 Feb 2026 15:07:01 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4fB1x658F2z9tjd; Wed, 11 Feb 2026 16:06:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1770822410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J1yyN5ofjqeyXsRq0HDPZhx8kdcYIbGLhqEMT8x9wnI=; b=JPQnRIw2GENqPtzENv0ZQCkJdO4betdELdyFCkUVccfq6+MSl+Ox3nIlQDJKyc06+t4aH6 qyrTghN9vVR7GlsS5cGyp6lGdMgX0wehK5y7BSVdOLI6mNsNXB4ZAgDhiuDpQyY5TGFIe6 UZcY2YR1fzK+8fVohMLjA1MKYGcE5gmcRjlL/uh/k+hWqKjkoB8DDZLUl/7oqnsUt2TGC0 JZ54BuS9e65rx29t86GHZNKAFy9Unz52SAhDj876YFf2ir6JMk2BvuJnokoCxMgyhgwT8I 2LRSRDPySFkBZ5yUns7Mz3u+vQ6IjdcJzDjakS2IOOgcIz5qu6cpDiJwikBEDA== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Wed, 11 Feb 2026 16:06:48 +0100 Message-ID: <20260211150648.113547-1-frank@lichtenheld.com> In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "sfi-spamd-2.hosts.colo.sdot.me", 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: From: Gert Doering M_ERR is defined as (M_FATAL | M_ERRNO), so 'msg(M_ERR | M_ERRNO, ...)' is just the same as 'msg(M_ERR, ...)'. The occurances in tun.c and dco_freebsd.c are really "if this happens, we can not go on" errors, so 'M_ERR' (= FATAL, plus log errno string) is the correct thing to do. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -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: 1vqBnv-0002Rk-FY Subject: [Openvpn-devel] [PATCH v1] rework all occurrences of 'M_ERR | M_ERRNO' 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: Gert Doering , Arne Schwabe Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1856841901527731937?= X-GMAIL-MSGID: =?utf-8?q?1856841901527731937?= From: Gert Doering M_ERR is defined as (M_FATAL | M_ERRNO), so 'msg(M_ERR | M_ERRNO, ...)' is just the same as 'msg(M_ERR, ...)'. The occurances in tun.c and dco_freebsd.c are really "if this happens, we can not go on" errors, so 'M_ERR' (= FATAL, plus log errno string) is the correct thing to do. The occurances in dns.c do come with error handling and cleanup after the msg() call, so the right thing is 'M_WARN | M_ERRNO' instead (warning, plus log errno string). Github: fixes OpenVPN/openvpn#939 Change-Id: I14395665f197349e374a81b56f28536ff88937a8 Signed-off-by: Gert Doering Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1517 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1517 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Arne Schwabe diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c index d1ad092..ee3a5d0 100644 --- a/src/openvpn/dco_freebsd.c +++ b/src/openvpn/dco_freebsd.c @@ -177,7 +177,7 @@ ret = ioctl(dco->fd, SIOCSDRVSPEC, &drv); if (ret) { - msg(M_ERR | M_ERRNO, "Failed to create new peer"); + msg(M_ERR, "Failed to create new peer"); } free(drv.ifd_data); @@ -317,7 +317,7 @@ ret = ioctl(tt->dco.fd, SIOCIFDESTROY, &ifr); if (ret) { - msg(M_ERR | M_ERRNO, "Failed to remove interface %s", ifr.ifr_name); + msg(M_ERR, "Failed to remove interface %s", ifr.ifr_name); } tt->dco.ifname[0] = 0; @@ -473,7 +473,7 @@ ret = ioctl(dco->fd, SIOCSDRVSPEC, &drv); if (ret) { - msg(M_ERR | M_ERRNO, "Failed to start vpn"); + msg(M_ERR, "Failed to start vpn"); } return ret; @@ -511,7 +511,7 @@ ret = ioctl(dco->fd, SIOCSDRVSPEC, &drv); if (ret) { - msg(M_ERR | M_ERRNO, "Failed to set key"); + msg(M_ERR, "Failed to set key"); } else { diff --git a/src/openvpn/dns.c b/src/openvpn/dns.c index c00d4b9..3d24050 100644 --- a/src/openvpn/dns.c +++ b/src/openvpn/dns.c @@ -611,13 +611,13 @@ int ack_pipe_fd[2]; if (pipe(dns_pipe_fd) != 0 || pipe(ack_pipe_fd) != 0) { - msg(M_ERR | M_ERRNO, "run_dns_up_down: unable to create pipes"); + msg(M_WARN | M_ERRNO, "run_dns_up_down: unable to create pipes"); return false; } updown_runner->pid = fork(); if (updown_runner->pid == -1) { - msg(M_ERR | M_ERRNO, "run_dns_up_down: unable to fork"); + msg(M_WARN | M_ERRNO, "run_dns_up_down: unable to fork"); close(dns_pipe_fd[0]); close(dns_pipe_fd[1]); close(ack_pipe_fd[0]); @@ -747,7 +747,7 @@ { continue; } - msg(M_ERR | M_ERRNO, "could not send dns vars filename"); + msg(M_WARN | M_ERRNO, "could not send dns vars filename"); } break; } @@ -762,7 +762,7 @@ { continue; } - msg(M_ERR | M_ERRNO, "could not receive dns updown status"); + msg(M_WARN | M_ERRNO, "could not receive dns updown status"); } break; } diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index e38df3e..3f9ee5d 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -3011,7 +3011,7 @@ /* Retrieve the assigned interface name. */ if (getsockopt(fd, SYSPROTO_CONTROL, UTUN_OPT_IFNAME, utunname, &utunname_len)) { - msg(M_ERR | M_ERRNO, "Error retrieving utun interface name"); + msg(M_ERR, "Error retrieving utun interface name"); } tt->actual_name = string_alloc(utunname, NULL);