[XS] Change in openvpn[master]: dco_freebsd: don't destroy pre-existing interfaces on close

"ordex \(Code Review\) via Openvpn-devel" <[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/+/1897?usp=email

to review the following change.


Change subject: dco_freebsd: don't destroy pre-existing interfaces on close
......................................................................

dco_freebsd: don't destroy pre-existing interfaces on close

close_tun_dco() calls remove_interface() unconditionally, ignoring
tt->persistent_if. Since create_interface() stores the requested name in
tt->dco.ifname before the SIOCSIFNAME rename, on -EEXIST the destroy
targets the pre-existing interface rather than the temporary one.

Skip remove_interface() for persistent interfaces, as done on Linux.

Change-Id: I10326c787cd8149e7617279e45166073d66b9101
Signed-off-by: Antonio Quartulli <[email protected]>
---
M src/openvpn/dco_freebsd.c
1 file changed, 4 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/97/1897/1

diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c
index d933aaf..00429be 100644
--- a/src/openvpn/dco_freebsd.c
+++ b/src/openvpn/dco_freebsd.c
@@ -348,7 +348,10 @@
 void
 close_tun_dco(struct tuntap *tt, openvpn_net_ctx_t *ctx)
 {
-    remove_interface(tt);
+    if (!tt->persistent_if)
+    {
+        remove_interface(tt);
+    }
     close_fd(&tt->dco);
 }
 

-- 
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1897?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: I10326c787cd8149e7617279e45166073d66b9101
Gerrit-Change-Number: 1897
Gerrit-PatchSet: 1
Gerrit-Owner: ordex <[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.