Enhancements for hosts behing trunks
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / internal / DataPacketMuxDemux.java
index 54d5fb888a268ab25ca508498069ff3d2811acd6..932ac4e20be37f8d5ea1234265054209ceda120f 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;