Rusty Eddy
Committed by Gerrit Code Review

IGMP Deserialize now properly uses the offset and

length parameters to deserialize the correct area
of data buffer.

Change-Id: I5d8869c25d397d5d07aad014ef00d0decef22d4f
......@@ -111,18 +111,18 @@ public class IGMPComponent {
"\tingress port: " + context.inPacket().receivedFrom().toString());
if (ip.getProtocol() != IPv4.PROTOCOL_IGMP) {
log.error("IGMP Picked up a non IGMP packet.");
log.debug("IGMP Picked up a non IGMP packet.");
return;
}
IpPrefix mcast = IpPrefix.valueOf("224.0.0.0/4");
if (!mcast.contains(gaddr)) {
log.error("IGMP Picked up a non multicast packet.");
log.debug("IGMP Picked up a non multicast packet.");
return;
}
if (mcast.contains(saddr)) {
log.error("IGMP Picked up a packet with a multicast source address.");
log.debug("IGMP Picked up a packet with a multicast source address.");
return;
}
IpPrefix spfx = IpPrefix.valueOf(saddr, 32);
......
......@@ -231,7 +231,7 @@ public class IGMP extends BasePacket {
IGMP igmp = new IGMP();
ByteBuffer bb = ByteBuffer.wrap(data);
final ByteBuffer bb = ByteBuffer.wrap(data, offset, length);
igmp.igmpType = bb.get();
igmp.resField = bb.get();
igmp.checksum = bb.getShort();
......