BUG-2115 : added zero subcode to BGP CEASE Notify message to avoid NPE 72/11672/1
authorDana Kutenicsova <dkutenic@cisco.com>
Tue, 30 Sep 2014 15:51:03 +0000 (17:51 +0200)
committerDana Kutenicsova <dkutenic@cisco.com>
Tue, 30 Sep 2014 15:51:03 +0000 (17:51 +0200)
Change-Id: I6102d73e9bd3ff86f2238f1af249cee3094711b2
Signed-off-by: Dana Kutenicsova <dkutenic@cisco.com>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSessionImpl.java

index 6c7fa56b1843257506db360374caead043b33005..005dc368d5a2ca00bff36a8cb21892eb6bec2b78 100644 (file)
@@ -146,7 +146,7 @@ public class BGPSessionImpl extends AbstractProtocolSession<Notification> implem
     public synchronized void close() {
         LOG.info("Closing session: {}", this);
         if (this.state != State.Idle) {
-            this.sendMessage(new NotifyBuilder().setErrorCode(BGPError.CEASE.getCode()).build());
+            this.sendMessage(new NotifyBuilder().setErrorCode(BGPError.CEASE.getCode()).setErrorSubcode((short)0).build());
             this.channel.close();
             this.state = State.Idle;
         }
@@ -207,7 +207,6 @@ public class BGPSessionImpl extends AbstractProtocolSession<Notification> implem
                     }
                 });
             this.lastMessageSentAt = System.nanoTime();
-            LOG.debug("Sent message: {} to peer {}", msg, this.bgpId);
         } catch (final Exception e) {
             LOG.warn("Message {} was not sent.", msg, e);
         }