Skip to content
Snippets Groups Projects
Commit cebec8fe authored by Ryan Izard's avatar Ryan Izard
Browse files

Fixed fetching of ingress port to work with OF1.0 and 1.2+. This is the final...

Fixed fetching of ingress port to work with OF1.0 and 1.2+. This is the final commit for the DHCP server. Will add some unit tests in a later and near-future commit as practice/exercise for me =)
parent 804966b7
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,9 @@ import org.projectfloodlight.openflow.protocol.OFMessage;
import org.projectfloodlight.openflow.protocol.OFPacketIn;
import org.projectfloodlight.openflow.protocol.OFPacketOut;
import org.projectfloodlight.openflow.protocol.OFType;
import org.projectfloodlight.openflow.protocol.OFVersion;
import org.projectfloodlight.openflow.protocol.action.OFAction;
import org.projectfloodlight.openflow.protocol.match.MatchField;
import org.projectfloodlight.openflow.types.EthType;
import org.projectfloodlight.openflow.types.IPv4Address;
import org.projectfloodlight.openflow.types.IpProtocol;
......@@ -838,7 +840,7 @@ public class DHCPServer implements IOFMessageListener, IFloodlightModule {
log.debug("Got DHCP Packet");
// This is a DHCP packet that we need to process
DHCP DHCPPayload = (DHCP) UDPPayload.getPayload();
OFPort inPort = pi.getInPort();
OFPort inPort = (pi.getVersion().compareTo(OFVersion.OF_12) < 0 ? pi.getInPort() : pi.getMatch().get(MatchField.IN_PORT));
/* DHCP/IPv4 Header Information */
int xid = 0;
......
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