From 211c06eb811c2a24b2317da1db17ba54ae45dc7b Mon Sep 17 00:00:00 2001 From: Sreeram Ramachandran Date: Wed, 11 Jun 2014 15:56:51 -0700 Subject: [PATCH] Fix wifi connectivity issues. http://ag/480881 changed RouteInfo.getDestination() to return an IpPrefix instead of a LinkAddress. This makes the equals() comparison always fail. So, when ConnectivityService.updateRoutes() is given identical routes, instead of realizing that there's no diff, it would consider them different, and thus add and remove the same route. The add would fail, since the route already existed in netd, but the remove would succeed, leaving the system with no routes and thus no connectivity. Bug: 15564210 Change-Id: I2003b0fcb809cc20837dc489c58af37891ca4556 --- core/java/android/net/RouteInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/net/RouteInfo.java b/core/java/android/net/RouteInfo.java index af27e1ddd17b5..8b42bcd5cb6e4 100644 --- a/core/java/android/net/RouteInfo.java +++ b/core/java/android/net/RouteInfo.java @@ -361,7 +361,7 @@ public class RouteInfo implements Parcelable { RouteInfo target = (RouteInfo) obj; - return Objects.equals(mDestination, target.getDestination()) && + return Objects.equals(mDestination, target.getDestinationLinkAddress()) && Objects.equals(mGateway, target.getGateway()) && Objects.equals(mInterface, target.getInterface()); }