mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-05-04 19:56:49 +02:00
Fix: resolve potential NPE in LispInfo request and reply
Change-Id: Iab01f0d2c947e918d5c131a7e416582f9fad9496
This commit is contained in:
parent
ab7a1f6875
commit
03398d53cb
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user