this.session = session;
this.rawIdentifier = InetAddresses.forString(session.getBgpId().getValue()).getAddress();
final PeerId peerId = RouterIds.createPeerId(session.getBgpId());
-
createAdjRibOutListener(peerId);
this.ribWriter = this.ribWriter.transform(peerId, this.rib.getRibSupportContext(), this.tables, false);
@Override
public void onSessionDown(final BGPSession session, final Exception e) {
- LOG.info("Session with peer {} went down", this.name, e);
+ if(e.getMessage().equals(BGPSessionImpl.END_OF_INPUT)) {
+ LOG.info("Session with peer {} went down", this.name);
+ } else {
+ LOG.info("Session with peer {} went down", this.name, e);
+ }
releaseConnection();
}
@Override
public void releaseConnection() {
+ addPeerToDisconnectedSharedList();
cleanup();
dropConnection();
}
+ private void addPeerToDisconnectedSharedList() {
+ if(this.session != null) {
+ this.rib.getCacheDisconnectedPeers().insertDesconectedPeer(this.session.getBgpId());
+ }
+ }
+
@GuardedBy("this")
private void dropConnection() {
if (this.runtimeReg != null) {