diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispInfoReply.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispInfoReply.java index ff34776c44..fd22fa8af2 100644 --- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispInfoReply.java +++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispInfoReply.java @@ -63,7 +63,7 @@ public final class DefaultLispInfoReply extends DefaultLispInfo implements LispI * @param eidPrefix EID prefix * @param natLcafAddress NAT LCAF address */ - protected DefaultLispInfoReply(boolean infoReply, long nonce, short keyId, short authDataLength, + DefaultLispInfoReply(boolean infoReply, long nonce, short keyId, short authDataLength, byte[] authData, int ttl, byte maskLength, LispAfiAddress eidPrefix, LispNatLcafAddress natLcafAddress) { super(infoReply, nonce, keyId, authDataLength, authData, ttl, maskLength, eidPrefix); @@ -249,16 +249,19 @@ public final class DefaultLispInfoReply extends DefaultLispInfo implements LispI LispNatLcafAddress natLcafAddress = (LispNatLcafAddress) new LcafAddressReader().readFrom(byteBuf); - return new DefaultInfoReplyBuilder() - .withIsInfoReply(lispInfo.isInfoReply()) - .withNonce(lispInfo.getNonce()) - .withKeyId(lispInfo.getKeyId()) - .withAuthDataLength(lispInfo.getAuthDataLength()) - .withAuthData(lispInfo.getAuthData()) - .withTtl(lispInfo.getTtl()) - .withMaskLength(lispInfo.getMaskLength()) - .withEidPrefix(lispInfo.getPrefix()) - .withNatLcafAddress(natLcafAddress).build(); + if (lispInfo != null) { + return new DefaultInfoReplyBuilder() + .withIsInfoReply(lispInfo.isInfoReply()) + .withNonce(lispInfo.getNonce()) + .withKeyId(lispInfo.getKeyId()) + .withAuthDataLength(lispInfo.getAuthDataLength()) + .withAuthData(lispInfo.getAuthData()) + .withTtl(lispInfo.getTtl()) + .withMaskLength(lispInfo.getMaskLength()) + .withEidPrefix(lispInfo.getPrefix()) + .withNatLcafAddress(natLcafAddress).build(); + } + return null; } } diff --git a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispInfoRequest.java b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispInfoRequest.java index 1a29579f21..19815e9945 100644 --- a/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispInfoRequest.java +++ b/protocols/lisp/msg/src/main/java/org/onosproject/lisp/msg/protocols/DefaultLispInfoRequest.java @@ -60,10 +60,10 @@ public class DefaultLispInfoRequest extends DefaultLispInfo * @param maskLength EID prefix mask length * @param eidPrefix EID prefix */ - protected DefaultLispInfoRequest(boolean infoReply, long nonce, short keyId, - short authDataLength, byte[] authData, - int ttl, byte maskLength, - LispAfiAddress eidPrefix) { + DefaultLispInfoRequest(boolean infoReply, long nonce, short keyId, + short authDataLength, byte[] authData, + int ttl, byte maskLength, + LispAfiAddress eidPrefix) { super(infoReply, nonce, keyId, authDataLength, authData, ttl, maskLength, eidPrefix); @@ -239,15 +239,19 @@ public class DefaultLispInfoRequest extends DefaultLispInfo LispInfo lispInfo = deserialize(byteBuf); - return new DefaultInfoRequestBuilder() - .withIsInfoReply(lispInfo.isInfoReply()) - .withNonce(lispInfo.getNonce()) - .withKeyId(lispInfo.getKeyId()) - .withAuthDataLength(lispInfo.getAuthDataLength()) - .withAuthData(lispInfo.getAuthData()) - .withTtl(lispInfo.getTtl()) - .withMaskLength(lispInfo.getMaskLength()) - .withEidPrefix(lispInfo.getPrefix()).build(); + if (lispInfo != null) { + return new DefaultInfoRequestBuilder() + .withIsInfoReply(lispInfo.isInfoReply()) + .withNonce(lispInfo.getNonce()) + .withKeyId(lispInfo.getKeyId()) + .withAuthDataLength(lispInfo.getAuthDataLength()) + .withAuthData(lispInfo.getAuthData()) + .withTtl(lispInfo.getTtl()) + .withMaskLength(lispInfo.getMaskLength()) + .withEidPrefix(lispInfo.getPrefix()).build(); + } + + return null; } }