]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agoldpd: use red-black trees to store 'adj' elements
Renato Westphal [Wed, 14 Dec 2016 19:39:28 +0000 (17:39 -0200)]
ldpd: use red-black trees to store 'adj' elements

Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: use red-black trees to store 'l2vpn_pw' elements
Renato Westphal [Wed, 14 Dec 2016 15:53:07 +0000 (13:53 -0200)]
ldpd: use red-black trees to store 'l2vpn_pw' elements

Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: use red-black trees to store 'l2vpn_if' elements
Renato Westphal [Wed, 14 Dec 2016 14:34:57 +0000 (12:34 -0200)]
ldpd: use red-black trees to store 'l2vpn_if' elements

Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: use red-black trees to store 'l2vpn' elements
Renato Westphal [Wed, 14 Dec 2016 12:42:45 +0000 (10:42 -0200)]
ldpd: use red-black trees to store 'l2vpn' elements

Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: use red-black trees to store 'nbr_params' elements
Renato Westphal [Wed, 14 Dec 2016 11:14:52 +0000 (09:14 -0200)]
ldpd: use red-black trees to store 'nbr_params' elements

Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: use red-black trees to store 'tnbr' elements
Renato Westphal [Tue, 13 Dec 2016 18:19:15 +0000 (16:19 -0200)]
ldpd: use red-black trees to store 'tnbr' elements

Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: use red-black trees to store 'iface' elements
Renato Westphal [Tue, 13 Dec 2016 17:29:35 +0000 (15:29 -0200)]
ldpd: use red-black trees to store 'iface' elements

Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: use red-black trees to store 'lde_map' elements
Renato Westphal [Sat, 3 Dec 2016 23:14:44 +0000 (21:14 -0200)]
ldpd: use red-black trees to store 'lde_map' elements

Using red-black trees instead of linked lists brings the following
benefits:
1 - Elements are naturally ordered (no need to reorder anything before
    outputting data to the user);
2 - Faster lookups/deletes: O(log n) time complexity against O(n).

The insert operation with red-black trees is more expensive though,
but that's not a big issue since lookups are much more frequent.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobuild/ldpd: auto-generate ldp_vty_cmds.c from ldp_vty.xml
Renato Westphal [Tue, 20 Dec 2016 01:29:49 +0000 (23:29 -0200)]
build/ldpd: auto-generate ldp_vty_cmds.c from ldp_vty.xml

Having ldp_vty_cmds.c around as part of the git repository was being
a major source of confusion. Since this file is auto-generated from
ldp_vty.xml, remove it from this git repository and make it be generated
on demand by adding a make target for it.

This patch adds another dependency to build Quagga, namely the LibXML
Perl module, which can be installed with this command:
$ sudo cpan XML::LibXML

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agotools: teach xml2cli.pl the "[]" notation for optional arguments
Renato Westphal [Mon, 19 Dec 2016 20:30:59 +0000 (18:30 -0200)]
tools: teach xml2cli.pl the "[]" notation for optional arguments

Requested by Daniel Walton.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoospf6d: fix broken indentation in "show ipv6 ospf6 neighbor"
Renato Westphal [Mon, 19 Dec 2016 16:43:25 +0000 (14:43 -0200)]
ospf6d: fix broken indentation in "show ipv6 ospf6 neighbor"

In the State/IfState column, we were reserving only 6 characters to
print the state of each neighbor, but this is not enough for cases like
"Loading" (7 characters) and "ExChange" (8 characters). Increase the
width of this field to 8 to fix the broken indendation.

ospf6d's output before this patch:
ubuntu# show ipv6 ospf6 neighbor
Neighbor ID     Pri    DeadTime  State/IfState         Duration I/F[State]
2.2.2.2           1    00:00:35 ExChange/DR              00:01:15 rt1-eth0[BDR]
3.3.3.3           1    00:00:35 Loading/DR              00:01:15 rt1-eth1[BDR]
4.4.4.4           1    00:00:35   Full/DR              00:01:15 rt1-eth2[BDR]
5.5.5.5           1    00:00:35   None/DR              00:01:10 rt1-eth3[BDR]
6.6.6.6           1    00:00:35   Down/DR              00:01:15 rt1-eth4[BDR]
7.7.7.7           1    00:00:35 Attempt/DR              00:01:15 rt1-eth5[BDR]
8.8.8.8           1    00:00:35   Init/DR              00:01:10 rt1-eth6[BDR]
9.9.9.9           1    00:00:35 Twoway/DR              00:01:14 rt1-eth7[BDR]
10.10.10.10       1    00:00:35 ExStart/DR              00:01:10 rt1-eth8[BDR]

