OSDN Git Service

Treat RTM_DELNEIGH as a transition to NUD_NONE
authorErik Kline <ek@google.com>
Mon, 1 Jun 2015 03:44:01 +0000 (12:44 +0900)
committerErik Kline <ek@google.com>
Mon, 1 Jun 2015 03:46:24 +0000 (12:46 +0900)
RTM_DELNEIGHs can happen naturally during garbage collection of STALE
entries, as well as when an interface is going down.  All other
transitions of interest at this time pass through FAILED.

Bug: 18581716
Bug: 21531726
Change-Id: Ib2a731dd6ad6ece478df6950d4cc7752588328a4

core/java/android/net/IpReachabilityMonitor.java

index 78d147d..3cfd8b2 100644 (file)
@@ -443,14 +443,13 @@ public class IpReachabilityMonitor {
                 if (mIpWatchList.containsKey(destination)) {
                     final short value =
                             (msgType == NetlinkConstants.RTM_DELNEIGH)
-                            ? StructNdMsg.NUD_FAILED
+                            ? StructNdMsg.NUD_NONE
                             : nudState;
                     mIpWatchList.put(destination, value);
                 }
             }
 
-            if ((msgType == NetlinkConstants.RTM_DELNEIGH) ||
-                (nudState == StructNdMsg.NUD_FAILED)) {
+            if (nudState == StructNdMsg.NUD_FAILED) {
                 Log.w(TAG, "ALERT: " + eventMsg);
                 handleNeighborLost(eventMsg);
             }