Enhancements for hosts behing trunks 15/8415/2
authorGiovanni Meo <gmeo@cisco.com>
Fri, 27 Jun 2014 17:11:58 +0000 (19:11 +0200)
committerGiovanni Meo <gmeo@cisco.com>
Fri, 27 Jun 2014 17:14:36 +0000 (17:14 +0000)
- Allow to skip dot1Q if present
- Allow to dispatch only to container if there is a match else pass to default

Change-Id: I58c0a11e0e499f2f531f72b803863cf8f996867f
Signed-off-by: Giovanni Meo <gmeo@cisco.com>
opendaylight/arphandler/src/main/java/org/opendaylight/controller/arphandler/internal/ArpHandler.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DataPacketMuxDemux.java

index e549182..db94a7c 100644 (file)
@@ -51,6 +51,7 @@ import org.opendaylight.controller.sal.packet.Ethernet;
 import org.opendaylight.controller.sal.packet.IDataPacketService;
 import org.opendaylight.controller.sal.packet.IListenDataPacket;
 import org.opendaylight.controller.sal.packet.IPv4;
+import org.opendaylight.controller.sal.packet.IEEE8021Q;
 import org.opendaylight.controller.sal.packet.Packet;
 import org.opendaylight.controller.sal.packet.PacketResult;
 import org.opendaylight.controller.sal.packet.RawPacket;
@@ -654,6 +655,10 @@ public class ArpHandler implements IHostFinder, IListenDataPacket, ICacheUpdateA
         Packet formattedPak = this.dataPacketService.decodeDataPacket(inPkt);
         if (formattedPak instanceof Ethernet) {
             Object nextPak = formattedPak.getPayload();
+            if (nextPak instanceof IEEE8021Q) {
+                log.trace("Moved after the dot1Q header");
+                nextPak = ((IEEE8021Q) nextPak).getPayload();
+            }
             if (nextPak instanceof IPv4) {
                 log.trace("Handle IP packet: {}", formattedPak);
                 handlePuntedIPPacket((IPv4) nextPak, inPkt.getIncomingNodeConnector());
index 54d5fb8..932ac4e 100644 (file)
@@ -212,17 +212,8 @@ public class DataPacketMuxDemux implements IContainerListener,
                     }
                 }
 
-                // Now dispatch the packet toward SAL for default container
-                IPluginOutDataPacketService defaultOutService = this.pluginOutDataPacketServices
-                        .get(GlobalConstants.DEFAULT.toString());
-                if (defaultOutService != null) {
-                    defaultOutService.receiveDataPacket(dataPacket);
-                    if (logger.isTraceEnabled()) {
-                        logger.trace("Dispatched to apps a frame of size: {} on " + "container: {}: {}",
-                                new Object[] { ofPacket.getPacketData().length, GlobalConstants.DEFAULT.toString(),
-                                        HexEncode.bytesToHexString(dataPacket.getPacketData()) });
-                    }
-                }
+                boolean dispatched_to_container = false;
+
                 // Now check the mapping between nodeConnector and
                 // Container and later on optimally filter based on
                 // flowSpec
@@ -254,10 +245,25 @@ public class DataPacketMuxDemux implements IContainerListener,
                                                         HexEncode.bytesToHexString(dataPacket.getPacketData()) });
                                     }
                                 }
+                                dispatched_to_container = true;
                             }
                         }
                     }
                 }
+                if (!dispatched_to_container) {
+                    // Now dispatch the packet toward SAL for default container
+                    IPluginOutDataPacketService defaultOutService = this.pluginOutDataPacketServices
+                        .get(GlobalConstants.DEFAULT.toString());
+                    if (defaultOutService != null) {
+                        defaultOutService.receiveDataPacket(dataPacket);
+                        if (logger.isTraceEnabled()) {
+                            logger.trace("Dispatched to apps a frame of size: {} on " + "container: {}: {}",
+                                         new Object[] { ofPacket.getPacketData().length,
+                                                        GlobalConstants.DEFAULT.toString(),
+                                                        HexEncode.bytesToHexString(dataPacket.getPacketData()) });
+                        }
+                    }
+                }
                 // This is supposed to be the catch all for all the
                 // DataPacket hence we will assume it has been handled
                 return;

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.