* bgp_nexthop.c: Improve debug.
* bgpd.[ch], bgp_nexthop.c, bgp_snmp.c: Remove useless bgp_get_master()
function.
* bgp_packet.c: MP AFI_IP update and withdraw parsing.
* bgp_fsm.c: Reset peer synctime in bgp_stop(). bgp_fsm_change_status()
is better place to log about peer status change than bgp_event().
Log in bgp_connect_success().
* bgp_vty.c: Fix typo in comment.
* bgp_attr.c: Better log about unknown attribute.
[merge from GNU Zebra]
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 8919586..7327db0 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -367,6 +367,9 @@
/* Need of clear of peer. */
bgp_clear_route_all (peer);
+
+ /* Reset peer synctime */
+ peer->synctime = 0;
}
/* Stop read and write threads when exists. */
@@ -491,6 +494,8 @@
int
bgp_connect_success (struct peer *peer)
{
+ char buf1[BUFSIZ];
+
if (peer->fd < 0)
{
zlog_err ("bgp_connect_success peer's fd is negative value %d",
@@ -499,7 +504,17 @@
}
BGP_READ_ON (peer->t_read, bgp_read, peer->fd);
- /* bgp_getsockname (peer); */
+ if (! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER))
+ bgp_getsockname (peer);
+
+ if (BGP_DEBUG (normal, NORMAL))
+ {
+ if (! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER))
+ zlog_debug ("%s open active, local address %s", peer->host,
+ sockunion2str (peer->su_local, buf1, SU_ADDRSTRLEN));
+ else
+ zlog_debug ("%s passive open", peer->host);
+ }
if (! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER))
bgp_open_send (peer);
@@ -594,6 +609,12 @@
/* Preserve old status and change into new status. */
peer->ostatus = peer->status;
peer->status = status;
+
+ if (BGP_DEBUG (normal, NORMAL))
+ zlog_debug ("%s went from %s to %s",
+ peer->host,
+ LOOKUP (bgp_status_msg, peer->ostatus),
+ LOOKUP (bgp_status_msg, peer->status));
}
/* Keepalive send to peer. */
@@ -866,12 +887,6 @@
bgp_event_str[event],
LOOKUP (bgp_status_msg, peer->status),
LOOKUP (bgp_status_msg, next));
- if (BGP_DEBUG (normal, NORMAL)
- && strcmp (LOOKUP (bgp_status_msg, peer->status), LOOKUP (bgp_status_msg, next)))
- zlog_debug ("%s went from %s to %s",
- peer->host,
- LOOKUP (bgp_status_msg, peer->status),
- LOOKUP (bgp_status_msg, next));
/* Call function. */
ret = (*(FSM [peer->status - 1][event - 1].func))(peer);