]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agoMerge pull request #746 from qlyoung/vty-outln
Jafar Al-Gharaibeh [Thu, 29 Jun 2017 18:22:37 +0000 (13:22 -0500)]
Merge pull request #746 from qlyoung/vty-outln

vty_outln()

6 years ago*: rebase vty_outln() -> master
Quentin Young [Wed, 28 Jun 2017 16:30:14 +0000 (16:30 +0000)]
*: rebase vty_outln() -> master

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years ago*: vty_outln (vty, "") --> vty_out (vty, VTYNL)
Quentin Young [Wed, 21 Jun 2017 18:10:29 +0000 (18:10 +0000)]
*: vty_outln (vty, "") --> vty_out (vty, VTYNL)

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years ago*: s/VTY_NEWLINE/VTYNL/g
Quentin Young [Wed, 21 Jun 2017 17:15:40 +0000 (17:15 +0000)]
*: s/VTY_NEWLINE/VTYNL/g

Should be able to fit more vty_out onto one line now

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years ago*: use vty_outln
Quentin Young [Wed, 21 Jun 2017 03:10:57 +0000 (03:10 +0000)]
*: use vty_outln

Saves 400 lines

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add vty_outln()
Quentin Young [Wed, 21 Jun 2017 02:47:44 +0000 (02:47 +0000)]
lib: add vty_outln()

Like *.println() in some other unspeakable languages

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #701 from qlyoung/mt-safe-cancel
Russ White [Thu, 29 Jun 2017 15:09:24 +0000 (11:09 -0400)]
Merge pull request #701 from qlyoung/mt-safe-cancel

mt-safe thread_cancel()

6 years agoMerge pull request #735 from qlyoung/fix-routemap
Russ White [Thu, 29 Jun 2017 15:06:52 +0000 (11:06 -0400)]
Merge pull request #735 from qlyoung/fix-routemap

Fix routemap

6 years agoMerge pull request #754 from qlyoung/fix-argv-arg
Russ White [Thu, 29 Jun 2017 15:06:15 +0000 (11:06 -0400)]
Merge pull request #754 from qlyoung/fix-argv-arg

use argv->text where appropriate

6 years agoMerge pull request #759 from qlyoung/remove-vty-argparsers
Jafar Al-Gharaibeh [Thu, 29 Jun 2017 14:36:06 +0000 (09:36 -0500)]
Merge pull request #759 from qlyoung/remove-vty-argparsers

*: remove VTY_GET_*

6 years agoMerge pull request #763 from dslicenc/ospfd-network-statement
Jafar Al-Gharaibeh [Thu, 29 Jun 2017 14:35:36 +0000 (09:35 -0500)]
Merge pull request #763 from dslicenc/ospfd-network-statement

lib/ospf/eigrp: enable ospf and eigrp to use more specific network st…

6 years agoMerge remote-tracking branch 'origin/stable/3.0'
Donald Sharp [Thu, 29 Jun 2017 14:10:15 +0000 (10:10 -0400)]
Merge remote-tracking branch 'origin/stable/3.0'

6 years agoMerge pull request #764 from Jafaral/ospfintaddr
Donald Sharp [Thu, 29 Jun 2017 12:16:30 +0000 (08:16 -0400)]
Merge pull request #764 from Jafaral/ospfintaddr

ospfd: Bring in some OSPF changes lost during Quagga fork

6 years agoospfd: The CLI validates the IP address
Jafar Al-Gharaibeh [Thu, 29 Jun 2017 04:21:14 +0000 (23:21 -0500)]
ospfd: The CLI validates the IP address

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
6 years agoMerge remote-tracking branch 'origin/stable/2.0'
Donald Sharp [Wed, 28 Jun 2017 23:10:20 +0000 (19:10 -0400)]
Merge remote-tracking branch 'origin/stable/2.0'

6 years agoospfd: Bring in some OSPF useful changes that were lost during Quagga fork
Jafar Al-Gharaibeh [Thu, 27 Aug 2009 15:51:42 +0000 (16:51 +0100)]
ospfd: Bring in some OSPF useful changes that were lost during Quagga fork

  Several changes were made from the original patch to resolve conflicts
  and also to fix various issues that were discovered during testing. Below
  is the original commit message minus a few parts that correspond to code
  that was dropped during bug fixing.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
  ospfd: Extend 'ip ospf area' to take address argument + rationalise ospf enable
