Ospf opaque LSA bug fix.

Change-Id: I9b2674195a754a0774013f9adf717764ea18c9a6
This commit is contained in:
Shashikanth VH 2016-04-27 16:06:56 +05:30 committed by Gerrit Code Review
parent 1f1c6eef56
commit 1560d40b0e
3 changed files with 11 additions and 8 deletions

View File

@ -29,6 +29,7 @@ import org.onosproject.ospf.protocol.lsa.tlvtypes.OpaqueTopLevelTlvTypes;
import org.onosproject.ospf.protocol.lsa.tlvtypes.RouterTlv; import org.onosproject.ospf.protocol.lsa.tlvtypes.RouterTlv;
import org.onosproject.ospf.protocol.util.OspfParameters; import org.onosproject.ospf.protocol.util.OspfParameters;
import java.util.Arrays;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -192,11 +193,11 @@ public class OpaqueLsa10 extends OpaqueLsaHeader {
} }
OpaqueLsa10 that = (OpaqueLsa10) o; OpaqueLsa10 that = (OpaqueLsa10) o;
return Objects.equal(topLevelValues, that.topLevelValues) && return Objects.equal(topLevelValues, that.topLevelValues) &&
Objects.equal(opaqueInfo, that.opaqueInfo); Arrays.equals(opaqueInfo, that.opaqueInfo);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hashCode(opaqueInfo, topLevelValues); return Objects.hashCode(Arrays.hashCode(opaqueInfo), topLevelValues);
} }
} }

View File

@ -16,12 +16,13 @@
package org.onosproject.ospf.protocol.lsa.types; package org.onosproject.ospf.protocol.lsa.types;
import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.primitives.Bytes; import com.google.common.primitives.Bytes;
import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.ospf.controller.OspfLsaType; import org.onosproject.ospf.controller.OspfLsaType;
import org.onosproject.ospf.protocol.lsa.OpaqueLsaHeader; import org.onosproject.ospf.protocol.lsa.OpaqueLsaHeader;
import java.util.Arrays;
/** /**
* Representation of an Opaque LSA of type AS (11). * Representation of an Opaque LSA of type AS (11).
*/ */
@ -106,12 +107,12 @@ public class OpaqueLsa11 extends OpaqueLsaHeader {
return false; return false;
} }
OpaqueLsa11 that = (OpaqueLsa11) o; OpaqueLsa11 that = (OpaqueLsa11) o;
return Objects.equal(opaqueInfo, that.opaqueInfo); return Arrays.equals(opaqueInfo, that.opaqueInfo);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hashCode(opaqueInfo); return Arrays.hashCode(opaqueInfo);
} }
@Override @Override

View File

@ -16,12 +16,13 @@
package org.onosproject.ospf.protocol.lsa.types; package org.onosproject.ospf.protocol.lsa.types;
import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.primitives.Bytes; import com.google.common.primitives.Bytes;
import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.ospf.controller.OspfLsaType; import org.onosproject.ospf.controller.OspfLsaType;
import org.onosproject.ospf.protocol.lsa.OpaqueLsaHeader; import org.onosproject.ospf.protocol.lsa.OpaqueLsaHeader;
import java.util.Arrays;
/** /**
* Representation of an Opaque LSA of type link local (9). * Representation of an Opaque LSA of type link local (9).
*/ */
@ -108,12 +109,12 @@ public class OpaqueLsa9 extends OpaqueLsaHeader {
return false; return false;
} }
OpaqueLsa9 that = (OpaqueLsa9) o; OpaqueLsa9 that = (OpaqueLsa9) o;
return Objects.equal(opaqueInfo, that.opaqueInfo); return Arrays.equals(opaqueInfo, that.opaqueInfo);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hashCode(opaqueInfo); return Arrays.hashCode(opaqueInfo);
} }
@Override @Override