ospf6d's output with this patch:
ubuntu# show ipv6 ospf6 neighbor
Neighbor ID     Pri    DeadTime    State/IfState         Duration I/F[State]
2.2.2.2           1    00:00:36 ExChange/DR              00:00:44 rt1-eth0[BDR]
3.3.3.3           1    00:00:36  Loading/DR              00:00:39 rt1-eth1[BDR]
4.4.4.4           1    00:00:35     Full/DR              00:00:39 rt1-eth2[BDR]
5.5.5.5           1    00:00:36     None/DR              00:00:44 rt1-eth3[BDR]
6.6.6.6           1    00:00:36     Down/DR              00:00:39 rt1-eth4[BDR]
7.7.7.7           1    00:00:36  Attempt/DR              00:00:39 rt1-eth5[BDR]
8.8.8.8           1    00:00:36     Init/DR              00:00:39 rt1-eth6[BDR]
9.9.9.9           1    00:00:35   Twoway/DR              00:00:40 rt1-eth7[BDR]
10.10.10.10       1    00:00:36  ExStart/DR              00:00:39 rt1-eth8[BDR]

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: add missing privilege dropping on error path
Renato Westphal [Mon, 19 Dec 2016 16:07:28 +0000 (14:07 -0200)]
ldpd: add missing privilege dropping on error path

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: allow multiple link adjacencies with unnumbered interfaces
Renato Westphal [Wed, 14 Dec 2016 21:20:10 +0000 (19:20 -0200)]
ldpd: allow multiple link adjacencies with unnumbered interfaces

Now we can have two different adjacencies coming from the same source
address. Check for the adjacency's interface on adj_find() to disambiguate
them.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: fix segfault when configuring multiple pseudowires
Renato Westphal [Wed, 14 Dec 2016 00:51:41 +0000 (22:51 -0200)]
ldpd: fix segfault when configuring multiple pseudowires

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: add grammar_sandbox to .gitignore
Quentin Young [Tue, 20 Dec 2016 06:39:37 +0000 (06:39 +0000)]
lib: add grammar_sandbox to .gitignore

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #22 from qlyoung/fix-do-tab
Quentin Young [Mon, 19 Dec 2016 22:35:03 +0000 (17:35 -0500)]
Merge pull request #22 from qlyoung/fix-do-tab

lib: fix crash when tab-completing `do ...` commands

7 years agolib: fix crash when tab-completing `do ...` commands
Quentin Young [Sun, 18 Dec 2016 05:14:55 +0000 (05:14 +0000)]
lib: fix crash when tab-completing `do ...` commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #6 from opensourcerouting/dev/osr/vty_pending
Donald Sharp [Fri, 16 Dec 2016 20:52:47 +0000 (15:52 -0500)]
Merge pull request #6 from opensourcerouting/dev/osr/vty_pending

parser: accept non-words as first tokens & numbers as word tokens

7 years agoMerge pull request #5 from freerangerouting/dev/osr/fixes_plus_vty_keywords
Donald Sharp [Fri, 16 Dec 2016 20:12:34 +0000 (15:12 -0500)]
Merge pull request #5 from freerangerouting/dev/osr/fixes_plus_vty_keywords

Merge branch 'dev/osr/fixes_plus_vty_keywords'

7 years agolib: parser: remove startnode & sentence_root
David Lamparter [Wed, 23 Nov 2016 18:20:15 +0000 (19:20 +0100)]
lib: parser: remove startnode & sentence_root

This removes an artificial restriction for the first token in a
command's graph to be a WORD_TKN.  The intention seems to be to prohibit
empty paths through a command, and to restrict "explosion" of choices in
the root node.

The better approach to the former is to check for an empty path after
the definition is parsed.  The latter will happen anyway, by duplication
of the command, which just makes it worse...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: accept number-only word tokens
David Lamparter [Fri, 16 Dec 2016 19:43:26 +0000 (20:43 +0100)]
lib: parser: accept number-only word tokens

There seems to be no reason why numbers don't work as plain word tokens;
this is useful to have "number choices" or constants, e.g. <128|192|256>
for bit encryption lengths.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: automake 1.12 to deal with flex & bison
David Lamparter [Fri, 16 Dec 2016 16:33:31 +0000 (17:33 +0100)]
build: automake 1.12 to deal with flex & bison

