From b729294c8c5c6f2af8ddf6cfbea2374b6faabe9d Mon Sep 17 00:00:00 2001 From: Denis Ovsienko Date: Wed, 8 Dec 2010 18:51:37 +0300 Subject: bgpd: fix community-list error message spelling * bgp_vty.c: (community_list_perror, show_ip_community_list_arg, show_ip_extcommunity_list_arg) fix spelling --- bgpd/bgp_vty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bgpd') diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 88be52e2..ec0106a8 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -9952,7 +9952,7 @@ community_list_perror (struct vty *vty, int ret) switch (ret) { case COMMUNITY_LIST_ERR_CANT_FIND_LIST: - vty_out (vty, "%% Can't find communit-list%s", VTY_NEWLINE); + vty_out (vty, "%% Can't find community-list%s", VTY_NEWLINE); break; case COMMUNITY_LIST_ERR_MALFORMED_VAL: vty_out (vty, "%% Malformed community-list value%s", VTY_NEWLINE); @@ -10313,7 +10313,7 @@ DEFUN (show_ip_community_list_arg, list = community_list_lookup (bgp_clist, argv[0], COMMUNITY_LIST_MASTER); if (! list) { - vty_out (vty, "%% Can't find communit-list%s", VTY_NEWLINE); + vty_out (vty, "%% Can't find community-list%s", VTY_NEWLINE); return CMD_WARNING; } @@ -10663,7 +10663,7 @@ DEFUN (show_ip_extcommunity_list_arg, list = community_list_lookup (bgp_clist, argv[0], EXTCOMMUNITY_LIST_MASTER); if (! list) { - vty_out (vty, "%% Can't find extcommunit-list%s", VTY_NEWLINE); + vty_out (vty, "%% Can't find extcommunity-list%s", VTY_NEWLINE); return CMD_WARNING; } -- cgit v1.2.1 From c7aa8abd8788c3607ad0131f02e892cf92221e40 Mon Sep 17 00:00:00 2001 From: Dmitrij Tejblum Date: Fri, 14 Jan 2011 18:27:05 +0300 Subject: bgpd: fix handling of "Unsupported Capability" * bgp_packet.c: (bgp_notify_receive) justify the difference between BGP_NOTIFY_OPEN_UNSUP_PARAM and BGP_NOTIFY_OPEN_UNSUP_CAPBL cases, as it is explained in RFC5492, page 3, paragraph 1. "Unsupported Capability" error does not mean, that the peer doesn't support capabilities advertisement -- quite the opposite (if the peer would not support capabilities advertisement, the code would be "Unsupported Optional Parameter"). Thus there is no reason to mark the peer as one non-supporting capabilities advertisement. Example: suppose the peer is in fact IPv6-only, but we didn't configure anything address-family specific for it. Then, the peer would refuse the session with "Unsupported Capability" code. If we internally set the peer as non-supporting capabilities advertisement after that, we will not be able to establish the session with it ever, even with a fixed configuration -- IPv6-only BGP session cannot be established without capabilities. In practice an edge case would be seen as the same IPv6 peer working with its "neighbor" block read from bgpd.conf, but not working, when slowly input in "conf t" mode. --- bgpd/bgp_packet.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'bgpd') diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index a5f9552c..9102add7 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -1885,12 +1885,6 @@ bgp_notify_receive (struct peer *peer, bgp_size_t size) bgp_notify.subcode == BGP_NOTIFY_OPEN_UNSUP_PARAM ) UNSET_FLAG (peer->sflags, PEER_STATUS_CAPABILITY_OPEN); - /* Also apply to Unsupported Capability until remote router support - capability. */ - if (bgp_notify.code == BGP_NOTIFY_OPEN_ERR && - bgp_notify.subcode == BGP_NOTIFY_OPEN_UNSUP_CAPBL) - UNSET_FLAG (peer->sflags, PEER_STATUS_CAPABILITY_OPEN); - BGP_EVENT_ADD (peer, Receive_NOTIFICATION_message); } -- cgit v1.2.1 From 6e22b9017e1ae2ce61c383b1b2b63973207704ac Mon Sep 17 00:00:00 2001 From: David Ward Date: Mon, 17 Jan 2011 10:58:52 +0300 Subject: bgpd: VTY string fixes for debug commands * bgpd/bgp_debug.c: fix VTY strings for BGP debug commands to match correct syntax --- bgpd/bgp_debug.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'bgpd') diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c index c2077a59..26b35dfc 100644 --- a/bgpd/bgp_debug.c +++ b/bgpd/bgp_debug.c @@ -331,7 +331,6 @@ ALIAS (no_debug_bgp_as4, undebug_bgp_as4_cmd, "undebug bgp as4", UNDEBUG_STR - DEBUG_STR BGP_STR "BGP AS4 actions\n") @@ -340,6 +339,7 @@ DEFUN (debug_bgp_as4_segment, "debug bgp as4 segment", DEBUG_STR BGP_STR + "BGP AS4 actions\n" "BGP AS4 aspath segment handling\n") { if (vty->node == CONFIG_NODE) @@ -358,6 +358,7 @@ DEFUN (no_debug_bgp_as4_segment, NO_STR DEBUG_STR BGP_STR + "BGP AS4 actions\n" "BGP AS4 aspath segment handling\n") { if (vty->node == CONFIG_NODE) @@ -374,8 +375,8 @@ ALIAS (no_debug_bgp_as4_segment, undebug_bgp_as4_segment_cmd, "undebug bgp as4 segment", UNDEBUG_STR - DEBUG_STR BGP_STR + "BGP AS4 actions\n" "BGP AS4 aspath segment handling\n") DEFUN (debug_bgp_fsm, @@ -417,7 +418,6 @@ ALIAS (no_debug_bgp_fsm, undebug_bgp_fsm_cmd, "undebug bgp fsm", UNDEBUG_STR - DEBUG_STR BGP_STR "Finite State Machine\n") @@ -715,7 +715,6 @@ ALIAS (no_debug_bgp_zebra, undebug_bgp_zebra_cmd, "undebug bgp zebra", UNDEBUG_STR - DEBUG_STR BGP_STR "BGP Zebra messages\n") -- cgit v1.2.1 From 30b0017696dfe300b6ea630a6b6c91ea440d7828 Mon Sep 17 00:00:00 2001 From: John Kemp Date: Fri, 18 Mar 2011 17:52:18 +0300 Subject: bgpd: improve "monotonic" uptime correction Older versions of Quagga/Zebra would output a value in MRT table dump files for "uptime" aka "ORIGINATED" that was a WALL clock value. Given that uptime is now internally a bgp_clock MONOTONIC value, the output in the MRT files is showing up as monotonic. Note: time of MRT dump is still recorded correctly as a time() based value, so we haven't lost that value. Proposal is to correct the uptime output on the vty and in the MRT files to again display something more akin to WALL time. * bgp_dump.c: (bgp_dump_routes_func) add conditional correction * bgp_route.c: (route_vty_out_detail) make correction conditional, move variable declaration to beginning of the function --- bgpd/bgp_dump.c | 4 ++++ bgpd/bgp_route.c | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'bgpd') diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c index 8087a403..edb725a9 100644 --- a/bgpd/bgp_dump.c +++ b/bgpd/bgp_dump.c @@ -356,7 +356,11 @@ bgp_dump_routes_func (int afi, int first_run, unsigned int seq) stream_putw(obuf, info->peer->table_dump_index); /* Originated */ +#ifdef HAVE_CLOCK_MONOTONIC + stream_putl (obuf, time(NULL) - (bgp_clock() - info->uptime)); +#else stream_putl (obuf, info->uptime); +#endif /* HAVE_CLOCK_MONOTONIC */ /* Dump attribute. */ /* Skip prefix & AFI/SAFI for MP_NLRI */ diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 1cfc4511..05c8efc8 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -5979,6 +5979,9 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, char buf1[BUFSIZ]; struct attr *attr; int sockunion_vty_out (struct vty *, union sockunion *); +#ifdef HAVE_CLOCK_MONOTONIC + time_t tbuf; +#endif attr = binfo->attr; @@ -6145,8 +6148,12 @@ route_vty_out_detail (struct vty *vty, struct bgp *bgp, struct prefix *p, bgp_damp_info_vty (vty, binfo); /* Line 7 display Uptime */ - time_t tbuf = time(NULL) - (bgp_clock() - binfo->uptime); +#ifdef HAVE_CLOCK_MONOTONIC + tbuf = time(NULL) - (bgp_clock() - binfo->uptime); vty_out (vty, " Last update: %s", ctime(&tbuf)); +#else + vty_out (vty, " Last update: %s", ctime(&binfo->uptime)); +#endif /* HAVE_CLOCK_MONOTONIC */ } vty_out (vty, "%s", VTY_NEWLINE); } -- cgit v1.2.1