commit | 1ecbe7bbe443fff92b1e84e7a3f2e9f29899f4bf | [log] [tgz] |
---|---|---|
author | Shashikanth VH <shashikanth.vh@huawei.com> | Wed Dec 02 22:54:23 2015 +0530 |
committer | Gerrit Code Review <gerrit@onlab.us> | Wed Dec 02 18:37:12 2015 +0000 |
tree | ef6d6a81c407052888a959403a43a010790f1945 | |
parent | b1f1625636836003562cdff55deb9328ca1176b0 [diff] |
BGP notification system test issues fix Change-Id: I53b1aca6cf361fa212dd5ab83380bef40bbc5cd7
diff --git a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpNotificationMsgVer4.java b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpNotificationMsgVer4.java index d25db24..7243e21 100644 --- a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpNotificationMsgVer4.java +++ b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpNotificationMsgVer4.java
@@ -194,7 +194,9 @@ } cb.writeByte(message.errorCode); cb.writeByte(message.errorSubCode); - cb.writeBytes(message.data); + if (message.data != null) { + cb.writeBytes(message.data); + } //Update message length field in notification message int length = cb.writerIndex() - msgStartIndex;
diff --git a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpPathAttributes.java b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpPathAttributes.java index 9ffddf6..13e52ca 100644 --- a/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpPathAttributes.java +++ b/protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/protocol/ver4/BgpPathAttributes.java
@@ -166,6 +166,11 @@ public static void checkMandatoryAttr(boolean isOrigin, boolean isAsPath, boolean isNextHop, boolean isMpReach, boolean isMpUnReach) throws BgpParseException { + // Mandatory attributes validation not required for MP_UNREACH + if (isMpUnReach) { + return; + } + if (!isOrigin) { log.debug("Mandatory Attributes not Present"); Validation.validateType(BgpErrorType.UPDATE_MESSAGE_ERROR,