alshabib
Committed by Gerrit Code Review

fixing dhcp serialization problem

Change-Id: Ie049f9c1e464ca9a2b651df74f7b979628d0d745
......@@ -104,7 +104,7 @@ public final class DefaultOpenFlowPacketContext implements OpenFlowPacketContext
} catch (BufferUnderflowException | NullPointerException |
DeserializationException e) {
Logger log = LoggerFactory.getLogger(getClass());
log.warn("packet deserialization problem");
log.warn("packet deserialization problem : {}", e.getMessage());
return null;
}
}
......
......@@ -628,6 +628,9 @@ public class DHCP extends BasePacket {
}
}
} else if (code == 255) {
DHCPOption end = new DHCPOption();
end.setCode((byte) 255);
dhcp.options.add(end);
// remaining bytes are supposed to be 0, but ignore them just in
// case
foundEndOptionsMarker = true;
......
......@@ -271,7 +271,8 @@ public class IGMP extends BasePacket {
break;
default:
msg = "IGMP message type: " + igmp.igmpType + " is not recodnized";
msg = "IGMP message type: " + igmp.igmpType + " is not recognized";
igmp.unsupportTypeData = bb.array();
igmp.log.debug(msg);
break;
}
......
......@@ -130,7 +130,7 @@ public class DhcpTest {
assertEquals(serverName, dhcp.serverName);
assertEquals(bootFileName, dhcp.bootFileName);
assertEquals(1, dhcp.options.size());
assertEquals(2, dhcp.options.size());
assertEquals(hostNameOption, dhcp.options.get(0));
}
......