Bugfix: Acknowledge to ETR only if want-map-notify is set to true

Change-Id: I684bc1f1a7958b9777f90fe512980523490598ac
This commit is contained in:
Jian Li 2016-11-24 02:51:03 +09:00 committed by Thomas Vachuska
parent 70222adec1
commit 2c8a2a4f84
3 changed files with 26 additions and 18 deletions

View File

@ -61,8 +61,10 @@ public class LispChannelHandler extends ChannelInboundHandlerAdapter {
LispMapNotify mapNotify = LispMapNotify mapNotify =
mapServer.processMapRegister((LispMapRegister) msg); mapServer.processMapRegister((LispMapRegister) msg);
if (mapNotify != null) {
ctx.writeAndFlush(mapNotify); ctx.writeAndFlush(mapNotify);
} }
}
if (msg instanceof LispInfoRequest) { if (msg instanceof LispInfoRequest) {
LispMapServer mapServer = LispMapServer.getInstance(); LispMapServer mapServer = LispMapServer.getInstance();

View File

@ -54,7 +54,7 @@ public class LispMapResolver {
LispEncapsulatedControl ecm = (LispEncapsulatedControl) message; LispEncapsulatedControl ecm = (LispEncapsulatedControl) message;
LispMapRequest request = (LispMapRequest) ecm.getControlMessage(); LispMapRequest request = (LispMapRequest) ecm.getControlMessage();
// TODO: for now we always generate map-notify message and send to ITR // TODO: for now we always generate map-reply message and send to ITR
// no matter proxy bit is set or not // no matter proxy bit is set or not
// build map-reply message // build map-reply message

View File

@ -83,6 +83,9 @@ public final class LispMapServer {
return null; return null;
} }
// we only acknowledge back to ETR when want-map-notify bit is set to true
// otherwise, we do not acknowledge back to ETR
if (register.isWantMapNotify()) {
NotifyBuilder notifyBuilder = new DefaultNotifyBuilder(); NotifyBuilder notifyBuilder = new DefaultNotifyBuilder();
notifyBuilder.withKeyId(authConfig.lispAuthKeyId()); notifyBuilder.withKeyId(authConfig.lispAuthKeyId());
notifyBuilder.withAuthDataLength(valueOf(authConfig.lispAuthKeyId()).getHashLength()); notifyBuilder.withAuthDataLength(valueOf(authConfig.lispAuthKeyId()).getHashLength());
@ -105,6 +108,9 @@ public final class LispMapServer {
return notify; return notify;
} }
return null;
}
/** /**
* Handles info-request message and replies with info-reply message. * Handles info-request message and replies with info-reply message.
* *