Skip to content
Snippets Groups Projects
Commit da9fd95c authored by Lei Xu's avatar Lei Xu
Browse files

Merge remote-tracking branch 'upstream/master'

parents 7255ba97 e4e9098d
No related branches found
No related tags found
No related merge requests found
...@@ -374,7 +374,7 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF ...@@ -374,7 +374,7 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF
protected void doDropFlow(IOFSwitch sw, OFPacketIn pi, IRoutingDecision decision, FloodlightContext cntx) { protected void doDropFlow(IOFSwitch sw, OFPacketIn pi, IRoutingDecision decision, FloodlightContext cntx) {
OFPort inPort = OFMessageUtils.getInPort(pi); OFPort inPort = OFMessageUtils.getInPort(pi);
Match m = createMatchFromPacket(sw, inPort, cntx); Match m = createMatchFromPacket(sw, inPort, pi, cntx);
OFFlowMod.Builder fmb = sw.getOFFactory().buildFlowAdd(); OFFlowMod.Builder fmb = sw.getOFFactory().buildFlowAdd();
List<OFAction> actions = new ArrayList<OFAction>(); // set no action to drop List<OFAction> actions = new ArrayList<OFAction>(); // set no action to drop
U64 flowSetId = flowSetIdRegistry.generateFlowSetId(); U64 flowSetId = flowSetIdRegistry.generateFlowSetId();
...@@ -485,7 +485,7 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF ...@@ -485,7 +485,7 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF
dstAp.getNodeId(), dstAp.getNodeId(),
dstAp.getPortId()); dstAp.getPortId());
Match m = createMatchFromPacket(sw, srcPort, cntx); Match m = createMatchFromPacket(sw, srcPort, pi, cntx);
if (path != null) { if (path != null) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
...@@ -536,11 +536,20 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF ...@@ -536,11 +536,20 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF
* @param cntx, the current context which contains the deserialized packet * @param cntx, the current context which contains the deserialized packet
* @return a composed Match object based on the provided information * @return a composed Match object based on the provided information
*/ */
protected Match createMatchFromPacket(IOFSwitch sw, OFPort inPort, FloodlightContext cntx) { protected Match createMatchFromPacket(IOFSwitch sw, OFPort inPort, OFPacketIn pi, FloodlightContext cntx) {
// The packet in match will only contain the port number. // The packet in match will only contain the port number.
// We need to add in specifics for the hosts we're routing between. // We need to add in specifics for the hosts we're routing between.
Ethernet eth = IFloodlightProviderService.bcStore.get(cntx, IFloodlightProviderService.CONTEXT_PI_PAYLOAD); Ethernet eth = IFloodlightProviderService.bcStore.get(cntx, IFloodlightProviderService.CONTEXT_PI_PAYLOAD);
VlanVid vlan = VlanVid.ofVlan(eth.getVlanID());
VlanVid vlan = null;
if (pi.getVersion().compareTo(OFVersion.OF_11) > 0 && /* 1.0 and 1.1 do not have a match */
pi.getMatch().get(MatchField.VLAN_VID) != null) {
vlan = pi.getMatch().get(MatchField.VLAN_VID).getVlanVid(); /* VLAN may have been popped by switch */
}
if (vlan == null) {
vlan = VlanVid.ofVlan(eth.getVlanID()); /* VLAN might still be in packet */
}
MacAddress srcMac = eth.getSourceMACAddress(); MacAddress srcMac = eth.getSourceMACAddress();
MacAddress dstMac = eth.getDestinationMACAddress(); MacAddress dstMac = eth.getDestinationMACAddress();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment