ArpHandler to ignore ip packet sent to default GW 25/4125/1
authorAlessandro Boch <aboch@cisco.com>
Fri, 10 Jan 2014 04:22:52 +0000 (20:22 -0800)
committerAlessandro Boch <aboch@cisco.com>
Fri, 10 Jan 2014 04:22:52 +0000 (20:22 -0800)
- If the host pings the default gw, when ArpHandler receives the
  ICMP packet it does not realize it is sent to the controller,
  and it triggers the discovery for an host with that IP through arp request
- This patch is for ArpHandler to detect the if IP packet is sent
  to the controller and stop the processing if that is the case.
  We may consider to have ArpHandler reply if packet is ICMP echo req.

Change-Id: I87e14916564bc0039718882d087c431df7554317
Signed-off-by: Alessandro Boch <aboch@cisco.com>
opendaylight/arphandler/src/main/java/org/opendaylight/controller/arphandler/internal/ArpHandler.java

index 8c91c71533a19282c9f1c48e8697dd3f81d181ee..8ae038c30f38bb38410b1c093c7a7a6b791ca507 100644 (file)
@@ -461,6 +461,11 @@ public class ArpHandler implements IHostFinder, IListenDataPacket, ICacheUpdateA
             log.debug("Can't find subnet matching {}, drop packet", dIP);
             return;
         }
+        // If packet is sent to the default gw (us), ignore it for now
+        if (subnet.getNetworkAddress().equals(dIP)) {
+            log.trace("Ignore IP packet destined to default gw");
+            return;
+        }
 
         // see if we know about the host
         // Hosttracker hosts db key implementation