From: "ordex (Code Review)" Date: Fri, 6 Jun 2025 12:28:21 +0000 References: Reply-To: antonio@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="fsjmCOn4jNk="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: dco_linux: enable extended netlink error reporting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --fsjmCOn4jNk= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1040?usp=3Demail to review the following change. Change subject: dco_linux: enable extended netlink error reporting ...................................................................... dco_linux: enable extended netlink error reporting The ovpn netlink code reports more verbose error strings to help userspace understand what went wrong, rather than just returning, for example, -EINVAL. However, userspace must instruct the kernel netlink subsystem that it wants to receive such strings. code for parsing such strings has always been present but it was never used. Set the socket option which enables such reporting. Change-Id: I4457b1d7262e0a39c275d33aaef6c4bcbeae6ab3 Signed-off-by: Antonio Quartulli --- M src/openvpn/dco_linux.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/40/1040/1 diff --git a/src/openvpn/dco_linux.c b/src/openvpn/dco_linux.c index 49dbdad..fcca9dc 100644 --- a/src/openvpn/dco_linux.c +++ b/src/openvpn/dco_linux.c @@ -405,6 +405,11 @@ nl_geterror(ret)); } + /* enable Extended ACK for detailed error reporting */ + ret =3D 1; + setsockopt(nl_socket_get_fd(dco->nl_sock), SOL_NETLINK, NETLINK_EXT_AC= K, + &ret, sizeof(ret)); + /* set close on exec and non-block on the netlink socket */ set_cloexec(nl_socket_get_fd(dco->nl_sock)); set_nonblock(nl_socket_get_fd(dco->nl_sock)); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1040?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I4457b1d7262e0a39c275d33aaef6c4bcbeae6ab3 Gerrit-Change-Number: 1040 Gerrit-PatchSet: 1 Gerrit-Owner: ordex Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-MessageType: newchange --fsjmCOn4jNk= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

ordex would like plaisthos and flichtenheld to review t= his change.

V= iew Change

dco_linux: enable extended netlink error reporting

Th= e ovpn netlink code reports more verbose error
strings to help userspace= understand what went wrong,
rather than just returning, for example, -E= INVAL.

However, userspace must instruct the kernel netlink
subsys= tem that it wants to receive such strings.

code for parsing such str= ings has always been present
but it was never used.

Set the socke= t option which enables such reporting.

Change-Id: I4457b1d7262e0a39c= 275d33aaef6c4bcbeae6ab3
Signed-off-by: Antonio Quartulli <antonio@...493...= 2726...>
---
M src/openvpn/dco_linux.c
1 file changed, 5 insert= ions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/o=
penvpn refs/changes/40/1040/1
diff --git a/src/openvpn/dco_linux.c =
b/src/openvpn/dco_linux.c
index 49dbdad..fcca9dc 100644
--- a/src/openvpn/dco_linux.c
+++ b/src/openvp= n/dco_linux.c
@@ -405,6 +405,11 @@
= nl_geterror(ret));
}

= + /* enable Extended ACK for= detailed error reporting */
+ ret =3D 1;
+ setsockopt(nl_socket_get_fd(dco->nl_sock), SOL_NETLINK, NETLINK_= EXT_ACK,
+ = &ret, sizeof(ret));
+
/* set close on exec and non-block on the net= link socket */
set_cloexec(nl_socket_get_fd(dco->nl= _sock));
set_nonblock(nl_socket_get_fd(dco->nl_sock= ));

To view, visit change 1040. To unsubscr= ibe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I4457b1d7262e0a39c275d33aaef= 6c4bcbeae6ab3
Gerrit-Change-Number: 1040
Gerrit-PatchSet: 1
Gerrit-Owner: ordex <antonio@...2726...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newchange
--fsjmCOn4jNk=--