* ospfd.c: (general) Clean up the whole running of OSPF on interfaces.
  (add_ospf_interface) taking (struct interface *) arg is pointless here.
  (ospf_is_ready) new helper.
  (ospf_network_run_subnet) Put all the code for choosing whether to enable
  OSPF on a subnet, and if so which area configuration to use, here. If a
  subnet should not be enabled, ensure an existing oi is freed.
  (ospf_network_run_interface) Just call run_subnet for all subnets on an
  interface.
  (ospf_network_run) Just call run_interface for all interfaces.
  (ospf_if_update) Just call run_interface for the given interface.
  (ospf_network_unset) Just call run_subnet for existing ois.
  (ospf_update_interface_area) helper: update area on an oi, or create it.
  (ospf_interface_set) renamed to ospf_interface_area_set for clarity.
  Ensures OSPF is created, then into if_update.
  (ospf_interface_unset) renamed to ospf_interface_area_unset and collapses
  down to simple loop to call run_subnet for all ois.
* ospf_interface.h: add a more general OSPF_IF_PARAM_IS_SET, which does the
  right thing and takes default config into account.
* doc/ospfd.texi: add 'ip ospf area' command.

Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
  This patch has been part of Quagga since October 2015

  Orignial Author:    Paul Jakma <paul@quagga.net>
  Date:      Thu Aug 27 16:51:42 2009 +0100

6 years agolib/ospf/eigrp: enable ospf and eigrp to use more specific network statements
Don Slice [Wed, 28 Jun 2017 18:53:27 +0000 (14:53 -0400)]
lib/ospf/eigrp: enable ospf and eigrp to use more specific network statements

Issue reported that a configuration commonly used on other routing implementations
fails in frr.  If under ospf, "network 172.16.1.1/32 area 0" or under eigrp, "network
172.16.1.1/32" is entered, the appropriate interfaces are not included in the routing
protocol.  This was because the code was calling prefix_match, which did not match if
the network statement had a longer mask than the interface being matched.  This fix
takes away that restriction by creating a "lib/prefix_match_network_statement" function
which doesn't care about the mask of the interface.  Manual testing shows both ospf and
eigrp now can be defined with more specific network statements.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agoMerge pull request #753 from dslicenc/cm16876-ospfv6-mtu
Olivier Dugeon [Wed, 28 Jun 2017 14:10:58 +0000 (16:10 +0200)]
Merge pull request #753 from dslicenc/cm16876-ospfv6-mtu

ospf6d: fix ifmtu settings when kernel changes values

6 years agoMerge pull request #756 from opensourcerouting/isis-redist-fixes
Donald Sharp [Wed, 28 Jun 2017 13:55:35 +0000 (09:55 -0400)]
Merge pull request #756 from opensourcerouting/isis-redist-fixes

Isis redist fixes

6 years agoMerge pull request #760 from opensourcerouting/rpm-non-redhat-fix
Donald Sharp [Wed, 28 Jun 2017 13:49:10 +0000 (09:49 -0400)]
Merge pull request #760 from opensourcerouting/rpm-non-redhat-fix

redhat: Fix fallout from PR722 (accidently disabled PIMd on non-Redha…

6 years agoMerge pull request #714 from opensourcerouting/cli_magic_defpy
Donald Sharp [Wed, 28 Jun 2017 13:48:33 +0000 (09:48 -0400)]
Merge pull request #714 from opensourcerouting/cli_magic_defpy

CLI magic: part 1 (DEFPY)

6 years agoospf6d: add buffer length check to ifmtu changes
Don Slice [Wed, 28 Jun 2017 12:37:32 +0000 (08:37 -0400)]
ospf6d: add buffer length check to ifmtu changes

Previous fix was missing the possibility of having to modify the io
buffer size if the kernel reports an new mtu value.  This fix adds
that check.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agoredhat: On CentOS/RedHat 6, use python27-devel from iuscommunity.org
Martin Winter [Wed, 28 Jun 2017 02:49:38 +0000 (19:49 -0700)]
redhat: On CentOS/RedHat 6, use python27-devel from iuscommunity.org

FRR requires now Python 2.7 development libraries, but CentOS 6
does not provide this (not in main and not in EPEL library)
This is only a build limitation.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agoredhat: Fix fallout from PR722 (accidently disabled PIMd on non-Redhat systems)
Martin Winter [Wed, 28 Jun 2017 02:09:59 +0000 (19:09 -0700)]
redhat: Fix fallout from PR722 (accidently disabled PIMd on non-Redhat systems)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agoredhat: python-devel is now a build requirement for main package
Martin Winter [Wed, 28 Jun 2017 01:10:29 +0000 (18:10 -0700)]
redhat: python-devel is now a build requirement for main package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agodebian: python3-dev is now a build requirement for main package
Martin Winter [Wed, 28 Jun 2017 01:09:38 +0000 (18:09 -0700)]
debian: python3-dev is now a build requirement for main package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agodoc: Update to reflect Python Development Library dependency for all builds
Martin Winter [Wed, 28 Jun 2017 01:08:55 +0000 (18:08 -0700)]
doc: Update to reflect Python Development Library dependency for all builds

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agoMerge pull request #722 from drizzt/rpm-fixes-2.0
Martin Winter [Wed, 28 Jun 2017 00:03:44 +0000 (17:03 -0700)]
Merge pull request #722 from drizzt/rpm-fixes-2.0

redhat/frr.spec.in: Avoid expand when possible

6 years ago*: remove VTY_GET_*
Quentin Young [Tue, 27 Jun 2017 18:47:03 +0000 (18:47 +0000)]
*: remove VTY_GET_*

CLI validates input tokens, so there's no need to do it in handler
functions anymore.

spatch follows
----------------

@getull@
expression v;
expression str;
@@
<...
- VTY_GET_ULL(..., v, str)
+ v = strtoull (str, NULL, 10)
...>

@getul@
expression v;
expression str;
@@
<...
- VTY_GET_ULONG(..., v, str)
+ v = strtoul (str, NULL, 10)
...>

@getintrange@
expression name;
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER_RANGE(name, v, str, ...)
+ v = strtoul (str, NULL, 10)
...>

@getint@
expression v;
expression str;
@@
<...
- VTY_GET_INTEGER(..., v, str)
+ v = strtoul (str, NULL, 10)
...>

@getv4@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_ADDRESS(..., v, str)
+ inet_aton (str, &v)
...>

@getv4pfx@
expression v;
expression str;
@@
<...
- VTY_GET_IPV4_PREFIX(..., v, str)
+ str2prefix_ipv4 (str, &v)
...>

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: argv->arg grab bag
Quentin Young [Tue, 27 Jun 2017 17:42:43 +0000 (17:42 +0000)]
bgpd: argv->arg grab bag

* Pass ->text to functions that now do full string matching
* Remove cases for l2vpn and evpn where they cannot occur

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: more cli-ening
Quentin Young [Mon, 26 Jun 2017 19:08:31 +0000 (19:08 +0000)]
bgpd: more cli-ening

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years ago*: use ->text and strmatch where appropriate
Quentin Young [Mon, 26 Jun 2017 18:15:19 +0000 (18:15 +0000)]
*: use ->text and strmatch where appropriate

Still need to go fix all the places where we do a 1-char strncmp...

spatch follows
------------------

@asdf@
expression idx;
@@
<...
 strcmp (
- argv[idx]->arg,
+ argv[idx]->text,
  ...)
...>

@depends on asdf@
expression idx;
@@
<...
- !strcmp (argv[idx]->text,
+ strmatch (argv[idx]->text,
           ...)
...>

@depends on asdf@
expression idx;
expression arg;
@@
<...
- strcmp (argv[idx]->text, arg) == 0
+ strmatch (argv[idx]->text, arg)
...>

@depends on asdf@
expression idx;
expression arg;
@@
<...
- strcmp (argv[idx]->text, arg) != 0
+ !strmatch (argv[idx]->text, arg)
...>

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #757 from donaldsharp/extract_sort
Jafar Al-Gharaibeh [Tue, 27 Jun 2017 15:56:56 +0000 (10:56 -0500)]
Merge pull request #757 from donaldsharp/extract_sort

vtysh: Sort ordering of vtysh_cmd.c

6 years agoMerge pull request #748 from qlyoung/fix-vtysh-exit
Jafar Al-Gharaibeh [Tue, 27 Jun 2017 15:47:45 +0000 (10:47 -0500)]
Merge pull request #748 from qlyoung/fix-vtysh-exit

lib: actually exit when asked to 'do' so

6 years agoMerge pull request #747 from qlyoung/fix-various-vtysh-do
Jafar Al-Gharaibeh [Tue, 27 Jun 2017 15:46:21 +0000 (10:46 -0500)]
Merge pull request #747 from qlyoung/fix-various-vtysh-do

vtysh: fix various show commands

6 years agoMerge pull request #709 from opensourcerouting/ldpd-dual-stack
ßingen [Tue, 27 Jun 2017 13:37:52 +0000 (15:37 +0200)]
Merge pull request #709 from opensourcerouting/ldpd-dual-stack

ldpd: fix issues with dual-stack adjacencies

6 years agovtysh: Sort ordering of vtysh_cmd.c
Donald Sharp [Tue, 27 Jun 2017 12:15:45 +0000 (08:15 -0400)]
vtysh: Sort ordering of vtysh_cmd.c

When we created the vtysh_cmd.c file the vtysh_cmd.c output
is slightly different for every run, even when none of the
inputs have changed.

Add the ability to sort the output so that the output is
the same for every build.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #749 from qlyoung/fix-json-cli
Jafar Al-Gharaibeh [Mon, 26 Jun 2017 19:18:56 +0000 (14:18 -0500)]
Merge pull request #749 from qlyoung/fix-json-cli

lib: look at the correct token for json

6 years agoospf6d: fix ifmtu settings when kernel changes values
Don Slice [Thu, 22 Jun 2017 16:17:24 +0000 (09:17 -0700)]
ospf6d: fix ifmtu settings when kernel changes values

Problem reported by customer that if an mtu value was set in the kernel,
quagga/frr would get very confused about what had been configured and
what had been learned.  This caused peers to not be successfully established.
Resolved by keeping a configuration value separate than the operational value
and set the operational accordingly.  If configured, it wins unless the config
defines a value that is higher than the kernel supports.

Ticket: CM-16876
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed By: CCR-6399
Testing Done: Manual testing successful, submitter tested, ospf-smoke completed
with no new failures.

6 years agoMerge pull request #704 from chiragshah6/pim_dev_3_0
Jafar Al-Gharaibeh [Fri, 23 Jun 2017 15:29:27 +0000 (10:29 -0500)]
Merge pull request #704 from chiragshah6/pim_dev_3_0

ospfd: ospf bandwidth handling

6 years agolib: look at the correct token for json
Quentin Young [Thu, 22 Jun 2017 00:19:24 +0000 (00:19 +0000)]
lib: look at the correct token for json

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: actually exit when asked to do so
Quentin Young [Wed, 21 Jun 2017 20:06:44 +0000 (20:06 +0000)]
lib: actually exit when asked to do so

When vtysh sends 'exit' to a daemon, we set the vty->status to
VTY_CLOSE but never actually close the connection. Lovely.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agovtysh: fix various show commands
Quentin Young [Wed, 21 Jun 2017 18:42:17 +0000 (18:42 +0000)]
vtysh: fix various show commands

need 'do' to force ENABLE_NODE

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #745 from qlyoung/fix-lookup
Olivier Dugeon [Wed, 21 Jun 2017 16:22:52 +0000 (18:22 +0200)]
Merge pull request #745 from qlyoung/fix-lookup

*: simplify log message lookup

6 years agolib: some minor cli fixups for routemap
Quentin Young [Wed, 21 Jun 2017 15:41:35 +0000 (15:41 +0000)]
lib: some minor cli fixups for routemap

Need to use the appropriate token field

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years ago*: simplify log message lookup
Quentin Young [Tue, 20 Jun 2017 23:56:50 +0000 (23:56 +0000)]
*: simplify log message lookup

log.c provides functionality for associating a constant (typically a
protocol constant) with a string and finding the string given the
constant. However this is highly delicate code that is extremely prone
to stack overflows and off-by-one's due to requiring the developer to
always remember to update the array size constant and to do so correctly
which, as shown by example, is never a good idea.b

The original goal of this code was to try to implement lookups in O(1)
time without a linear search through the message array. Since this code
is used 99% of the time for debugs, it's worth the 5-6 additional cmp's
worst case if it means we avoid explitable bugs due to oversights...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoisisd: fix to adhere to new cli api
Christian Franke [Tue, 20 Jun 2017 20:49:37 +0000 (22:49 +0200)]
isisd: fix to adhere to new cli api

6 years agoisisd: fix memtype counting issue
Christian Franke [Tue, 20 Jun 2017 20:48:36 +0000 (22:48 +0200)]
isisd: fix memtype counting issue

6 years agoisisd: adjust redist functionality to current zapi
Christian Franke [Tue, 20 Jun 2017 20:47:54 +0000 (22:47 +0200)]
isisd: adjust redist functionality to current zapi

6 years agoisisd: fix formatting in metrics when showing database
Christian Franke [Tue, 20 Jun 2017 20:46:41 +0000 (22:46 +0200)]
isisd: fix formatting in metrics when showing database

6 years agoMerge pull request #741 from qlyoung/fix-vtysh-buffer-overrun
Russ White [Tue, 20 Jun 2017 02:02:49 +0000 (22:02 -0400)]
Merge pull request #741 from qlyoung/fix-vtysh-buffer-overrun

vtysh: fix stack buffer overflow

6 years agoMerge pull request #698 from dslicenc/cm16737-srgb-block
Russ White [Tue, 20 Jun 2017 02:00:57 +0000 (22:00 -0400)]
Merge pull request #698 from dslicenc/cm16737-srgb-block

zebra: define default segment routing global block values

6 years agoMerge pull request #707 from donaldsharp/debian_babel
Russ White [Tue, 20 Jun 2017 01:58:36 +0000 (21:58 -0400)]
Merge pull request #707 from donaldsharp/debian_babel

tools: Fix startup to include babel

6 years agoMerge pull request #728 from donaldsharp/owner
Russ White [Tue, 20 Jun 2017 01:55:43 +0000 (21:55 -0400)]
Merge pull request #728 from donaldsharp/owner

bgpd: Remove unset table.owner

6 years agoMerge pull request #731 from qlyoung/fix-bgp-misc-cli
Russ White [Tue, 20 Jun 2017 01:53:05 +0000 (21:53 -0400)]
Merge pull request #731 from qlyoung/fix-bgp-misc-cli

bgpd: fix misc cli ranges & config writes

6 years agoMerge pull request #732 from qlyoung/coverity-memes
Russ White [Tue, 20 Jun 2017 01:52:10 +0000 (21:52 -0400)]
Merge pull request #732 from qlyoung/coverity-memes

lib: termtable coverity warnings

6 years agoMerge pull request #730 from opensourcerouting/rbtree-improvement
Donald Sharp [Mon, 19 Jun 2017 21:27:55 +0000 (17:27 -0400)]
Merge pull request #730 from opensourcerouting/rbtree-improvement

RB tree improvement

6 years agovtysh: fix stack buffer overflow
Quentin Young [Mon, 19 Jun 2017 20:34:22 +0000 (20:34 +0000)]
vtysh: fix stack buffer overflow

VARIABLE accepts arbitrary input

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: fix __unused compilation on old platforms
Rafael Zalamena [Mon, 19 Jun 2017 16:24:04 +0000 (13:24 -0300)]
lib: fix __unused compilation on old platforms

Expand the macro __attribute__ to avoid problem with old platforms that
do not define this.

6 years agolib: rename rb_tree to fix NetBSD compilation
Rafael Zalamena [Mon, 19 Jun 2017 16:17:35 +0000 (13:17 -0300)]
lib: rename rb_tree to fix NetBSD compilation

Change rb_tree struct name to rbt_tree to avoid conflicts with NetBSD.

6 years agoospfd: fix route-map brokenness
Quentin Young [Fri, 16 Jun 2017 22:43:56 +0000 (22:43 +0000)]
ospfd: fix route-map brokenness

ospf redefines the standard route map commands which causes ambiguity
issues in the CLI parser, it also uses a signed integer to hold an
unsigned quantity leading to weirdness when specifying metrics larger
than 2,147,483,647

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: improve routemap error messages
Quentin Young [Fri, 16 Jun 2017 22:43:09 +0000 (22:43 +0000)]
lib: improve routemap error messages

indicate which daemon was the source of the message and that it may be a
question of daemon support rather than a malformed argument

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: Fix ordering of RB Tree
Donald Sharp [Fri, 16 Jun 2017 21:40:17 +0000 (17:40 -0400)]
lib: Fix ordering of RB Tree

So the *bsd implementations of RB Tree's for older
platforms use a macro implementation.  New platforms
have converted to a function implementation that uses
a different calling parameter list.  So when
we attempt to build FRR on older *bsd implementations
the macro's and functions do not interact too well.

As a workaround put the openbsd-tree.h #include
inside of zebra.h at a point before the particular
platforms version is included.  Since we use
the same #if guard for the header we should be ok.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoldpd: fix fallouts from the rb-tree conversion
Renato Westphal [Fri, 16 Jun 2017 20:30:35 +0000 (17:30 -0300)]
ldpd: fix fallouts from the rb-tree conversion

Signed-off-by: Renato Westphal <renato@openbsd.org>
6 years agoMerge pull request #725 from donaldsharp/vrf_completion
David Lamparter [Fri, 16 Jun 2017 19:59:23 +0000 (21:59 +0200)]
Merge pull request #725 from donaldsharp/vrf_completion

Vrf completion

6 years agolib: tighten up exit semantics for thread_fetch()
Quentin Young [Wed, 14 Jun 2017 17:06:10 +0000 (17:06 +0000)]
lib: tighten up exit semantics for thread_fetch()

* Account for the pipe poker in poll() by explicitly returning NULL when
  we have no events, timers or file descriptors to work with
* Add a comment explaining exactly what we are doing and why

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: mt-safe cancel, round deux
Quentin Young [Fri, 9 Jun 2017 03:40:27 +0000 (03:40 +0000)]
lib: mt-safe cancel, round deux

* Update pollfds copy as well as the original
* Keep array count for copy in thread_master
* Remove last remnants of POLLHUP in .events field
* Remove unused snmpcount (lolwut)
* Improve docs
* Add missing do_thread_cancel() call in thread_cancel_event()
* Change thread_fetch() to always enter poll() to avoid starving i/o
* Remember to free up cancel_req when destroying thread_master
* Fix dereference of null pointer
* Fix dead store to timeval
* Fix missing condition for condition variable :-)

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add mt-safe thread_cancel
Quentin Young [Wed, 7 Jun 2017 20:34:09 +0000 (20:34 +0000)]
lib: add mt-safe thread_cancel

This patch implements an MT-safe version of thread_cancel() in
thread_cancel_async(). Behavior as follows:

* Cancellation requests are queued into a list

* Cancellation requests made from the same pthread as the thread_master
  owner are serviced immediately (thread_cancel())

* Cancellation requests made from a separate pthread are queued and the
  call blocks on a condition variable until the owning pthread services
  the request, at which point the condition variable is signaled and
  execution continues (thread_cancel_async())

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #702 from opensourcerouting/ldpd-cli-rewrite
Quentin Young [Fri, 16 Jun 2017 19:53:50 +0000 (15:53 -0400)]
Merge pull request #702 from opensourcerouting/ldpd-cli-rewrite

ldpd: convert cli and get rid of the xml interface

6 years agobgpd: fix misc cli ranges & config writes
Quentin Young [Fri, 16 Jun 2017 18:03:34 +0000 (18:03 +0000)]
bgpd: fix misc cli ranges & config writes

* Ranges for some MED were 2^32 - 2 instead of 2^32 - 1
* Use correct printf specifiers for unsigned values
* Some drive-by CLI collapsing and simplification

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: termtable coverity warnings
Quentin Young [Fri, 16 Jun 2017 19:04:57 +0000 (19:04 +0000)]
lib: termtable coverity warnings

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoldpd: update copyright information
Renato Westphal [Mon, 12 Jun 2017 19:30:54 +0000 (16:30 -0300)]
ldpd: update copyright information

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agoldpd: convert cli and get rid of the xml interface
Renato Westphal [Mon, 12 Jun 2017 14:39:12 +0000 (11:39 -0300)]
ldpd: convert cli and get rid of the xml interface

The xml2cli.pl script was useful years ago when the vty code was very
rudimentary. This is not the case anymore, so convert all ldpd CLI
commands to use DEFUNs directly and get rid of the XML interface.

The benefits are:
* Consistency with the other daemons;
* One less build dependency (the LibXML perl module);
* Easier to add new commands.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agoMerge pull request #713 from qlyoung/fix-zebra-dbz-3.0
David Lamparter [Fri, 16 Jun 2017 17:40:52 +0000 (19:40 +0200)]
Merge pull request #713 from qlyoung/fix-zebra-dbz-3.0

Fix zebra div by zero

6 years agobgpd: Fix as per Code Review comment
Donald Sharp [Fri, 16 Jun 2017 17:11:12 +0000 (13:11 -0400)]
bgpd: Fix as per Code Review comment

Add ending value in the array.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib, vtysh, zebra: Fix per CR comments
Donald Sharp [Fri, 16 Jun 2017 17:09:37 +0000 (13:09 -0400)]
lib, vtysh, zebra: Fix per CR comments

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Add view/vrf auto completion to commands
Donald Sharp [Thu, 15 Jun 2017 17:48:06 +0000 (13:48 -0400)]
bgpd: Add view/vrf auto completion to commands

Modify the '<view|vrf> NAME' commands to allow auto-completion
of available choices.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years ago*: Add vrf autocompletion for commands
Donald Sharp [Thu, 15 Jun 2017 17:43:26 +0000 (13:43 -0400)]
*: Add vrf autocompletion for commands

Switch NAME to VRFNAME and add vrf autocompletion
to commands that have them

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: more dbzing
Quentin Young [Fri, 16 Jun 2017 16:18:54 +0000 (16:18 +0000)]
zebra: more dbzing

Revert to the previous <= restrictions, improve error messages, fix the
divide by zero.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #718 from qlyoung/fix-vtysh-shit
David Lamparter [Fri, 16 Jun 2017 16:25:48 +0000 (18:25 +0200)]
Merge pull request #718 from qlyoung/fix-vtysh-shit

lib: allow 'do' commands in ENABLE_NODE

6 years agoMerge pull request #726 from chiragshah6/pim_dev
David Lamparter [Fri, 16 Jun 2017 16:24:38 +0000 (18:24 +0200)]
Merge pull request #726 from chiragshah6/pim_dev

pimd: move variable declartion outside of switch

6 years agoMerge pull request #620 from qlyoung/termtable
David Lamparter [Fri, 16 Jun 2017 16:23:14 +0000 (18:23 +0200)]
Merge pull request #620 from qlyoung/termtable

lib: add table generator

6 years agolib: allow 'do' commands in ENABLE_NODE
Quentin Young [Wed, 14 Jun 2017 19:47:14 +0000 (19:47 +0000)]
lib: allow 'do' commands in ENABLE_NODE

'do' is syntax sugar that allows the user to execute a command under
ENABLE_NODE when in another CLI node. If the user is already in
ENABLE_NODE, use of 'do' was previously disallowed. This patch allows it
because it makes it easier for us to hack around certain instances of
the node synchronization problem with vtysh.

Also included is a fix for one of these problems.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: fix a possible NULL deference
Rafael Zalamena [Fri, 16 Jun 2017 14:08:43 +0000 (11:08 -0300)]
lib: fix a possible NULL deference

Silences a warning generated by clang.

6 years agolib: improve the RB implementation
Rafael Zalamena [Fri, 16 Jun 2017 13:44:31 +0000 (10:44 -0300)]
lib: improve the RB implementation

Switch the RB tree implementation completely to the new dlg@'s version
that uses pre-declared functions instead of macros for tree functions.

Original e-mail/diff:
https://marc.info/?l=openbsd-tech&m=147087487111068&w=2

Pros:

* Reduces the amount of code that the usage of those macros generate
* Allows the compiler to do a better compile-time check job
* Might have better i-cache utilization since the tree code is shared

Con:

* dlg@ benchmarks shows it has 'very slightly slower' insertions
* imported RB_* code must adapt the following calls:
  RB_INIT(), RB_GENERATE(), RB_ROOT(), RB_EMPTY(), make compare
  functions use 'const' (if not already) and maybe others.

6 years agolib: termtable MTYPE_TMP -> MTYPE_TTABLE
Quentin Young [Thu, 15 Jun 2017 21:02:28 +0000 (21:02 +0000)]
lib: termtable MTYPE_TMP -> MTYPE_TTABLE

And some style nits.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add table generator
Quentin Young [Wed, 24 May 2017 02:01:00 +0000 (02:01 +0000)]
lib: add table generator

Allows for easy preparation of tabular output.

Supports:
 -- Padding
 -- Alignment
 -- Styling

6 years agobgpd: Remove unset table.owner
Donald Sharp [Fri, 16 Jun 2017 01:34:19 +0000 (21:34 -0400)]
bgpd: Remove unset table.owner

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: move variable declartion outside of switch
Chirag Shah [Thu, 15 Jun 2017 19:20:59 +0000 (12:20 -0700)]
pimd: move variable declartion outside of switch

To Address ICC (intel CC) warning, moving variables
declaration out of switch statement.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #711 ("Coverity munging")
David Lamparter [Thu, 15 Jun 2017 14:22:42 +0000 (16:22 +0200)]
Merge pull request #711 ("Coverity munging")

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agoospfd: fix typo in error message
David Lamparter [Thu, 15 Jun 2017 14:21:58 +0000 (16:21 +0200)]
ospfd: fix typo in error message

... and print the invalid input value

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agoMerge pull request #705 from dwalton76/bgpd-show-neighbor-community
Lou Berger [Thu, 15 Jun 2017 13:21:44 +0000 (09:21 -0400)]
Merge pull request #705 from dwalton76/bgpd-show-neighbor-community

bgpd: "no neighbor x.x.x.x send-community" not displayed correctly

6 years agoredhat/frr.spec.in: Avoid expand when possible
Timothy Redaelli [Thu, 15 Jun 2017 10:15:30 +0000 (12:15 +0200)]
redhat/frr.spec.in: Avoid expand when possible

expand + running shell commands doesn't work very well when building on mock

6 years agoMerge pull request #720 from donaldsharp/arm_2.0
Martin Winter [Thu, 15 Jun 2017 01:48:57 +0000 (18:48 -0700)]
Merge pull request #720 from donaldsharp/arm_2.0

bgpd: Fix arm warn -> werror issue

6 years agobgpd: Fix arm warn -> werror issue
Donald Sharp [Thu, 15 Jun 2017 00:32:54 +0000 (20:32 -0400)]
bgpd: Fix arm warn -> werror issue

Fixes #719

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoospfd: correct typo in zebra trace
Chirag Shah [Wed, 14 Jun 2017 20:30:08 +0000 (13:30 -0700)]
ospfd: correct typo in zebra trace

added comment around which bw value used.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agolib: fix protocol name array size
David Lamparter [Wed, 14 Jun 2017 18:53:06 +0000 (20:53 +0200)]
lib: fix protocol name array size

Oops.  Fixes #715.

Reported-by: Daniel Walton <dwalton@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agoMerge pull request #716 from dwalton76/show-route-map
David Lamparter [Wed, 14 Jun 2017 19:07:24 +0000 (21:07 +0200)]
Merge pull request #716 from dwalton76/show-route-map

lib: "show route-map" is missing from the parser

6 years agolib: "show route-map" is missing from the parser
Daniel Walton [Wed, 14 Jun 2017 18:21:17 +0000 (18:21 +0000)]
lib: "show route-map" is missing from the parser

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
6 years agolib: fix CLI parser memleak
David Lamparter [Wed, 14 Jun 2017 15:34:57 +0000 (17:34 +0200)]
lib: fix CLI parser memleak

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>