bison conditionally writes its output to different files based on the
filenames specified in the source code.  This could be disabled,
however...  flex changes its output filenames when "prefix" is
specified.  And ylwrap from <1.11 doesn't understand how to handle the
header file...

...so this requires automake 1.12 which can deal with this properly.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: move allowrepeat to cmd_token
David Lamparter [Fri, 16 Dec 2016 16:19:37 +0000 (17:19 +0100)]
lib: parser: move allowrepeat to cmd_token

struct graph_node isn't quite the right place to control matcher
behaviour.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: shuffle qobj_init()
David Lamparter [Fri, 16 Dec 2016 07:12:54 +0000 (08:12 +0100)]
bgpd: shuffle qobj_init()

bgp_master_init is called first thing in main(), so we need to wedge a
qobj_init() call in there...  this needs some improvement...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: reorder bison incarnations
David Lamparter [Fri, 16 Dec 2016 01:10:48 +0000 (02:10 +0100)]
lib: parser: reorder bison incarnations

This shuffles the code blocks in command_parser.y to match file output
order, then adjusts things to make the include handling less messy.

(also dropped unused DECIMAL_STRLEN_MAX define.)

This should hopefully fix the build on NetBSD 6.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: check flex >= 2.5.20 is available
David Lamparter [Fri, 16 Dec 2016 00:24:53 +0000 (01:24 +0100)]
build: check flex >= 2.5.20 is available

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: fix bison < 3.0 compatibility
David Lamparter [Thu, 15 Dec 2016 23:37:52 +0000 (00:37 +0100)]
build: fix bison < 3.0 compatibility

bison-2.7.x really wants "foo" for api.prefix while bison-3.0.x really
wants {foo} ... great.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agotests: fix mis-fixed format string
David Lamparter [Thu, 15 Dec 2016 23:14:55 +0000 (00:14 +0100)]
tests: fix mis-fixed format string

PRIu64 is "u", we need "x", so PRIx64...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Cc: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agotests: fix exit <> return mix-up in dejagnu
David Lamparter [Thu, 15 Dec 2016 23:09:46 +0000 (00:09 +0100)]
tests: fix exit <> return mix-up in dejagnu

exit 0 exits the entire testrunner... Oops.
Also, "unresolved" breaks too many things, so make this a pass.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agotests: add missing qobj_init() call
David Lamparter [Thu, 15 Dec 2016 23:01:20 +0000 (00:01 +0100)]
tests: add missing qobj_init() call

This was SEGV'ing the test in bgp_master_init() since QOBJ_REG was used
without qobj_init() being called first.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agotests: adjust testcli ref output to new argv rules
David Lamparter [Thu, 15 Dec 2016 22:20:04 +0000 (23:20 +0100)]
tests: adjust testcli ref output to new argv rules

Now that we have keyword argument support in the matcher again, this
needs to be updated because argv[] will be 1:1 user input without
mangling or reordering.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: fix SEGV when Tab hits non-WORD_TKN
David Lamparter [Thu, 15 Dec 2016 22:53:02 +0000 (23:53 +0100)]
lib: parser: fix SEGV when Tab hits non-WORD_TKN

If <Tab> processing finds that there is only 1 candidate, but that
candidate is not a WORD_TKN that we can tab-complete on, the status
would remain at CMD_COMPLETE_FULL_MATCH, but the resulting list of
possible completions is empty.

This then SEGVs in lib/vty.c where it tries to access the first element
of the list, assuming FULL_MATCH always has 1 element there...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Cc: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: parser: support keyword arguments
David Lamparter [Fri, 18 Nov 2016 14:56:18 +0000 (15:56 +0100)]
lib: parser: support keyword arguments

This re-adds "{foo WORD|bar WORD}" keyword-argument support to the CLI
parser.  Note that token graphs may now contain loops for this purpose;
therefore the matching functions retain a history of already-matched
tokens.  Each token can thus only be consumed once.

And then LINE... gets its special treatment with allowrepeat.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: refresh grammar_sandbox
David Lamparter [Wed, 23 Nov 2016 10:58:13 +0000 (11:58 +0100)]
lib: parser: refresh grammar_sandbox

This makes grammar_sandbox a workable tool again, updating it for the
recent changes.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch 'dev/osr/vty_index'
David Lamparter [Thu, 15 Dec 2016 20:34:53 +0000 (21:34 +0100)]
Merge branch 'dev/osr/vty_index'

Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra_mpls. Set best lsp nhlfe to null on deletion
Fredi Raspall [Wed, 30 Nov 2016 18:15:07 +0000 (19:15 +0100)]
zebra_mpls. Set best lsp nhlfe to null on deletion

