From: "its_Giaan (Code Review)" Date: Wed, 15 Apr 2026 15:35:02 +0000 References: Reply-To: gianmarco@...2726..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <984ef4842b35f3b6be0d360aae39e10b1276157e-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="TusSvCkhrFs="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: sitnl: use RTM_SETLINK for updating existing interfaces List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --TusSvCkhrFs= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1628?usp=3Demail to review the following change. Change subject: sitnl: use RTM_SETLINK for updating existing interfaces ...................................................................... sitnl: use RTM_SETLINK for updating existing interfaces RTM_NEWLINK is primarily intended for link creation and initialization, while RTM_SETLINK is the canonical interface for modifying attributes of an already existing link. Even though the kernel may accept RTM_NEWLINK for updates, using RTM_SETLINK better reflects the intended netlink semantics and follows the dedicated update path in the kernel. This makes the behavior more explicit and consistent with how link configuration changes are expected to be performed. Change-Id: I33e55d88d561393ebfbc73a995f700056e19a436 Signed-off-by: Gianmarco De Gregori --- M src/openvpn/networking_sitnl.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/28/1628/1 diff --git a/src/openvpn/networking_sitnl.c b/src/openvpn/networking_sitnl.c index b3f8e2b..3aea076 100644 --- a/src/openvpn/networking_sitnl.c +++ b/src/openvpn/networking_sitnl.c @@ -671,7 +671,7 @@ req.n.nlmsg_len =3D NLMSG_LENGTH(sizeof(req.i)); req.n.nlmsg_flags =3D NLM_F_REQUEST; - req.n.nlmsg_type =3D RTM_NEWLINK; + req.n.nlmsg_type =3D RTM_SETLINK; req.i.ifi_family =3D AF_PACKET; req.i.ifi_index =3D ifindex; @@ -707,7 +707,7 @@ req.n.nlmsg_len =3D NLMSG_LENGTH(sizeof(req.i)); req.n.nlmsg_flags =3D NLM_F_REQUEST; - req.n.nlmsg_type =3D RTM_NEWLINK; + req.n.nlmsg_type =3D RTM_SETLINK; req.i.ifi_family =3D AF_PACKET; req.i.ifi_index =3D ifindex; @@ -738,7 +738,7 @@ req.n.nlmsg_len =3D NLMSG_LENGTH(sizeof(req.i)); req.n.nlmsg_flags =3D NLM_F_REQUEST; - req.n.nlmsg_type =3D RTM_NEWLINK; + req.n.nlmsg_type =3D RTM_SETLINK; =20 req.i.ifi_family =3D AF_PACKET; req.i.ifi_index =3D ifindex; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1628?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I33e55d88d561393ebfbc73a995f700056e19a436 Gerrit-Change-Number: 1628 Gerrit-PatchSet: 1 Gerrit-Owner: its_Giaan Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --TusSvCkhrFs= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

its_Giaan would like plaisthos to review this change.

V= iew Change

sitnl: use RTM_SETLINK for updating existin=
g interfaces

RTM_NEWLINK is primarily intended for link creation and= initialization,
while RTM_SETLINK is the canonical interface for modify= ing attributes of
an already existing link.

Even though the kerne= l may accept RTM_NEWLINK for updates, using
RTM_SETLINK better reflects = the intended netlink semantics and follows
the dedicated update path in = the kernel.

This makes the behavior more explicit and consistent wit= h how link
configuration changes are expected to be performed.

Ch= ange-Id: I33e55d88d561393ebfbc73a995f700056e19a436
Signed-off-by: Gianma= rco De Gregori <gianmarco@...2726...>
---
M src/openvpn/network= ing_sitnl.c
1 file changed, 3 insertions(+), 3 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes=
/28/1628/1
diff --git a/src/openvpn/networking_sitnl.c b/src/openvp=
n/networking_sitnl.c
index b3f8e2b..3aea076 100644--- a/src/openvpn/networking_sitnl.c
+++ b/src/open= vpn/networking_sitnl.c
@@ -671,7 +671,7 @@
=
req.n.nlmsg_len =3D NLMSG_LENGTH(sizeof(req.i));
req.n.nlmsg_flags =3D NLM_F_REQUEST;
- req.n.nlmsg_type =3D RTM_NEWLINK;
+ req.n.nlmsg_type =3D= RTM_SETLINK;

req.i.ifi_family =3D A= F_PACKET;
req.i.ifi_index =3D ifindex;
@@ -707,7 +707,7 @@


req.n.nlmsg_len= =3D NLMSG_LENGTH(sizeof(req.i));
req.n.nlmsg_flags = =3D NLM_F_REQUEST;
- = req.n.nlmsg_type =3D RTM_NEWLINK;
+ req.n.nlmsg_type =3D RTM_SETLINK;

req.i.ifi_family =3D AF_PACKET;
req.i= .ifi_index =3D ifindex;
@@ -738,7 +738,7 @@

req.n.nlmsg_len =3D NLMSG_LENGTH(sizeof(req.i));
req.n.nlmsg_flags =3D NLM_F_REQUEST;
- req.n.nlmsg_type =3D RTM_NEWLINK;
+ req.n.nlmsg_type = =3D RTM_SETLINK;

req.i.ifi_family = =3D AF_PACKET;
req.i.ifi_index =3D ifindex;
=

To view, visit change 1628. To unsubscribe, or for he= lp writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I33e55d88d561393ebfbc73a995f= 700056e19a436
Gerrit-Change-Number: 1628
Gerrit-PatchSet: 1
Gerrit-Owner: its_Giaan <gianmarco@...2786...= ..>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --TusSvCkhrFs=--