]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
8 years agolib: parser: remove startnode & sentence_root 6/head
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>
8 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>
8 years agobuild: automake 1.12 to deal with flex & bison 5/head
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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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.

8 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>
8 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>
8 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)

8 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)

8 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)

8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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

8 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>
8 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>
8 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.

8 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>
8 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>
8 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

8 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>
8 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>
8 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

8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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

8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 years agolib: make DEFUN foobar_cmd symbols static
David Lamparter [Wed, 16 Nov 2016 06:02:04 +0000 (15:02 +0900)]
lib: make DEFUN foobar_cmd symbols static

These are not externally referenced anymore;  this reduces the symbol
count of libzebra by quite a bit.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years ago*: make DEFUN installations file-local
David Lamparter [Wed, 16 Nov 2016 06:00:52 +0000 (15:00 +0900)]
*: make DEFUN installations file-local

This moves all install_element calls into the file where the DEFUNs are
located.  This fixes several small related bugs:

- ospf6d wasn't installing a "no interface FOO" command
- zebra had a useless copy of "interface FOO"
- pimd's copy of "interface FOO" was not setting qobj_index, which means
  "description LINE" commands would fail with an error

The next commit will do the actual act of making "foo_cmd" static.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoMerge branch 'stable/2.0'
David Lamparter [Thu, 1 Dec 2016 16:24:03 +0000 (17:24 +0100)]
Merge branch 'stable/2.0'

8 years agolib: replace MIT license with ISC
David Lamparter [Thu, 1 Dec 2016 16:18:57 +0000 (17:18 +0100)]
lib: replace MIT license with ISC

Since other parts (e.g. ldpd) use the ISC license, and the ISC license
is just a simplified form of the MIT license, just move things over and
reduce the number of different licenses we have in use here.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobuild: COMMUNITY.md: add git branch diagram
David Lamparter [Thu, 1 Dec 2016 16:16:24 +0000 (17:16 +0100)]
build: COMMUNITY.md: add git branch diagram

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agozebra: check ZEBRA_IFC_REAL on if_up
Christian Franke [Mon, 7 Nov 2016 12:37:25 +0000 (13:37 +0100)]
zebra: check ZEBRA_IFC_REAL on if_up

Only connected routes which have ZEBRA_IFC_REAL set should
be redistributed.

Signed-off-by: Christian Franke <nobody@nowhere.ws>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgpd: fix invalid memory access in peer_free()
Renato Westphal [Mon, 28 Nov 2016 18:47:13 +0000 (16:47 -0200)]
bgpd: fix invalid memory access in peer_free()

We shoult not call bgp_unlock() before calling
bgp_delete_connected_nexthop() in the peer_free() function. Otherwise,
if bgp->lock reaches zero, bgp_free() is called and peer->bgp becomes
an invalid pointer in the bgp_delete_connected_nexthop() function.

To fix this, move the call to bgp_unlock() to the end of peer_free().

Bug exposed by commit 37d361e ("bgpd: plug several memleaks").

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgpd: Fix crashes when no default bgp instance is configured.
Donald Sharp [Thu, 1 Dec 2016 14:11:12 +0000 (09:11 -0500)]
bgpd: Fix crashes when no default bgp instance is configured.

The vnc code assumes that bgp must have a default instance.
This code change checks to make sure that we do before
proceeding.  It makes no assurances that vnc will behave
correctly without a default instance.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agopimd: Fix large integer display of drpriority
Donald Sharp [Wed, 30 Nov 2016 13:23:12 +0000 (08:23 -0500)]
pimd: Fix large integer display of drpriority

When displaying drpriority you can enter unsigned
integer values from 1-2^32.  The display was
turning the unsigned value into a signed value
and thus we were displaying the wrong value.

Ticket: CM-13787
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: David Ahern <dsa@cumulusnetworks.com>
(cherry picked from commit db17265f1025e3ec578998ad537c33b49ed33cde)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoospfd: Fix memory leak when not using json
Donald Sharp [Wed, 30 Nov 2016 13:23:11 +0000 (08:23 -0500)]
ospfd: Fix memory leak when not using json

When doing a show command under ospf, if
not using json we would have a small memory
leak in show_ip_ospf_common.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 50750712b1ac8364e290c67782eaf371025dc59e)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoall: Replace "JavaScript Object Notation\n" with JSON_STR
Quentin Young [Tue, 29 Nov 2016 23:26:03 +0000 (23:26 +0000)]
all: Replace "JavaScript Object Notation\n" with JSON_STR

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
8 years agoall: Fix all underfull doc strings
Quentin Young [Tue, 29 Nov 2016 23:07:11 +0000 (23:07 +0000)]
all: Fix all underfull doc strings

Additionally:
* Add [ip] to a couple bgp show commands
* Quick refactor of a couple ISIS commands
* Quick refactor of a couple OSPF6 commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
8 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>
8 years agobgpd: Add back missing vpnv4 commands
Quentin Young [Tue, 29 Nov 2016 20:25:24 +0000 (20:25 +0000)]
bgpd: Add back missing vpnv4 commands

* show ip bgp vpnv4 all <A.B.C.D|A.B.C.D/M> [json]
* show...vpnv4 <all|rd ...> summary...
* Fix placement of AF+SAFI specifiers for BGP clear commands
* Add more [ip]'s for bgp commands
* clean up some doc strings

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
8 years agobuild: drop TODO from redhat/quagga.spec.in
David Lamparter [Tue, 29 Nov 2016 19:31:43 +0000 (20:31 +0100)]
build: drop TODO from redhat/quagga.spec.in

Fixes: 955026c8... "build: ditch outdated documents, including HACKING"
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agobgpd: fix "show ip bgp" column alignment
Daniel Walton [Tue, 29 Nov 2016 17:47:12 +0000 (12:47 -0500)]
bgpd: fix "show ip bgp" column alignment

The "Weight" column is off:

BGP table version is 0, local router ID is 10.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, =
multipath,
              i internal, r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
*> 4.1.1.2/32       9.9.9.2                  0          32768 ?
*> 4.1.1.4/32       9.9.9.2                  0          32768 ?
Displayed  2 out of 2 total prefixes

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 65c7395b07e8c592c847d4a1e22fc89ddf448341)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agoospfd: "ip ospf bfd" removes the "ip ospf bfd 3 250 250" command
Daniel Walton [Tue, 29 Nov 2016 17:47:11 +0000 (12:47 -0500)]
ospfd: "ip ospf bfd" removes the "ip ospf bfd 3 250 250" command

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-13712
(cherry picked from commit 367b138748e894bbfaae36d1cf7c90eafebfebc9)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years agolib: use traditional yacc empty statement
David Lamparter [Tue, 29 Nov 2016 13:45:49 +0000 (14:45 +0100)]
lib: use traditional yacc empty statement

%empty was added in bison 2.7.1, which seems to not be available on some
of the BSDs by default.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
8 years ago*: fix CLI copypasta mixups
David Lamparter [Tue, 29 Nov 2016 12:59:25 +0000 (13:59 +0100)]
*: fix CLI copypasta mixups

Nice clang catch:  ospfd/ospf_vty.c:6710:1: error: all paths through
this function will call itself [-Werror,-Winfinite-recursion]

(same in vtysh/vtysh.c)

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