When a nhlfe was deleted and it happened to be the best,
lsp->best_nhlfe was not updated causing lsp_process() to see
an inexistent nhlfe.
Fix: set lsp->best_nhlfe to null on deletion.

7 years agoquagga: Convert ldpd to be built by default
Donald Sharp [Thu, 8 Dec 2016 23:22:01 +0000 (18:22 -0500)]
quagga: Convert ldpd to be built by default

(cherry picked from commit a67ce7192143de7de0741af3d0b4f72ee57c7ffd)

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: Partial Revert of 4ecc09d and modify zclient connect behavior
Donald Sharp [Mon, 12 Dec 2016 12:59:16 +0000 (07:59 -0500)]
lib: Partial Revert of 4ecc09d and modify zclient connect behavior

Commit 43cc09d has been shown to cause several issues with clients
connecting.

Partial revert, since I wanted to keep the debug logs added
for that commit, as well remove the piece of code that
stops attempting to connect to zebra.  If we've failed
a bunch of times, there is nothing wrong with continuing
to do so once every 60 seconds.  I've debug guarded
the connect failure for those people running bgp
without zebra.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra/ldpd: allow MPLS ECMP on unnumbered interfaces
Renato Westphal [Mon, 12 Dec 2016 20:28:31 +0000 (18:28 -0200)]
zebra/ldpd: allow MPLS ECMP on unnumbered interfaces

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
(cherry picked from commit 7144dc12b55e05c9ae3d784dfb75817c9f881eb6)

7 years agoldpd: remove security check to allow operation on unnumbered interfaces
Renato Westphal [Mon, 12 Dec 2016 20:26:04 +0000 (18:26 -0200)]
ldpd: remove security check to allow operation on unnumbered interfaces

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
(cherry picked from commit f25ccbd060a2086678f8608cafc5c5a2a2cf964a)

7 years agoldpd: add missing check on disc_find_iface()
Renato Westphal [Mon, 12 Dec 2016 20:35:30 +0000 (18:35 -0200)]
ldpd: add missing check on disc_find_iface()

When we find an interface on disc_find_iface(), we need to check if it's
enabled for the address-family (IPv4 or IPv6) of the received packet. We
were doing that only for targeted hellos, do it for link hellos as well.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
(cherry picked from commit 6710e336b3afd913c5b15677159e8274680ea8cb)

7 years agozebra-mpls: fix regression caused by wrong conflict resolution
Renato Westphal [Fri, 9 Dec 2016 00:04:52 +0000 (22:04 -0200)]
zebra-mpls: fix regression caused by wrong conflict resolution

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: fix segfault on exit when RIB debugging is enabled
Renato Westphal [Thu, 8 Dec 2016 19:36:03 +0000 (17:36 -0200)]
zebra: fix segfault on exit when RIB debugging is enabled

Fixes the following crash on exit:
(gdb) bt
0  _rnode_zlog (...) at zebra_rib.c:104
1  0x0000000000417726 in rib_unlink (...) at zebra_rib.c:2370
2  0x000000000042db80 in zebra_rtable_node_destroy (...) at zebra_vrf.c:336
3  0x00007ffff7b6ce2e in route_node_free (...) at table.c:81
4  0x00007ffff7b6ced7 in route_table_free (...) at table.c:118
5  0x00007ffff7b6cd88 in route_table_finish (...) at table.c:53
6  0x000000000042defa in zebra_vrf_delete (...) at zebra_vrf.c:278
7  0x00007ffff7b9e044 in vrf_delete (...) at vrf.c:162
8  0x00007ffff7b9e89f in vrf_terminate () at vrf.c:458
9  0x000000000041027c in sigint () at main.c:205
10 0x00007ffff7b953f2 in quagga_sigevent_process () at sigevent.c:111
11 0x00007ffff7b681dd in thread_fetch (...) at thread.c:1297
12 0x000000000040c7ed in main (...) at main.c:471

To fix the problem, free the table->info pointer only after
route_table_finish() is called for the table.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: Remove weird blackhole/reject static routes
Quentin Young [Mon, 12 Dec 2016 23:29:39 +0000 (23:29 +0000)]
zebra: Remove weird blackhole/reject static routes

Doesn't make sense to fully configure a static route and then
specify that it should be rejected. Remove & rename relevant
commands.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years ago*: kill useless if(...) after VTY_DECLVAR_CONTEXT
David Lamparter [Fri, 9 Dec 2016 16:50:01 +0000 (17:50 +0100)]
*: kill useless if(...) after VTY_DECLVAR_CONTEXT

