Skip to contentSkip to conversation

dco-linux: remove M_ERRNO flag when printing netlink error message

PATCH In review Antonio Quartulli 2 participants 2 messages Mar 20, 2023 – Mar 21, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dco-linux: remove M_ERRNO flag when printing netlink error message

Netlink has its own error space and reports errors via the return value of its functions.

For this reason remove the M_ERRNO flag when printing its errors. At the moment we get something like this:

netlink reports error (-7): Invalid input data or parameter: Interrupted system call (errno=4)

where the errno=4 (and its human readable representation) is a leftover from the previous recv() interrupted by a signal and it is totally unrelated to this netlink failure.

---
 src/openvpn/dco_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/dco_linux.c +1 -1
index 98b2aae3..0e479beb 100644
@@ -154,7 +154,7 @@ ovpn_nl_recvmsgs(dco_context_t *dco, const char *prefix)
         default:
             if (ret)
             {
-                msg(M_NONFATAL|M_ERRNO, "%s: netlink reports error (%d): %s", prefix, ret, nl_geterror(-ret));
+                msg(M_NONFATAL, "%s: netlink reports error (%d): %s", prefix, ret, nl_geterror(-ret));
             }
             break;
     }
Signature · 1 line
2.39.2
Acked-by on v1 1/1
#1 lore raw

"Trivially correct" :-) - compile-tested on a DCO enabled linux.

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

commit 23903fd579353c9892415a750f17a9832a79cced (master) commit 047f772b84843344b6131e9e915472d14adcea2b (release/2.6)

Author: Antonio Quartulli
Date:   Mon Mar 20 20:58:20 2023 +0100
     dco-linux: remove M_ERRNO flag when printing netlink error message

     Signed-off-by: Antonio Quartulli <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg26452.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering