diff options
author | Chris Hall <chris.hall@highwayman.com> | 2011-03-29 14:22:37 +0100 |
---|---|---|
committer | Chris Hall <chris.hall@highwayman.com> | 2011-03-29 14:22:37 +0100 |
commit | 7e666be965b3ac61b05ccdeca2b61902bc26e172 (patch) | |
tree | dc4c1b7985b1aa3dfd16b59c70567f62ab535fd6 | |
parent | f9956b9524ddafdb9d0cec042213eaa8229aad8c (diff) | |
parent | e20f7ccd9e110fcd5deb945f8d23922efd8b0822 (diff) | |
download | quagga-ex16p.tar.bz2 quagga-ex16p.tar.xz |
Merge branch 'master' of /git/quagga.euro-ix into pipeworkex16p
This ensures that the two branches are consistent after the merging
of the old-Quagga 0.99.18 changes.
Release: 0.99.18ex16p.
Eliminated some whitespace differences !
Collected RESTRICTED_NODE show_bgp_ipv6_safi_route_cmd and
show_bgp_ipv6_safi_prefix_cmd, and one HAVE_IPV6 skip. Also releasing
filename in closezlog().
Removed strlen() from lib/qfstring.c for async-signal-safe purposes.
-rw-r--r-- | bgpd/bgp_route.c | 10 | ||||
-rwxr-xr-x | configure.ac | 2 | ||||
-rw-r--r-- | doc/bgpd.texi | 23 | ||||
-rw-r--r-- | doc/main.texi | 4 | ||||
-rw-r--r-- | doc/routemap.texi | 14 | ||||
-rw-r--r-- | lib/command.c | 3 | ||||
-rw-r--r-- | lib/log.c | 3 | ||||
-rw-r--r-- | lib/memory.c | 2 | ||||
-rw-r--r-- | lib/qfstring.c | 40 | ||||
-rw-r--r-- | lib/qtime.c | 33 | ||||
-rw-r--r-- | lib/thread.c | 12 | ||||
-rw-r--r-- | lib/vio_fifo.c | 2 | ||||
-rw-r--r-- | lib/workqueue.h | 2 | ||||
-rw-r--r-- | tests/test-vector.c | 4 |
14 files changed, 83 insertions, 71 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index bb330ee7..b4f57419 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -11550,7 +11550,7 @@ DEFUN (show_ip_bgp_view_rsclient_prefix, if (argc == 3) peer = peer_lookup_in_view (vty, argv[0], argv[1]); else - peer = peer_lookup_in_view (vty, NULL, argv[0]); + peer = peer_lookup_in_view (vty, NULL, argv[0]); if (! peer) return CMD_WARNING; @@ -11639,11 +11639,11 @@ DEFUN (show_bgp_view_ipv4_safi_rsclient_prefix, vty_out (vty, "%% Activate the neighbor for the address family first%s", VTY_NEWLINE); return CMD_WARNING; -} + } if ( ! CHECK_FLAG (peer->af_flags[AFI_IP][safi], PEER_FLAG_RSERVER_CLIENT)) -{ + { vty_out (vty, "%% Neighbor is not a Route-Server client%s", VTY_NEWLINE); return CMD_WARNING; @@ -13463,8 +13463,10 @@ bgp_route_init (void) */ install_element (RESTRICTED_NODE, &show_bgp_route_cmd); install_element (RESTRICTED_NODE, &show_bgp_ipv6_route_cmd); + install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_route_cmd); install_element (RESTRICTED_NODE, &show_bgp_prefix_cmd); install_element (RESTRICTED_NODE, &show_bgp_ipv6_prefix_cmd); + install_element (RESTRICTED_NODE, &show_bgp_ipv6_safi_prefix_cmd); install_element (RESTRICTED_NODE, &show_bgp_community_cmd); install_element (RESTRICTED_NODE, &show_bgp_ipv6_community_cmd); install_element (RESTRICTED_NODE, &show_bgp_community2_cmd); @@ -13743,8 +13745,10 @@ bgp_route_init (void) install_element (BGP_IPV4M_NODE, &no_bgp_network_mask_backdoor_ttl_cmd); install_element (BGP_IPV4M_NODE, &no_bgp_network_mask_natural_backdoor_ttl_cmd); +#ifdef HAVE_IPV6 install_element (BGP_IPV6_NODE, &ipv6_bgp_network_ttl_cmd); install_element (BGP_IPV6_NODE, &no_ipv6_bgp_network_ttl_cmd); +#endif } void diff --git a/configure.ac b/configure.ac index 8bbc7e47..1efe342e 100755 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ ## $Id$ AC_PREREQ(2.53) -AC_INIT(Quagga, 0.99.18ex15p, [http://bugzilla.quagga.net]) +AC_INIT(Quagga, 0.99.18ex16p, [http://bugzilla.quagga.net]) AC_CONFIG_SRCDIR(lib/zebra.h) AC_CONFIG_MACRO_DIR([m4]) diff --git a/doc/bgpd.texi b/doc/bgpd.texi index 40156b7f..e7463300 100644 --- a/doc/bgpd.texi +++ b/doc/bgpd.texi @@ -149,29 +149,6 @@ routes if they aren't present in their IGP routing tables; @code{bgpd} doesn't care about IGP routes when announcing its routes. @end deffn -@deffn {BGP} {network @var{A.B.C.D/M} pathlimit <0-255>} {} -This command configures a route to be originated into BGP, just as with the -previous command, but additionally sets an AS-Pathlimit TTL to be advertised -on the route. See draft-ietf-idr-as-pathlimit. - -Specifying a TTL of 0 can be used to remove pathlimit from a previously -configured network statement. - -Note that when advertising prefixes with AS-Pathlimit set, all less-specific -prefixes advertised SHOULD also have the Atomic-Aggregate attribute set. -Failure to do so increases the risks of accidental routing loops occuring. - -This implementation will try to automatically set Atomic-Aggregate as -appropriate on any less-specific prefixes originated by the same speaker, -however it will not (and often can not) do so where @b{other} speakers in -the AS are originating more specifics. - -Hence the system administrator must take care to ensure that all -less-specific prefixes originated carry atomic-aggregate as appropriate, by -manually configuring speakers originating less-specifics to set -Atomic-Aggregate on those advertisements! -@end deffn - @deffn {BGP} {no network @var{A.B.C.D/M}} {} @end deffn diff --git a/doc/main.texi b/doc/main.texi index 9966b356..a5759137 100644 --- a/doc/main.texi +++ b/doc/main.texi @@ -49,9 +49,9 @@ Up or down the current interface. @end deffn @deffn {Interface Command} {ip address @var{address/prefix}} {} -@deffnx {Interface Command} {ip6 address @var{address/prefix}} {} +@deffnx {Interface Command} {ipv6 address @var{address/prefix}} {} @deffnx {Interface Command} {no ip address @var{address/prefix}} {} -@deffnx {Interface Command} {no ip6 address @var{address/prefix}} {} +@deffnx {Interface Command} {no ipv6 address @var{address/prefix}} {} Set the IPv4 or IPv6 address/prefix for the interface. @end deffn diff --git a/doc/routemap.texi b/doc/routemap.texi index 9ac001c4..db3e72d2 100644 --- a/doc/routemap.texi +++ b/doc/routemap.texi @@ -155,10 +155,6 @@ Matches the specified @var{metric}. Matches the specified @var{community_list} @end deffn -@deffn {Route-map Command} {match pathlimit as @var{ASN}} {} -Matches the specified AS-Pathlimit @var{ASN}. -@end deffn - @node Route Map Set Command @section Route Map Set Command @@ -194,16 +190,6 @@ Set the BGP-4+ global IPv6 nexthop address. Set the BGP-4+ link local IPv6 nexthop address. @end deffn -@deffn {Route-map Command} {set pathlimit ttl @var{ttl}} {} -Sets the specified AS-Pathlimit @var{ttl} on the route. This will also cause -the AS to be set to the local AS. - -Note that the AS-Pathlimit RFC specifies that speakers advertising this -attribute should set Atomic-aggregate on all less specific routes. Setting -AS-Pathlimit by route-map does not do this, the user must do so themselves, -as they wish. -@end deffn - @node Route Map Call Command @section Route Map Call Command diff --git a/lib/command.c b/lib/command.c index 1fc85344..4057bcfc 100644 --- a/lib/command.c +++ b/lib/command.c @@ -54,7 +54,7 @@ Boston, MA 02111-1307, USA. */ vector node_vector = NULL ; /*============================================================================== - * Default motd string. + * Default motd string and debug hello message. */ static const char* default_motd = "\n" @@ -2285,6 +2285,7 @@ cmd_init (bool terminal) install_element (RESTRICTED_NODE, &show_thread_cpu_cmd); install_element (VIEW_NODE, &show_thread_cpu_cmd); install_element (ENABLE_NODE, &show_thread_cpu_cmd); + install_element (ENABLE_NODE, &clear_thread_cpu_cmd); install_element (VIEW_NODE, &show_work_queues_cmd); install_element (ENABLE_NODE, &show_work_queues_cmd); @@ -985,6 +985,9 @@ closezlog (struct zlog *zl) uzlog_set_effective_level(zl) ; + if (zl->filename != NULL) + free (zl->filename); + XFREE (MTYPE_ZLOG, zl); } diff --git a/lib/memory.c b/lib/memory.c index 10e107a3..ef8551cd 100644 --- a/lib/memory.c +++ b/lib/memory.c @@ -150,6 +150,8 @@ zmalloc (enum MTYPE mtype, size_t size MEMORY_TRACKER_NAME) /*------------------------------------------------------------------------------ * Memory allocation zeroising the allocated area. + * + * As zmalloc, plus zeroises the allocated memory. */ void * zcalloc (enum MTYPE mtype, size_t size MEMORY_TRACKER_NAME) diff --git a/lib/qfstring.c b/lib/qfstring.c index 25558797..2d5f69cc 100644 --- a/lib/qfstring.c +++ b/lib/qfstring.c @@ -523,23 +523,41 @@ qfs_number(qf_str qfs, uintmax_t val, int sign, enum pf_flags flags, /* Set up any required sign and radix prefix */ if ((flags & pf_unsigned) || (sign == 0)) - sign_str = "" ; + { + sign_str = "" ; + sign_len = 0 ; + } else if (sign < 0) - sign_str = "-" ; + { + sign_str = "-" ; + sign_len = 1 ; + } else if (flags & pf_plus) - sign_str = "+" ; + { + sign_str = "+" ; + sign_len = 1 ; + } else if (flags & pf_space) - sign_str = " " ; + { + sign_str = " " ; + sign_len = 1 ; + } else - sign_str = "" ; - - sign_len = strlen(sign_str) ; + { + sign_str = "" ; + sign_len = 0 ; + } ; - radix_str = "" ; if ((flags & (pf_hex | pf_alt)) == (pf_hex | pf_alt)) - radix_str = (flags & pf_uc) ? "0X" : "0x" ; - - radix_len = strlen(radix_str) ; + { + radix_str = (flags & pf_uc) ? "0X" : "0x" ; + radix_len = 2 ; + } + else + { + radix_str = "" ; + radix_len = 0 ; + } ; /* Turn off zero fill if left justify (width < 0) */ if (width < 0) diff --git a/lib/qtime.c b/lib/qtime.c index 789ced1e..d1283198 100644 --- a/lib/qtime.c +++ b/lib/qtime.c @@ -72,15 +72,37 @@ * (But seems unlikely that such a system would not support CLOCK_MONOTONIC !) * * When clock_t is a 32-bit integer must be at least ready for wrap around. - * There are two cases: + * We take the clock_t signed values and widen to 64-bit signed, so we have + * the current sample (this) and the previous one (last), and two cases to + * consider: * - * * +ve wrap around. new < old value, and new >= 0 + * * +ve wrap around -- so value is 31-bit unsigned, and wraps from large + * +ve value to small +ve value. * - * step = (INT32_MAX - old + 1) + new + * step = this - last will be -ve * - * * -ve wrap around. new < old value, and new < 0 (and old > 0) + * 'last' will be some value ((INT32_MAX + 1) - x), and 'this' will be some + * (relatively) small value y. The step is x + y, we have: * - * step = (INT32_MAX - old + 1) - (INT32_MIN - new) + * step = y - ((INT32_MAX + 1) - x) = (x + y) - (INT32_MAX + 1) + * + * so we correct by adding (INT32_MAX + 1). + * + * * -ve wrap around -- so value is 32-bit signed, and wraps from a large + * +ve value to a very -ve value. + * + * step = this - last will be -ve + * + * 'last will' be some value (INT32_MAX + 1) - x, and 'this' will be some + * value (y - (INT32_MAX + 1)). The step is x + y, we have: + * + * step = (y - (INT32_MAX + 1)) - ((INT32_MAX + 1) - x) + * = (x + y) - 2 * (INT32_MAX + 1) + * + * so we correct by adding (INT32_MAX + 1). + * + * In both cases the wrap around gives an apparently -ve 'step', and that is + * corrected by adding (INT32_MAX + 1) until it goes +ve. * * In any event, a step > 24 hours is taken to means that something has gone * very, very badly wrong. @@ -340,4 +362,3 @@ qt_random(uint32_t seed) * or the last entry, and have done with it. */ - diff --git a/lib/thread.c b/lib/thread.c index 90aad4ba..b9fd603c 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -1280,13 +1280,13 @@ thread_fetch (struct thread_master *m, struct thread *fetch) /* Calculate select wait timer if nothing else to do */ if (m->ready.count == 0) { - quagga_get_relative (NULL); - timer_wait = thread_timer_wait (&m->timer, &timer_val); - timer_wait_bg = thread_timer_wait (&m->background, &timer_val_bg); + quagga_get_relative (NULL); + timer_wait = thread_timer_wait (&m->timer, &timer_val); + timer_wait_bg = thread_timer_wait (&m->background, &timer_val_bg); - if (timer_wait_bg && - (!timer_wait || (timeval_cmp (*timer_wait, *timer_wait_bg) > 0))) - timer_wait = timer_wait_bg; + if (timer_wait_bg && + (!timer_wait || (timeval_cmp (*timer_wait, *timer_wait_bg) > 0))) + timer_wait = timer_wait_bg; } else { diff --git a/lib/vio_fifo.c b/lib/vio_fifo.c index 52e0d2df..65f19411 100644 --- a/lib/vio_fifo.c +++ b/lib/vio_fifo.c @@ -332,7 +332,7 @@ vio_fifo_new(ulen size) if (vio_fifo_debug) size = 29 ; - total_size = offsetof(struct vio_fifo, own_lump->data[size]) ; + total_size = offsetof(struct vio_fifo, own_lump[0].data[size]) ; vff = XCALLOC(MTYPE_VIO_FIFO, total_size) ; diff --git a/lib/workqueue.h b/lib/workqueue.h index 15e08804..46f27734 100644 --- a/lib/workqueue.h +++ b/lib/workqueue.h @@ -27,7 +27,7 @@ #include "misc.h" /* Hold time for the initial schedule of a queue run, in millisec */ -enum { WORK_QUEUE_DEFAULT_HOLD = 50 } ; +enum { WORK_QUEUE_DEFAULT_HOLD = 50 } ; /* action value, for use by item processor and item error handlers */ typedef enum diff --git a/tests/test-vector.c b/tests/test-vector.c index e95e3c58..7d2121cc 100644 --- a/tests/test-vector.c +++ b/tests/test-vector.c @@ -25,7 +25,7 @@ void test_vector_insert_item(void); void test_vector_insert_item_here(void); void test_vector_delete_item(void); void do_test_insert(const int rider); -int sort_cmp(void const* const* a, void const* const* b); +int sort_cmp(const void* const* a, const void* const* b); void test_vector_sort(void); void test_vector_bsearch(void); void test_vector_move_item_here(void); @@ -550,7 +550,7 @@ test_vector_sort(void) } int -sort_cmp(void const* const* a, void const* const* b) +sort_cmp(const void* const* a, const void* const* b) { return strcmp(*a, *b); } |