From: "cron2 (Code Review)" Date: Mon, 16 Feb 2026 14:54:39 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="q6kBXLsbX1w="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: rework all occurrences of 'M_ERR | M_ERRNO' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --q6kBXLsbX1w= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1517?usp=3Demail to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review+2 by plaisthos Change subject: rework all occurrences of 'M_ERR | M_ERRNO' ...................................................................... rework all occurrences of 'M_ERR | M_ERRNO' 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' (=3D 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 Message-Id: <20260211150648.113547-1-frank@...2641...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 594.html Signed-off-by: Gert Doering --- M src/openvpn/dco_freebsd.c M src/openvpn/dns.c M src/openvpn/tun.c 3 files changed, 9 insertions(+), 9 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/17/1517/2 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 =3D 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 =3D 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] =3D 0; @@ -473,7 +473,7 @@ ret =3D 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 =3D 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) !=3D 0 || pipe(ack_pipe_fd) !=3D 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 =3D fork(); if (updown_runner->pid =3D=3D -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, &utunn= ame_len)) { - msg(M_ERR | M_ERRNO, "Error retrieving utun interface name"); + msg(M_ERR, "Error retrieving utun interface name"); } tt->actual_name =3D string_alloc(utunname, NULL); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1517?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I14395665f197349e374a81b56f28536ff88937a8 Gerrit-Change-Number: 1517 Gerrit-PatchSet: 2 Gerrit-Owner: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --q6kBXLsbX1w= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #2 to this change.

View Change

The followi= ng approvals got outdated and were removed: Code-Review+2 by plaisthos

rework all occurrences of '=
M_ERR | M_ERRNO'

M_ERR is defined as (M_FATAL | M_ERRNO), so = 9;msg(M_ERR | M_ERRNO, ...)'
is just the same as 'msg(M_ERR, ...= )'.

The occurances in tun.c and dco_freebsd.c are really "i= f this happens,
we can not go on" errors, so 'M_ERR' (=3D F= ATAL, plus log errno string)
is the correct thing to do.

The occu= rances 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

Ch= ange-Id: I14395665f197349e374a81b56f28536ff88937a8
Signed-off-by: Gert D= oering <gert@...1296...>
Acked-by: Arne Schwabe <arne-openvpn@...220...= ..1227...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1517Message-Id: <20260211150648.113547-1-frank@...2641...>
URL: https= ://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35594.htmlSigned-off-by: Gert Doering <gert@...1296...>
---
M src/openv= pn/dco_freebsd.c
M src/openvpn/dns.c
M src/openvpn/tun.c
3 files c= hanged, 9 insertions(+), 9 deletions(-)

git pull=
 ssh://gerrit.openvpn.net:29418/openvpn refs/changes/17/1517/2
diff=
 --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c
index d1ad092..ee3a5d0 100644
--- a/src/openvpn/dco_fre= ebsd.c
+++ b/src/openvpn/dco_freebsd.c
@@ -= 177,7 +177,7 @@
ret =3D ioctl(dco->fd, SIOCSDRVSPEC= , &drv);
if (ret)
{- msg(M_ERR | M_ERRNO, &q= uot;Failed to create new peer");
+ msg(M_ERR, "Failed to create new peer")= ;
}

free(drv.if= d_data);
@@ -317,7 +317,7 @@
ret =3D i= octl(tt->dco.fd, SIOCIFDESTROY, &ifr);
if (ret)=
{
- msg(M_ERR | M_ERRNO, "Failed to remove interface %s", i= fr.ifr_name);
+ = msg(M_ERR, "Failed to remove interface %s", ifr.ifr_name);
}

tt->dco.ifname= [0] =3D 0;
@@ -473,7 +473,7 @@
ret =3D= 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 =3D ioctl(dco->fd, SIOCSDRVSPEC, &drv);
i= f (ret)
{
- msg(M_ERR | M_ERRNO, "Failed to set key");
+ msg(M_ERR, "= Failed to set key");
}
else<= /span>
{
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) !=3D 0 || pipe(ack_pipe_fd) !=3D 0)
{
-= msg(M_ERR | M_ERRNO, "run_dns_up_down: unable to create pipes&= quot;);
+ msg(= M_WARN | M_ERRNO, "run_dns_up_down: unable to create pipes");
return false;
}
= updown_runner->pid =3D fork();
if (updown_runn= er->pid =3D=3D -1)
{
- msg(M_ERR | M_ERRNO, "run_dns_up_down: = unable to fork");
- msg(M= _ERR | M_ERRNO, "could not send dns vars filename");
+ msg(M_WARN | M_E= RRNO, "could not send dns vars filename");

= }
break;
}
@@ -762,7 +762,7 @@
{<= br> continue;
}<= /span>
- 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/t= un.c
+++ b/src/openvpn/tun.c
@@ -3011,7 +30= 11,7 @@
/* Retrieve the assigned interface name. */

if (getsockopt(fd, SYSPROTO_CONTROL, UTUN_OPT_IFNAME, ut= unname, &utunname_len))
{
- msg(M_ERR | M_ERRNO, "Error retri= eving utun interface name");
+ msg(M_ERR, "Error retrieving utun interface name= ");
}

tt-&= gt;actual_name =3D string_alloc(utunname, NULL);

To view, visit change 1517. To unsubscribe, or for help writing mail = filters, visit s= ettings.

=
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I14395665f197349e374a81b56f2= 8536ff88937a8
Gerrit-Change-Number: 1517
Gerrit-PatchSet: 2
Gerrit-Owner: cron2 <gert@...1296...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --q6kBXLsbX1w=--