mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-12-16 06:41:29 +01:00
Bugfix: Acknowledge to ETR only if want-map-notify is set to true
Change-Id: I684bc1f1a7958b9777f90fe512980523490598ac
This commit is contained in:
parent
70222adec1
commit
2c8a2a4f84
@ -61,7 +61,9 @@ public class LispChannelHandler extends ChannelInboundHandlerAdapter {
|
|||||||
LispMapNotify mapNotify =
|
LispMapNotify mapNotify =
|
||||||
mapServer.processMapRegister((LispMapRegister) msg);
|
mapServer.processMapRegister((LispMapRegister) msg);
|
||||||
|
|
||||||
ctx.writeAndFlush(mapNotify);
|
if (mapNotify != null) {
|
||||||
|
ctx.writeAndFlush(mapNotify);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg instanceof LispInfoRequest) {
|
if (msg instanceof LispInfoRequest) {
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -83,26 +83,32 @@ public final class LispMapServer {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
NotifyBuilder notifyBuilder = new DefaultNotifyBuilder();
|
// we only acknowledge back to ETR when want-map-notify bit is set to true
|
||||||
notifyBuilder.withKeyId(authConfig.lispAuthKeyId());
|
// otherwise, we do not acknowledge back to ETR
|
||||||
notifyBuilder.withAuthDataLength(valueOf(authConfig.lispAuthKeyId()).getHashLength());
|
if (register.isWantMapNotify()) {
|
||||||
notifyBuilder.withAuthKey(authConfig.lispAuthKey());
|
NotifyBuilder notifyBuilder = new DefaultNotifyBuilder();
|
||||||
notifyBuilder.withNonce(register.getNonce());
|
notifyBuilder.withKeyId(authConfig.lispAuthKeyId());
|
||||||
notifyBuilder.withMapRecords(register.getMapRecords());
|
notifyBuilder.withAuthDataLength(valueOf(authConfig.lispAuthKeyId()).getHashLength());
|
||||||
|
notifyBuilder.withAuthKey(authConfig.lispAuthKey());
|
||||||
|
notifyBuilder.withNonce(register.getNonce());
|
||||||
|
notifyBuilder.withMapRecords(register.getMapRecords());
|
||||||
|
|
||||||
LispMapNotify notify = notifyBuilder.build();
|
LispMapNotify notify = notifyBuilder.build();
|
||||||
|
|
||||||
InetSocketAddress address =
|
InetSocketAddress address =
|
||||||
new InetSocketAddress(register.getSender().getAddress(), MAP_NOTIFY_PORT);
|
new InetSocketAddress(register.getSender().getAddress(), MAP_NOTIFY_PORT);
|
||||||
notify.configSender(address);
|
notify.configSender(address);
|
||||||
|
|
||||||
register.getMapRecords().forEach(record -> {
|
register.getMapRecords().forEach(record -> {
|
||||||
LispEidRecord eidRecord =
|
LispEidRecord eidRecord =
|
||||||
new LispEidRecord(record.getMaskLength(), record.getEidPrefixAfi());
|
new LispEidRecord(record.getMaskLength(), record.getEidPrefixAfi());
|
||||||
eidRlocMap.insertMapRecord(eidRecord, record);
|
eidRlocMap.insertMapRecord(eidRecord, record);
|
||||||
});
|
});
|
||||||
|
|
||||||
return notify;
|
return notify;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user