]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: add useful notification logs (BZ#616)
authorheasley <heas@shrubbery.net>
Mon, 12 Sep 2011 09:27:52 +0000 (13:27 +0400)
committerDenis Ovsienko <infrastation@yandex.ru>
Tue, 27 Sep 2011 17:07:07 +0000 (21:07 +0400)
* bgp_packet.c
  * bgp_notify_send_with_data(): add calls to zlog_info()

bgpd/bgp_packet.c

index 1d9fcc971d488380beb1401fd232370567725236..2623cc292c7cb34b3b10ec896e97d55c477cb420 100644 (file)
@@ -895,12 +895,25 @@ bgp_notify_send_with_data (struct peer *peer, u_char code, u_char sub_code,
   if (sub_code != BGP_NOTIFY_CEASE_CONFIG_CHANGE)
     {
       if (sub_code == BGP_NOTIFY_CEASE_ADMIN_RESET)
-      peer->last_reset = PEER_DOWN_USER_RESET;
+      {
+        peer->last_reset = PEER_DOWN_USER_RESET;
+        zlog_info ("Notification sent to neighbor %s: User reset", peer->host);
+      }
       else if (sub_code == BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN)
-      peer->last_reset = PEER_DOWN_USER_SHUTDOWN;
+      {
+        peer->last_reset = PEER_DOWN_USER_SHUTDOWN;
+        zlog_info ("Notification sent to neighbor %s: shutdown", peer->host);
+      }
       else
-      peer->last_reset = PEER_DOWN_NOTIFY_SEND;
+      {
+        peer->last_reset = PEER_DOWN_NOTIFY_SEND;
+        zlog_info ("Notification sent to neighbor %s: type %u/%u",
+                   peer->host, code, sub_code);
+      }
     }
+  else
+     zlog_info ("Notification sent to neighbor %s: configuration change",
+                peer->host);
 
   /* Call imidiately. */
   BGP_WRITE_OFF (peer->t_write);