[XS] Change in openvpn[master]: sitnl: use RTM_SETLINK for updating existing interfaces

"its_Giaan (Code Review)" <[email protected]>
Newsgroups gmane.network.openvpn.devel
Message-ID <[email protected]>
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=email

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 <[email protected]>
---
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 = NLMSG_LENGTH(sizeof(req.i));
     req.n.nlmsg_flags = NLM_F_REQUEST;
-    req.n.nlmsg_type = RTM_NEWLINK;
+    req.n.nlmsg_type = RTM_SETLINK;
 
     req.i.ifi_family = AF_PACKET;
     req.i.ifi_index = ifindex;
@@ -707,7 +707,7 @@
 
     req.n.nlmsg_len = NLMSG_LENGTH(sizeof(req.i));
     req.n.nlmsg_flags = NLM_F_REQUEST;
-    req.n.nlmsg_type = RTM_NEWLINK;
+    req.n.nlmsg_type = RTM_SETLINK;
 
     req.i.ifi_family = AF_PACKET;
     req.i.ifi_index = ifindex;
@@ -738,7 +738,7 @@
 
     req.n.nlmsg_len = NLMSG_LENGTH(sizeof(req.i));
     req.n.nlmsg_flags = NLM_F_REQUEST;
-    req.n.nlmsg_type = RTM_NEWLINK;
+    req.n.nlmsg_type = RTM_SETLINK;
 
     req.i.ifi_family = AF_PACKET;
     req.i.ifi_index = ifindex;

-- 
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1628?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I33e55d88d561393ebfbc73a995f700056e19a436
Gerrit-Change-Number: 1628
Gerrit-PatchSet: 1
Gerrit-Owner: its_Giaan <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.