VTY_DECLVAR_CONTEXT already contains a NULL check, vty warning message
and return statement.  These are not needed.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: remove vty->index
David Lamparter [Wed, 7 Dec 2016 16:30:16 +0000 (17:30 +0100)]
lib: remove vty->index

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years ago*: fix remaining vty->index & add coccinelle patch
David Lamparter [Wed, 7 Dec 2016 16:24:05 +0000 (17:24 +0100)]
*: fix remaining vty->index & add coccinelle patch

Fix instances that the coccinelle patch didn't catch (or which
coccinelle couldn't parse), and add the patch file for future posterity
(and application to yet-unmerged branches).

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years ago*: coccinelle-replace vty->index
David Lamparter [Wed, 7 Dec 2016 16:15:32 +0000 (17:15 +0100)]
*: coccinelle-replace vty->index

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: make qobj NULL-safe/aware
David Lamparter [Wed, 7 Dec 2016 11:16:05 +0000 (12:16 +0100)]
lib: make qobj NULL-safe/aware

reserve qobj ID 0 for a NULL pointer.  (No change is needed for lookups
since looking up 0 will simply fail and return NULL.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoripd: add qobj registrations
David Lamparter [Wed, 7 Dec 2016 15:01:47 +0000 (16:01 +0100)]
ripd: add qobj registrations

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospfd, ospf6d: add qobj registrations
David Lamparter [Wed, 7 Dec 2016 12:25:38 +0000 (13:25 +0100)]
ospfd, ospf6d: add qobj registrations

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: add qobj registrations
David Lamparter [Wed, 7 Dec 2016 11:25:24 +0000 (12:25 +0100)]
bgpd: add qobj registrations

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch 'fixes/command'
David Lamparter [Thu, 8 Dec 2016 14:07:24 +0000 (15:07 +0100)]
Merge branch 'fixes/command'

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agovtysh: Fix static compilation
Donald Sharp [Wed, 7 Dec 2016 20:28:44 +0000 (15:28 -0500)]
vtysh: Fix static compilation

When compiling vtysh with --enable-static and --disasble-shared
we get linker errors with duplicate function names.

This commit addresses this issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: fix segfault on "show mpls table"
Renato Westphal [Mon, 5 Dec 2016 20:19:47 +0000 (18:19 -0200)]
zebra: fix segfault on "show mpls table"

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch 'stable/2.0'
David Lamparter [Thu, 8 Dec 2016 12:21:21 +0000 (13:21 +0100)]
Merge branch 'stable/2.0'

Conflicts:
bgpd/rfapi/bgp_rfapi_cfg.c
bgpd/rfapi/vnc_debug.c

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch '-isisd-simpl' into stable/2.0
David Lamparter [Thu, 8 Dec 2016 11:52:45 +0000 (12:52 +0100)]
Merge branch '-isisd-simpl' into stable/2.0

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd vnc: Add 'debug bgp vnc verbose' target
Lou Berger [Wed, 7 Dec 2016 20:02:55 +0000 (15:02 -0500)]
bgpd vnc: Add 'debug bgp vnc verbose' target

all vnc debug logging is now covered by a 'debug bgp vnc' target

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years ago*: always set SO_SNDBUF and SO_RCVBUF using a best effort approach
Renato Westphal [Wed, 7 Dec 2016 15:21:46 +0000 (13:21 -0200)]
*: always set SO_SNDBUF and SO_RCVBUF using a best effort approach

If we fail to set any socket's buffer size, try again with a smaller value
and keep going until it succeeds. This is better than just giving up or,
even worse, abort the creation of a socket (ospf6d and ripd).

Fix broken ospf6d on FreeBSD.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospfd: set the OSPF socket's send buffer size only once
Renato Westphal [Wed, 7 Dec 2016 15:21:45 +0000 (13:21 -0200)]
ospfd: set the OSPF socket's send buffer size only once

This reverts commit b7fe4141, which introduced a logic where the OSPF
send buffer size was dynamically updated to reflect the maximum MTU
of the OSPF enabled interfaces (this was done to make ospfd work with
interfaces configured for jumbo frames).

Since commit a78d75b0, this is not necessary anymore because
ospf_sock_init() now sets the OSPF send buffer size to a very high value
(8MB). Also, the previous logic was broken because it didn't account
for run-time interface MTU changes.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoquagga: Remove description of deprecated interfaces
Donald Sharp [Wed, 7 Dec 2016 13:34:39 +0000 (08:34 -0500)]
quagga: Remove description of deprecated interfaces

The deprecated interface section is no longer being used.
Let's remove it from the document.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoquagga: Add Debug Guard section in COMMUNITY.md
Donald Sharp [Wed, 7 Dec 2016 13:34:38 +0000 (08:34 -0500)]
quagga: Add Debug Guard section in COMMUNITY.md

Add verbiage to loosely describe how developers MUST
guard debugs put into their code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoisisd: Remove unnecessary debug
Donald Sharp [Tue, 6 Dec 2016 02:45:06 +0000 (21:45 -0500)]
isisd: Remove unnecessary debug

Remove unnecessary debug from isis write mem.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: fix command_lex.h deps & gitignore
David Lamparter [Wed, 7 Dec 2016 16:34:38 +0000 (17:34 +0100)]
build: fix command_lex.h deps & gitignore

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch 'vtysh-grammar'
David Lamparter [Thu, 8 Dec 2016 11:22:13 +0000 (12:22 +0100)]
Merge branch 'vtysh-grammar'

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoripd: fix `ip rip receive...` command
Quentin Young [Tue, 6 Dec 2016 20:50:37 +0000 (20:50 +0000)]
ripd: fix `ip rip receive...` command

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib, ripngd: clean up merge leftovers
Quentin Young [Tue, 6 Dec 2016 20:10:06 +0000 (20:10 +0000)]
lib, ripngd: clean up merge leftovers

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge remote-tracking branch 'osr/master' into vtysh-grammar
Quentin Young [Tue, 6 Dec 2016 19:51:33 +0000 (19:51 +0000)]
Merge remote-tracking branch 'osr/master' into vtysh-grammar

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Conflicts:
lib/command_match.c

7 years agolib, tests: fix failing cli tests
Quentin Young [Tue, 6 Dec 2016 19:27:58 +0000 (19:27 +0000)]
lib, tests: fix failing cli tests

Some tests still failing pending reimplementation of {}
cli definition constructs

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: add back original ipv6 matcher
Quentin Young [Tue, 6 Dec 2016 18:54:04 +0000 (18:54 +0000)]
lib: add back original ipv6 matcher

inet_pton is not suitable for well behaved cli completions

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoRevert "lib: Macroize CLI matcher tracing"
David Lamparter [Mon, 5 Dec 2016 20:01:06 +0000 (21:01 +0100)]
Revert "lib: Macroize CLI matcher tracing"

This reverts commit 54c5dce6a5e46717ad52c80f2dc99fc36a372e28.

7 years agoripd: fix indentation problems introduced by wrong conflict resolution
Renato Westphal [Mon, 5 Dec 2016 19:31:42 +0000 (17:31 -0200)]
ripd: fix indentation problems introduced by wrong conflict resolution

Restore trailing whitespaces from rip_interface_new() as well. If we
want to fix this, we need a separate commit just for this purpose.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
[DL: removed "restoring wrong whitespace" bits]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years ago*: fix up DEFUNs without install_element calls
David Lamparter [Mon, 5 Dec 2016 19:28:24 +0000 (20:28 +0100)]
*: fix up DEFUNs without install_element calls

These now generate warnings which will break the build with -Werror.

Note this may have enabled commands that should be disabled, or the
other way around...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch 'queue/osr/vtysh-generic'
David Lamparter [Mon, 5 Dec 2016 19:04:08 +0000 (20:04 +0100)]
Merge branch 'queue/osr/vtysh-generic'

WARNING: Merge contains nontrivial fixups in vrf_cmd handling.

Conflicts:
lib/if.c
zebra/interface.c

7 years agozebra: use correct cmd index for 'no ipv6 route' command
Christian Franke [Mon, 5 Dec 2016 18:52:05 +0000 (19:52 +0100)]
zebra: use correct cmd index for 'no ipv6 route' command

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
7 years agolib: "write mem" should write to persistent configuration
Christian Franke [Mon, 5 Dec 2016 18:46:09 +0000 (19:46 +0100)]
lib: "write mem" should write to persistent configuration

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
7 years agoMerge branch 'stable/2.0'
David Lamparter [Mon, 5 Dec 2016 18:43:38 +0000 (19:43 +0100)]
Merge branch 'stable/2.0'

Conflicts:
bgpd/bgp_route.c
lib/if.c
ripd/rip_interface.c
zebra/interface.c
zebra/zebra_vty.c

7 years agobuild: number sections in COMMUNITY.md HTML
David Lamparter [Mon, 5 Dec 2016 18:08:00 +0000 (19:08 +0100)]
build: number sections in COMMUNITY.md HTML

adds some CSS to get section numbers.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: remove unused NS_BITMAP MTYPE
David Lamparter [Mon, 5 Dec 2016 15:34:15 +0000 (16:34 +0100)]
lib: remove unused NS_BITMAP MTYPE

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch '-rip' into stable/2.0
David Lamparter [Mon, 5 Dec 2016 15:25:58 +0000 (16:25 +0100)]
Merge branch '-rip' into stable/2.0

This fixes up a lot of RIP/RIPng compliance tests that were still
flagged up.

Tested-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoMerge branch '-renato' into stable/2.0
David Lamparter [Mon, 5 Dec 2016 15:22:16 +0000 (16:22 +0100)]
Merge branch '-renato' into stable/2.0

This contains bgp memory leak fixes as well as cleanups to VRF/namespace
handling and has been run through extended testing in Cumulus' testbed:

Tested-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib, zebra: Minimize display of link-params sub data
Donald Sharp [Thu, 1 Dec 2016 15:49:22 +0000 (10:49 -0500)]
lib, zebra: Minimize display of link-params sub data

When link-params is configured it auto starts displaying
6000-02# conf t
dell-s6000-02(config)# int swp1
dell-s6000-02(config-if)# link-params
dell-s6000-02(config-link-params)# admin-grp 0x12345678
dell-s6000-02(config-link-params)# end
dell-s6000-02# show run

interface swp1
 link-params
  enable
  metric 0              <----Remove the bw lines
  max-bw 1.25e+06
  max-rsv-bw 1.25e+06
  unrsv-bw 0 1.25e+06
  unrsv-bw 1 1.25e+06
  unrsv-bw 2 1.25e+06
  unrsv-bw 3 1.25e+06
  unrsv-bw 4 1.25e+06
  unrsv-bw 5 1.25e+06
  unrsv-bw 6 1.25e+06
  unrsv-bw 7 1.25e+06
  admin-grp 305419896
  exit-link-params
!

I'd like to reduce this to:

interface enp0s3
 ip igmp
 ip pim sm
 link-params
  enable
  admin-grp 0x12345678    <----- Fix this to be what we entered
  exit-link-params
!

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: Remove nexthop for peer only for "real" peer
vivek [Sun, 4 Dec 2016 02:51:49 +0000 (21:51 -0500)]
bgpd: Remove nexthop for peer only for "real" peer

During connection establishment, there is a separate peer structure created
for the doppelganger (for incoming connection). When this is deleted after
the connection has established, take care to ensure that the nexthop entry
for the peer is not deleted.

Fixes: f9164b1d74f6a20d69d7ef10d2e39b4ae7996cbf
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Ticket: CM-13875
Reviewed By: None
Testing Done: Manual

(cherry picked from commit 4f2bc892cbddbf36bd5e1b2f36c33260af614b33)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agodoc: update README to mention PIM-SSM and LDP support
Renato Westphal [Sat, 3 Dec 2016 23:35:23 +0000 (21:35 -0200)]
doc: update README to mention PIM-SSM and LDP support

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: Fix 'show ip bgp' to not change it's output
Donald Sharp [Fri, 2 Dec 2016 18:57:04 +0000 (13:57 -0500)]
bgpd: Fix 'show ip bgp' to not change it's output

For unicast routes do not change the output of the 'show ip bgp' command.

This will allow people with existing scripts to continue to work.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: add command_lex.h to .gitignore
Quentin Young [Fri, 2 Dec 2016 21:14:32 +0000 (21:14 +0000)]
lib: add command_lex.h to .gitignore

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: make CLI completions less surprising
Quentin Young [Fri, 2 Dec 2016 21:02:51 +0000 (21:02 +0000)]
lib: make CLI completions less surprising

* If a token matches exactly at the end of input, it still
  shows up in completions, e.g.

      ex# clear<?>
clear  Reset functions
      ex(config)# ip route 1.2.3.4<?>
        A.B.C.D    IP destination prefix
        A.B.C.D/M  IP destination prefix (e.g. 10.0.0.0/8)

* If a token in mid-line exactly matches one token and
  partially matches on one or more additional tokens,
  the command tree(s) under the partially matching tokens
  will be ignored in favor of the exact match when compiling
  completions for the full line, e.g.

      ex(config)# ip <?>

  will only show completions for commands under 'ip' and not
  those under 'ipv6', which the input partially matches.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agotools: drop cmd_check.py
Quentin Young [Fri, 2 Dec 2016 19:09:11 +0000 (19:09 +0000)]
tools: drop cmd_check.py

CLI defuns are static so the compiler catches unused
definitions, ergo no longer necessary to have a script
for this.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge remote-tracking branch 'osr_private_quagga/queue/osr/vtysh-generic' into vtysh...
Quentin Young [Fri, 2 Dec 2016 19:02:06 +0000 (19:02 +0000)]
Merge remote-tracking branch 'osr_private_quagga/queue/osr/vtysh-generic' into vtysh-grammar

7 years agolib: Macroize CLI matcher tracing
Quentin Young [Fri, 2 Dec 2016 18:26:47 +0000 (18:26 +0000)]
lib: Macroize CLI matcher tracing

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Add back prototypes for lexer helper funcs
Quentin Young [Fri, 2 Dec 2016 18:26:10 +0000 (18:26 +0000)]
lib: Add back prototypes for lexer helper funcs

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agobgpd: Fix route node unlock when clearing adj-out
vivek [Fri, 2 Dec 2016 13:22:21 +0000 (08:22 -0500)]
bgpd: Fix route node unlock when clearing adj-out

When clearing the adj-out for a subgroup (e.g., upon peer going down),
ensure that the adj-out is removed before unlocking the route node that
it points to, otherwise, there is a possibility that the route node may
be prematurely freed.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Ticket: CM-13690
Reviewed By: None
Testing Done: bgp-smoke, resilient-hash tests

(cherry picked from commit c3d7d35f3b7152c9e50e52c3cfd60b0dc52df703)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospfd: Fix json Crash with inactive timer
Donald Sharp [Fri, 2 Dec 2016 13:19:26 +0000 (08:19 -0500)]
ospfd: Fix json Crash with inactive timer

When nbr->t_inactivity is not active, and
you do a show json over the neighbor it
will crash ospfd.  Fix the code so it
prints out -1 when the timer is inactive.

Ticket:CM-13835
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
(cherry picked from commit 78d8fcb9623ab4d9cebf6187a451448e056a84bf)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: Add missing argv handler for ipv4 prefix in `show...vpnv4` cmd
Quentin Young [Thu, 1 Dec 2016 21:13:46 +0000 (21:13 +0000)]
bgpd: Add missing argv handler for ipv4 prefix in `show...vpnv4` cmd

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agobgpd: Make `ip` optional for all `show bgp` and `show ip bgp` commands
Quentin Young [Thu, 1 Dec 2016 18:41:52 +0000 (18:41 +0000)]
bgpd: Make `ip` optional for all `show bgp` and `show ip bgp` commands

This should unify the `show bgp ...` and `show ip bgp...` command
variants under one tree.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: remove misleading copy/del_cmd_element
David Lamparter [Wed, 23 Nov 2016 11:06:34 +0000 (12:06 +0100)]
lib: remove misleading copy/del_cmd_element

struct cmd_element items are static global variables, they are never
allocated, copied or freed.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: use reentrant mode on flex & bison
David Lamparter [Wed, 16 Nov 2016 06:03:51 +0000 (15:03 +0900)]
lib: parser: use reentrant mode on flex & bison

This removes remaining global variables from the lexer, pushing the
lexer state into struct parser_ctx too.  At the same time, "cmd_yy" is
used as prefix for all parser & lexer routines.

The result is that (a) there is no collision anymore if a program uses
flex/bison and links libzebra, and (b) the parser is fully encapsulated
and could be called in parallel from multiple threads.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: parser: wrap state in struct parser_ctx
David Lamparter [Wed, 23 Nov 2016 08:02:08 +0000 (09:02 +0100)]
lib: parser: wrap state in struct parser_ctx

This encapsulates all parser state into a new "struct parser_ctx", which
is allocated on stack and passed around as pointer.  The parser no
longer has any global variables with this.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: move command_parse_format prototype
David Lamparter [Wed, 23 Nov 2016 07:42:27 +0000 (08:42 +0100)]
lib: move command_parse_format prototype

The function prototype for command_parse_format() is better left in
command.h, so that the bison-generated header file doesn't need to be
included for that.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: allow all characters in WORD tokens
David Lamparter [Fri, 18 Nov 2016 10:34:28 +0000 (11:34 +0100)]
lib: allow all characters in WORD tokens

WORD tokens (which are also used for "LINE..." input) should really
accept all characters.

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