[Openvpn-devel] networking_iproute2: don't pass M_WARN to openvpn_execve_check()

Message ID 20220407201411.22486-1-a@unstable.cc
State Accepted
Headers show
Series [Openvpn-devel] networking_iproute2: don't pass M_WARN to openvpn_execve_check() | expand

Commit Message

Antonio Quartulli April 7, 2022, 10:14 a.m. UTC
openvpn_execve_check() expects a set of flags as third argument and not
a loglevel. For this reason, if no FATAL behaviour is expected, we
should simply pass 0. openvpn_execve_check() will then pick the
appropriate loglevel on its own.

Signed-off-by: Antonio Quartulli <a@unstable.cc>
---
 src/openvpn/networking_iproute2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Gert Doering April 7, 2022, 7:55 p.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

Good catch :-)

Your patch introduced a whitespace change on the second line.  I asked
uncrustify, uncrustify said "previous indent is correct", so only
changing the first line.

Your patch has been applied to the master and release/2.5 branch.

commit 545f6bdea30e04a09b118c4e1faf6523544fd935 (master)
commit 113b6c4192ecb927997b187de023aec71712f312 (release/2.5)
Author: Antonio Quartulli
Date:   Thu Apr 7 22:14:11 2022 +0200

     networking_iproute2: don't pass M_WARN to openvpn_execve_check()

     Signed-off-by: Antonio Quartulli <a@unstable.cc>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20220407201411.22486-1-a@unstable.cc>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg24090.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/networking_iproute2.c b/src/openvpn/networking_iproute2.c
index 3ca2bb35..02fd3cb6 100644
--- a/src/openvpn/networking_iproute2.c
+++ b/src/openvpn/networking_iproute2.c
@@ -105,8 +105,8 @@  net_addr_ll_set(openvpn_net_ctx_t *ctx, const openvpn_net_iface_t *iface,
                 iproute_path, MAC_PRINT_ARG(addr), iface);
 
     argv_msg(M_INFO, &argv);
-    if (!openvpn_execve_check(&argv, ctx->es, M_WARN,
-                              "Linux ip link set addr failed"))
+    if (!openvpn_execve_check(&argv, ctx->es, 0,
+			      "Linux ip link set addr failed"))
     {
         ret = -1;
     }