From: "cron2 (Code Review)" Date: Sat, 28 Feb 2026 09:38:41 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, antonio@...2726... Message-ID: <3f9d7aa9998dad965c1c2d28e4a1851335fc8365-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="sH4htSD82jI="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: dco_freebsd: use AF_LOCAL sockets for ioctl() communication with DCO ... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --sH4htSD82jI= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello ordex, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1551?usp=3Demail to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review+2 by ordex Change subject: dco_freebsd: use AF_LOCAL sockets for ioctl() communication= with DCO driver ...................................................................... dco_freebsd: use AF_LOCAL sockets for ioctl() communication with DCO driver DCO FreeBSD uses ioctl() calls for userland -> driver communication, on a socket() file descriptor. The original code uses AF_INET sockets, which fails if using a kernel compiled without IPv4 support. The kernel side ioctl() handling does not differentiate between AF_INET, AF_INET6 and AF_LOCAL sockets, and only the latter are guaranteed to be present. While add it, add a clear message if the socket() call in dco_available() fails (it will lead to disabling of DCO). FreeBSD PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D286263 Reported-by: Marek Zarychta Change-Id: I84fe7a11391eafde3660d25a3c99094a0c525f3d Signed-off-by: Gert Doering Acked-by: Antonio Quartulli Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1551 Message-Id: <20260227224745.3175-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 795.html Signed-off-by: Gert Doering --- M src/openvpn/dco_freebsd.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/51/1551/2 diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c index ee3a5d0..718cd8b 100644 --- a/src/openvpn/dco_freebsd.c +++ b/src/openvpn/dco_freebsd.c @@ -205,7 +205,7 @@ return -1; } - dco->fd =3D socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0); + dco->fd =3D socket(AF_LOCAL, SOCK_DGRAM | SOCK_CLOEXEC, 0); if (dco->fd !=3D -1) { dco->open =3D true; @@ -715,9 +715,10 @@ * loaded, or built into the kernel. */ (void)kldload("if_ovpn"); - fd =3D socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0); + fd =3D socket(AF_LOCAL, SOCK_DGRAM | SOCK_CLOEXEC, 0); if (fd < 0) { + msg(M_WARN | M_ERRNO, "%s: socket() failed, disabling data channel= offload", __func__); return false; } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1551?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: I84fe7a11391eafde3660d25a3c99094a0c525f3d Gerrit-Change-Number: 1551 Gerrit-PatchSet: 2 Gerrit-Owner: cron2 Gerrit-Reviewer: ordex Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --sH4htSD82jI= 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 ordex

dco_freebsd: use AF_LOCAL sockets f=
or ioctl() communication with DCO driver

DCO FreeBSD uses ioctl() ca= lls for userland -> driver communication, on
a socket() file descript= or. The original code uses AF_INET sockets,
which fails if using a kern= el compiled without IPv4 support.

The kernel side ioctl() handling d= oes not differentiate between AF_INET,
AF_INET6 and AF_LOCAL sockets, an= d only the latter are guaranteed to be
present.

While add it, add= a clear message if the socket() call in dco_available()
fails (it will = lead to disabling of DCO).

FreeBSD PR: https://bugs.freebsd.org/bugz= illa/show_bug.cgi?id=3D286263
Reported-by: Marek Zarychta <zarychtam@= ...2997...>

Change-Id: I84fe7a11391eafde3660d25a3c99094a0c525f3d<= br>Signed-off-by: Gert Doering <gert@...1296...>
Acked-by: Antonio= Quartulli <antonio@...2726...>
Gerrit URL: https://gerrit.openvpn= .net/c/openvpn/+/1551
Message-Id: <20260227224745.3175-1-gert@...1726...= ...>
URL: https://www.mail-archive.com/openvpn-devel@...1483...= e.net/msg35795.html
Signed-off-by: Gert Doering <gert@...1296...><= br>---
M src/openvpn/dco_freebsd.c
1 file changed, 3 insertions(+), 2= deletions(-)

git pull ssh://gerrit.openvpn.net:=
29418/openvpn refs/changes/51/1551/2
diff --git a/src/openvpn/dco_f=
reebsd.c b/src/openvpn/dco_freebsd.c
index ee3a5d0..718cd8b= 100644
--- a/src/openvpn/dco_freebsd.c
+++= b/src/openvpn/dco_freebsd.c
@@ -205,7 +205,7 @@
= return -1;
}
- dco->fd =3D socket(AF_I= NET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
+ dco->fd =3D socket(AF_LOCAL, SOCK_DGRAM | SOCK_CLOEX= EC, 0);
if (dco->fd !=3D -1)
{=
dco->open =3D true;
@@ -715,9 = +715,10 @@
* loaded, or built into the kernel. */
(void)kldload("if_ovpn");

- fd =3D socket(AF_INET= , SOCK_DGRAM | SOCK_CLOEXEC, 0);
+ fd =3D socket(AF_LOCAL, SOCK_DGRAM | SOCK_CLOEXEC, 0);
if (fd < 0)
{
+ msg(M_WARN | M_ERRNO, "%s:= socket() failed, disabling data channel offload", __func__); return false;
}


To view, visit change 1551. To unsubscribe, or= for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I84fe7a11391eafde3660d25a3c9= 9094a0c525f3d
Gerrit-Change-Number: 1551
Gerrit-PatchSet: 2
Gerrit-Owner: cron2 <gert@...1296...>
Gerrit-Reviewer: ordex <antonio@...2726...&= gt;
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --sH4htSD82jI=--