Skip to content
Snippets Groups Projects
Commit 8dc74999 authored by Ryan Izard's avatar Ryan Izard Committed by GitHub
Browse files

Merge pull request #741 from allewwaly/patch-1

check openflow version before matching tcp_flags
parents 4ade703c 70ca3ac6
No related branches found
No related tags found
No related merge requests found
......@@ -596,12 +596,16 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF
if (FLOWMOD_DEFAULT_MATCH_TRANSPORT_DST) {
mb.setExact(MatchField.TCP_DST, tcp.getDestinationPort());
}
if(
sw.getSwitchDescription().getHardwareDescription().toLowerCase().contains("open vswitch") && (
Integer.parseInt(sw.getSwitchDescription().getSoftwareDescription().toLowerCase().split("\\.")[0]) > 2 || (
Integer.parseInt(sw.getSwitchDescription().getSoftwareDescription().toLowerCase().split("\\.")[0]) == 2 &&
Integer.parseInt(sw.getSwitchDescription().getSoftwareDescription().toLowerCase().split("\\.")[1]) >= 1 ))
){
if (sw.getOFFactory().getVersion().compareTo(OFVersion.OF_15) >= 0){
if(FLOWMOD_DEFAULT_MATCH_TCP_FLAG){
mb.setExact(MatchField.TCP_FLAGS, U16.of(tcp.getFlags()));
}
}
else if(sw.getSwitchDescription().getHardwareDescription().toLowerCase().contains("open vswitch") && (
Integer.parseInt(sw.getSwitchDescription().getSoftwareDescription().toLowerCase().split("\\.")[0]) > 2 || (
Integer.parseInt(sw.getSwitchDescription().getSoftwareDescription().toLowerCase().split("\\.")[0]) == 2 &&
Integer.parseInt(sw.getSwitchDescription().getSoftwareDescription().toLowerCase().split("\\.")[1]) >= 1 ))
){
if(FLOWMOD_DEFAULT_MATCH_TCP_FLAG){
mb.setExact(MatchField.OVS_TCP_FLAGS, U16.of(tcp.getFlags()));
}
......@@ -652,7 +656,12 @@ public class Forwarding extends ForwardingBase implements IFloodlightModule, IOF
if (FLOWMOD_DEFAULT_MATCH_TRANSPORT_DST) {
mb.setExact(MatchField.TCP_DST, tcp.getDestinationPort());
}
if(
if (sw.getOFFactory().getVersion().compareTo(OFVersion.OF_15) >= 0){
if(FLOWMOD_DEFAULT_MATCH_TCP_FLAG){
mb.setExact(MatchField.TCP_FLAGS, U16.of(tcp.getFlags()));
}
}
else if(
sw.getSwitchDescription().getHardwareDescription().toLowerCase().contains("open vswitch") && (
Integer.parseInt(sw.getSwitchDescription().getSoftwareDescription().toLowerCase().split("\\.")[0]) > 2 || (
Integer.parseInt(sw.getSwitchDescription().getSoftwareDescription().toLowerCase().split("\\.")[0]) == 2 &&
......
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