From: Gianmarco De Gregori <[email protected]>

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]>
Acked-by: Arne Schwabe <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1628
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1628
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Arne Schwabe <[email protected]>

        
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;


_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to