[Openvpn-devel,v1] Fix oversight of link socket code change in Android code path

Message ID 20250212123820.19099-1-gert@greenie.muc.de
State Accepted
Headers show
Series [Openvpn-devel,v1] Fix oversight of link socket code change in Android code path | expand

Commit Message

Gert Doering Feb. 12, 2025, 12:38 p.m. UTC
From: Arne Schwabe <arne@rfc2549.org>

Commit 94b391d7ef5 changed context->link_socket to context->link_sockets
but did not change the Android code path.

Change-Id: If6a636b2099d948e249cf92ed2ba91d1698ee42f
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
---

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/+/888
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <gert@greenie.muc.de>

Comments

Gert Doering Feb. 12, 2025, 1:03 p.m. UTC | #1
Another one of those that we should have seen... sorry for that.

(I have not tested this, but it's inside #ifdef TARGET_ANDROID and
looks like the correct adjustment, so if Arne says "this makes it work" 
it's good enough for me)

Your patch has been applied to the master branch.

commit 3ddfe26e491f9d74da54feb981116f7b8ef19a70
Author: Arne Schwabe
Date:   Wed Feb 12 13:38:20 2025 +0100

     Fix oversight of link socket code change in Android code path

     Signed-off-by: Arne Schwabe <arne@rfc2549.org>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <20250212123820.19099-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg30833.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/init.c b/src/openvpn/init.c
index 4014517..a7f7db4 100644
--- a/src/openvpn/init.c
+++ b/src/openvpn/init.c
@@ -4381,16 +4381,16 @@ 
 
     int socketfd = -1;
     struct context *c = (struct context *) arg;
-    if (!c->c2.link_socket)
+    if (!c->c2.link_sockets || !c->c2.link_sockets[0])
     {
         return -1;
     }
-    if (c->c2.link_socket->sd == SOCKET_UNDEFINED)
+    if (c->c2.link_sockets[0]->sd == SOCKET_UNDEFINED)
     {
         return -1;
     }
 
-    socketfd = c->c2.link_socket->sd;
+    socketfd = c->c2.link_sockets[0]->sd;
     if (!c->options.pull || c->c2.tls_multi->use_peer_id || samenetwork)
     {
         return socketfd;