Allow 0.0.0.0 and :: as default gateways
Lorenzo Colitti [Tue, 26 Mar 2013 03:47:49 +0000 (12:47 +0900)]
On point-to-point interfaces, some RILs return the unspecified
address (0.0.0.0 or ::) as the gateway. This is correct, as
routes pointing at point-to-point interfaces don't need
gateways. Currently, telephony ignores these routes, causing
loss of connectivity (for example, when using an IPv6 APN on
Galaxy Nexus). Allow these routes to be set.

Bug: 8475171
Bug: 8276725
Change-Id: I3a770628c9717bb6e451a523417401b56ba55763

src/java/com/android/internal/telephony/dataconnection/DataCallResponse.java

index ca9624c..024f04e 100644 (file)
@@ -211,9 +211,8 @@ public class DataCallResponse {
                     } catch (IllegalArgumentException e) {
                         throw new UnknownHostException("Non-numeric gateway addr=" + addr);
                     }
-                    if (! ia.isAnyLocalAddress()) {
-                        linkProperties.addRoute(new RouteInfo(ia));
-                    }
+                    // Allow 0.0.0.0 or :: as a gateway; this indicates a point-to-point interface.
+                    linkProperties.addRoute(new RouteInfo(ia));
                 }
 
                 result = SetupResult.SUCCESS;