Skip to contentSkip to conversation

Do not install a host route for the VPN on Android

PATCH Superseded Arne Schwabe 2 participants 3 messages Sep 17, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Do not install a host route for the VPN on Android

Routing loops are avoided using the VPNService API protect API

---
 src/openvpn/route.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
src/openvpn/route.c +6 -1
index 3959abd..0142c58 100644
@@ -768,6 +768,10 @@ init_route_ipv6_list (struct route_ipv6_list *rl6,
             r6->next = rl6->routes_ipv6;
             rl6->routes_ipv6 = r6;
 
+#ifndef TARGET_ANDROID
+	    /* On Android the VPNService protect function call will take of
+	       avoiding routing loops, so ignore this part and let
+	       remote_host_ipv6 always evaluate to false */
 	    if ( remote_host_ipv6 &&
 		  route_ipv6_match_host( r6, remote_host_ipv6 ) )
 	      {
@@ -776,7 +780,8 @@ init_route_ipv6_list (struct route_ipv6_list *rl6,
 			print_in6_addr (r6->network, 0, &gc), r6->netbits,
 			print_in6_addr (*remote_host_ipv6, 0, &gc));
 	      }
-          }
+#endif
+	  }
       }
   }
 
Signature · 1 line
2.3.2 (Apple Git-55)
#1 lore raw

PATCH v3 1/1 Do not install a host route for the VPN on Android

Routing loops are avoided using the VPNService API protect API

---
 src/openvpn/route.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
src/openvpn/route.c +6 -1
index 3959abd..0142c58 100644
@@ -768,6 +768,10 @@ init_route_ipv6_list (struct route_ipv6_list *rl6,
             r6->next = rl6->routes_ipv6;
             rl6->routes_ipv6 = r6;
 
+#ifndef TARGET_ANDROID
+	    /* On Android the VPNService protect function call will take of
+	       avoiding routing loops, so ignore this part and let
+	       remote_host_ipv6 always evaluate to false */
 	    if ( remote_host_ipv6 &&
 		  route_ipv6_match_host( r6, remote_host_ipv6 ) )
 	      {
@@ -776,7 +780,8 @@ init_route_ipv6_list (struct route_ipv6_list *rl6,
 			print_in6_addr (r6->network, 0, &gc), r6->netbits,
 			print_in6_addr (*remote_host_ipv6, 0, &gc));
 	      }
-          }
+#endif
+	  }
       }
   }
 
Signature · 1 line
2.3.2 (Apple Git-55)
#2 lore raw

ACK (as expected - since this code will not do useful things on Android, just #ifndef it away)

Your patch has been applied to the master branch.

commit 1ff39cff4e644103607f0266cd4666dab18716c5

Author: Arne Schwabe
Date:   Thu Sep 17 12:23:58 2015 +0200
     Do not install a host route for the VPN on Android

     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: http://article.gmane.org/gmane.network.openvpn.devel/10135
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering