Committed by
Gerrit Code Review
BGP notification system test issues fix
Change-Id: I53b1aca6cf361fa212dd5ab83380bef40bbc5cd7
Showing
2 changed files
with
8 additions
and
1 deletions
| ... | @@ -194,7 +194,9 @@ class BgpNotificationMsgVer4 implements BgpNotificationMsg { | ... | @@ -194,7 +194,9 @@ class BgpNotificationMsgVer4 implements BgpNotificationMsg { |
| 194 | } | 194 | } |
| 195 | cb.writeByte(message.errorCode); | 195 | cb.writeByte(message.errorCode); |
| 196 | cb.writeByte(message.errorSubCode); | 196 | cb.writeByte(message.errorSubCode); |
| 197 | - cb.writeBytes(message.data); | 197 | + if (message.data != null) { |
| 198 | + cb.writeBytes(message.data); | ||
| 199 | + } | ||
| 198 | 200 | ||
| 199 | //Update message length field in notification message | 201 | //Update message length field in notification message |
| 200 | int length = cb.writerIndex() - msgStartIndex; | 202 | int length = cb.writerIndex() - msgStartIndex; | ... | ... |
| ... | @@ -166,6 +166,11 @@ public class BgpPathAttributes { | ... | @@ -166,6 +166,11 @@ public class BgpPathAttributes { |
| 166 | public static void checkMandatoryAttr(boolean isOrigin, boolean isAsPath, | 166 | public static void checkMandatoryAttr(boolean isOrigin, boolean isAsPath, |
| 167 | boolean isNextHop, boolean isMpReach, boolean isMpUnReach) | 167 | boolean isNextHop, boolean isMpReach, boolean isMpUnReach) |
| 168 | throws BgpParseException { | 168 | throws BgpParseException { |
| 169 | + // Mandatory attributes validation not required for MP_UNREACH | ||
| 170 | + if (isMpUnReach) { | ||
| 171 | + return; | ||
| 172 | + } | ||
| 173 | + | ||
| 169 | if (!isOrigin) { | 174 | if (!isOrigin) { |
| 170 | log.debug("Mandatory Attributes not Present"); | 175 | log.debug("Mandatory Attributes not Present"); |
| 171 | Validation.validateType(BgpErrorType.UPDATE_MESSAGE_ERROR, | 176 | Validation.validateType(BgpErrorType.UPDATE_MESSAGE_ERROR, | ... | ... |
-
Please register or login to post a comment