From: "flichtenheld (Code Review)"
Date: Mon, 16 Feb 2026 12:10:39 +0000
In-Reply-To:
References:
Reply-To: frank@...2641..., arne-openvpn@...1227...,
gianmarco@...2726..., openvpn-devel@lists.sourceforge.net
Message-ID: <27618e66e3b42fee5dcff84d729fb42784440ef6-EmailReviewComments-HTML@...2715...>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
Content-Type: multipart/alternative; boundary="/LRwqUKqjZ8="; charset=UTF-8
Subject: [Openvpn-devel] [L] Change in openvpn[master]: Add support for user
defined network namespace
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
To: its_Giaan
Cc: plaisthos , openvpn-devel
--/LRwqUKqjZ8=
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is currently required from: its_Giaan, plaisthos.
flichtenheld has posted comments on this change by its_Giaan. ( http://gerr=
it.openvpn.net/c/openvpn/+/1521?usp=3Demail )
Change subject: Add support for user defined network namespace
......................................................................
Patch Set 1: Code-Review-2
(26 comments)
Patchset:
PS1:
I stopped reviewing at some point. Enough to fix for now
File src/openvpn/dco.c:
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/f5b745f0_c74ba00a?usp=3D=
email :
PS1, Line 394: msg(msglevel, "Note: --netns not supported by ovpn-d=
co, disabling data channel offload.");
`ovpn` ? Or just "DCO"?
File src/openvpn/networking_sitnl.h:
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/fa0e61b1_09e3ce72?usp=3D=
email :
PS1, Line 52: * NETNS_RUN_DIR, e.g. /var/run/netns/).
Doxygen says `networking_sitnl.h:52: warning: Unsupported xml/html tag found`
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/1e561559_8521c63f?usp=3D=
email :
PS1, Line 98: int openvpn_if_nametoindex(const char *ifname, int netnsid);
This is ALWAYS called with `get_or_create_netnsid_sitnl`, so just move all =
of that code inside and change the signature.
File src/openvpn/networking_sitnl.c:
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/97ff67c1_781261b5?usp=3D=
email :
PS1, Line 74: #define NETNS_RUN_DIR "/var/run/netns"
Wouldn't `/run` be a better value here? `/var/run` is just a symlink nowada=
ys AFAIK
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/289f0216_601a33c5?usp=3D=
email :
PS1, Line 206: msg(M_WARN, "%s: Network namespace %s does not e=
xist\n", __func__, path);
M_ERRNO?
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/d1511ce1_4a61a209?usp=3D=
email :
PS1, Line 239: msg(M_WARN, "%s: Cannot open original network namesp=
ace\n", __func__);
M_ERRNO?
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/db2ee770_077ea5de?usp=3D=
email :
PS1, Line 247: msg(M_WARN, "%s: Cannot open network namespace \"%s\=
"\n", __func__, name);
M_ERRNO
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/60e6c6bb_45c54b89?usp=3D=
email :
PS1, Line 254: msg(M_WARN, "%s: setting the network namespace \"%s\=
" failed\n", __func__, name);
M_ERRNO
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/5e711262_50c89506?usp=3D=
email :
PS1, Line 272: msg(M_WARN, "%s: Cannot restore original network nam=
espace\n", __func__);
M_ERRNO
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/15d5672a_5f164ecd?usp=3D=
email :
PS1, Line 635: goto err;
just use return
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/e3edca05_87e906c4?usp=3D=
email :
PS1, Line 841: goto err;
M_ERR is fatal
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/5ed22de4_b4c7950e?usp=3D=
email :
PS1, Line 848: goto err;
M_ERR is fatal
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/7cb5d904_f6b98d2c?usp=3D=
email :
PS1, Line 914: if (netns)
These 4 lines (counting the netns assignment) are copied often enough that =
they should be moved to a function or macro.
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/48e4eb65_4e5b7e66?usp=3D=
email :
PS1, Line 928: msg(M_WARN, "%s: rtnl: cannot get ifindex for %s: %s=
", __func__, iface, strerror(errno));
Should use M_ERRNO instead of manually using strerror
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/e1d31283_33bdeb60?usp=3D=
email :
PS1, Line 950: ret =3D sitnl_send(&req.n, 0, 0, NULL, NULL);
Just declare ret here. C has moved on...
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/f52dde96_e5b369fd?usp=3D=
email :
PS1, Line 953: goto err;
Just use return
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/e4633213_a3d2a888?usp=3D=
email :
PS1, Line 955: if (orig >=3D 0)
Also move to function or macro
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/3706333e_7b657959?usp=3D=
email :
PS1, Line 1002: err:
Unused label?
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/a2a79f77_a7e3716c?usp=3D=
email :
PS1, Line 1019:
spurious empty line
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/99000be3_9e6be45b?usp=3D=
email :
PS1, Line 1064:
spurious empty line
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/7c543e33_d1045522?usp=3D=
email :
PS1, Line 1124: err:
Unused label
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/a9d4fe8c_8da527ff?usp=3D=
email :
PS1, Line 1833: goto err;
WHAT?
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/57c51c0b_69ab4bb4?usp=3D=
email :
PS1, Line 1881: goto err;
lol
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/09b54618_34113780?usp=3D=
email :
PS1, Line 1903: return netnsid;
Hmm, why does clang-format not fix this?
File src/openvpn/options.c:
http://gerrit.openvpn.net/c/openvpn/+/1521/comment/cbd845cd_a862dec9?usp=3D=
email :
PS1, Line 6476: #if defined(TARGET_LINUX)
The documentation says it is a no-op on non-Linux, but as you implemented i=
t is an error I think?
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1521?usp=3Demail
To unsubscribe, or for help writing mail filters, visit http://gerrit.openv=
pn.net/settings?usp=3Demail
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8b0d1cad7062856abcc40c4e16ec93b45295bbd3
Gerrit-Change-Number: 1521
Gerrit-PatchSet: 1
Gerrit-Owner: its_Giaan
Gerrit-Reviewer: flichtenheld
Gerrit-Reviewer: plaisthos
Gerrit-CC: openvpn-devel
Gerrit-Attention: plaisthos
Gerrit-Attention: its_Giaan
Gerrit-Comment-Date: Mon, 16 Feb 2026 12:10:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
--/LRwqUKqjZ8=
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Attention is cur=
rently required from: its_Giaan, plaisthos.
Patch set 1:Code-Review -2=
V=
iew Change
26 comments:
I stopp=
ed reviewing at some point. Enough to fix for now
File src/openvpn/dco.c:
<=
li style=3D"margin: 0; padding: 0;">File src/openvpn/networking_sitnl.h:=
Patch=
Set #1, Line 52: * =
NETNS_RUN_DIR, e.g. /var/run/netns/<name>).
Dox=
ygen says `networking_sitnl.h:52: warning: Unsupported xml/html tag <nam=
e> found`
Patch Set #1, Line 98: int openvpn_if_nametoindex(const=
char *ifname, int netnsid);
This is ALWAYS called with `get_or_=
create_netnsid_sitnl`, so just move all of that code inside and change the =
signature.
File s=
rc/openvpn/networking_sitnl.c:
Patch Set #1, Line 74: #define NETNS_RUN_DIR "/var/run/netns"<=
/code>
Wouldn't `/run` be a better value here? `/var/run` is just a=
symlink nowadays AFAIK
Patch Set #1, Line 20=
6: msg(M_WA=
RN, "%s: Network namespace %s does not exist\n", __func__, path);=
M_ERRNO?
- =
Patch Set #1, Line 239:<=
/a> msg(M_WARN, &qu=
ot;%s: Cannot open original network namespace\n", __func__);
M_ERRNO?
Patch Set #1, Line 247: msg(M_WARN, "%s: C=
annot open network namespace \"%s\"\n", __func__, name);
M_ERRNO
Patch Set #1, Line 254: <=
code style=3D"font-family:monospace,monospace"> msg(M_WARN, "%s=
: setting the network namespace \"%s\" failed\n", __func__, =
name);
M_ERRNO
Patch Set #1, Line =
272: msg(M_WARN=
, "%s: Cannot restore original network namespace\n", __func__);=
code>
M_ERRNO
Patch Set #1, Line 635:=
goto err;=
p>
just use return
Patch Set #1, Line 841: goto err;<=
/p>
M_ERR is fatal
Patch Set #1, Line 848: goto err;<=
/p>
M_ERR is fatal
Patch Set #1, Line 914: if (netns)
=
These 4 lines (counting the netns assignment) are copied often enough that=
they should be moved to a function or macro.
Patch Set #1, Line 928: msg(M_WARN, "%s: rtnl: cannot get ifindex for %s: %s", =
__func__, iface, strerror(errno));
Should use M_ERRNO instead of=
manually using strerror
Patch Set #1, Line 9=
50: ret =3D sitnl_s=
end(&req.n, 0, 0, NULL, NULL);
Just declare ret here. C has =
moved on...
Patch Set #1, Line 953: goto err;
Ju=
st use return
Patch Set #1, Line 955: if (orig >=3D 0)=
Also move to function or macro
Patch Set=
#1, Line 1002: err:
Unused label?
Patch Set #1, Line 101=
9:
spuriou=
s empty line
Patch Set #1, Line 1064:
spurious empty lin=
e
Patch Set #1, Line 1124: err:
Unused label
Patch Set #1, Line 1833: goto err;
WHAT?
Patch Set #1, Line 1881: goto err;
lol
Patch Set #1, Line 1903: return netnsid;
Hmm, why does clang-format not fix =
this?
File src/op=
envpn/options.c:
Patch Set #1, Line 6476: #if defined(TARGET_LINUX)
The documentation says =
it is a no-op on non-Linux, but as you implemented it is an error I think?<=
/p>
To view, visit change 1521. To unsubscribe, or for he=
lp writing mail filters, visit settings.
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8b0d1cad7062856abcc40c4e16e=
c93b45295bbd3
Gerrit-Change-Number: 1521
Gerrit-PatchSet: 1
Gerrit-Owner: its_Giaan <gianmarco@...2786...=
..>
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: its_Giaan <gianmarco@...1665...=
726...>
Gerrit-Comment-Date: Mon, 16 Feb 2026 12:10:39=
+0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
=
--/LRwqUKqjZ8=--