From: "flichtenheld (Code Review)" Date: Thu, 19 Mar 2026 12:30:40 +0000 In-Reply-To: References: Reply-To: frank@...2641..., arne-openvpn@...1227..., gianmarco@...2726..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="gc2Qn1Tn42E="; 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 --gc2Qn1Tn42E= 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 6: Code-Review-1 (6 comments) Patchset: PS6: Mostly done with obvious problems. Doing some testing now and noted some th= ings about the actual behavior. Note that these are not necessarily objecti= ve problems but more my opinion of how I would expect it to work. So let me= know what you think =F0=9F=98=8A File src/openvpn/networking.h: http://gerrit.openvpn.net/c/openvpn/+/1521/comment/a54ba7ff_66357771?usp=3D= email : PS6, Line 42: /* Only the iproute2 backend implements these functions, This comment is outdated File src/openvpn/networking_sitnl.h: http://gerrit.openvpn.net/c/openvpn/+/1521/comment/8c83021c_80e04de6?usp=3D= email : PS6, Line 113: * (/var/run/netns). `/run/netns` File src/openvpn/networking_sitnl.c: http://gerrit.openvpn.net/c/openvpn/+/1521/comment/bd778cd2_164b398c?usp=3D= email : PS6, Line 207: return -1; Note that this return value is meaningless since no code ever checks it. I = would suggest that a non-existent namespace should be a fatal error? File src/openvpn/tun.c: http://gerrit.openvpn.net/c/openvpn/+/1521/comment/2eb2828a_8a3cf902?usp=3D= email : PS6, Line 2185: int ret =3D net_iface_move_netns(ifr.ifr_name, = ctx->netns); One interesting problem I encountered is that the usual way of auto-naming = tun devices doesn't really work with --netns. Since the device is created i= n a different namespace it can't know whether there is already a device wit= h the same name in the target namespace. Not sure whether we can work around this? If not, maybe we should document = this? Might be a niche use-case (outside of testing). http://gerrit.openvpn.net/c/openvpn/+/1521/comment/3b67e7d2_771ff340?usp=3D= email : PS6, Line 2188: msg(M_WARN | M_ERRNO, "Note: Cannot move de= v %s to network namespace %s", ifr.ifr_name, ctx->netns); I would go for M_ERR here. I would consider this a fatal error. -- 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: 6 Gerrit-Owner: its_Giaan Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: its_Giaan Gerrit-Comment-Date: Thu, 19 Mar 2026 12:30:40 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes --gc2Qn1Tn42E= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: its_Giaan, plaisthos.

Patch set 6:Code-Review -1=

V= iew Change

6 comments:

  • Patchset:

    • Patch Set #6:

      Mostly don= e with obvious problems. Doing some testing now and noted some things about= the actual behavior. Note that these are not necessarily objective problem= s but more my opinion of how I would expect it to work. So let me know what= you think =F0=9F=98=8A

  • File src/openvpn/networking.h:

  • File src/openvpn/networking_sitnl.h:

  • Patch Set #= 6, Line 113: * (/var/r= un/netns).

    `/run/netns`

  • File src/openvpn/networking_sitnl.c:

  • File src/openv= pn/tun.c:

    • Patch Set #6, Line 2185: int ret =3D net_iface_move_netns(ifr.ifr_name, ctx->ne= tns);

      One interesting problem I encountered is that the usual wa= y of auto-naming tun devices doesn't really work with --netns. Since th= e device is created in a different namespace it can't know whether ther= e is already a device with the same name in the target namespace.

      Not s= ure whether we can work around this? If not, maybe we should document this?= Might be a niche use-case (outside of testing).

    • Patch Set #6, Line 2188: msg(M_WARN | M_ERRNO, "Note: Cannot move dev %s = to network namespace %s", ifr.ifr_name, ctx->netns);

      I w= ould go for M_ERR here. I would consider this a fatal error.

    <= /li>

    To view, visit change 1521. To unsubscribe, or for help writing mai= l filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: openvpn
    Gerrit-Branch: master
    Gerrit-Change-Id: I8b0d1cad7062856abcc40c4e16e= c93b45295bbd3
    Gerrit-Change-Number: 1521
    Gerrit-PatchSet: 6
    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: Thu, 19 Mar 2026 12:30:40= +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    = --gc2Qn1Tn42E=--