]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agofrr: Remove HAVE_IPV6 from code base
Donald Sharp [Fri, 13 Jan 2017 12:57:57 +0000 (07:57 -0500)]
frr: Remove HAVE_IPV6 from code base

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #55 from donaldsharp/monotonic
Olivier Dugeon [Mon, 9 Jan 2017 14:26:16 +0000 (15:26 +0100)]
Merge pull request #55 from donaldsharp/monotonic

Monotonic

7 years agoMerge pull request #56 from qlyoung/if-metric
Olivier Dugeon [Mon, 9 Jan 2017 14:25:40 +0000 (15:25 +0100)]
Merge pull request #56 from qlyoung/if-metric

lib: make interface metric a uint32_t

7 years agoredhat: update .gitignore
Quentin Young [Mon, 9 Jan 2017 02:36:53 +0000 (02:36 +0000)]
redhat: update .gitignore

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: make interface metric a uint32_t
Quentin Young [Mon, 9 Jan 2017 01:35:41 +0000 (01:35 +0000)]
lib: make interface metric a uint32_t

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agobgpd: Remove knowledge of HAVE_CLOCK_MONTONIC
Donald Sharp [Sun, 8 Jan 2017 00:23:50 +0000 (19:23 -0500)]
bgpd: Remove knowledge of HAVE_CLOCK_MONTONIC

thread.c fails to build properly on systems that do
not have a CLOCK_MONOTONIC.  Therefore there is
no need for bgp to have knowledge of it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remove knowledge of HAVE_CLOCK_MONOTONIC
Donald Sharp [Sun, 8 Jan 2017 00:21:21 +0000 (19:21 -0500)]
pimd: Remove knowledge of HAVE_CLOCK_MONOTONIC

thread.c fails to build if we do not have CLOCK_MONOTONIC
no need to have pim have any knowledge of it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #54 from LabNConsulting/working/master/afi-safi-vty/a
Donald Sharp [Sat, 7 Jan 2017 22:14:27 +0000 (17:14 -0500)]
Merge pull request #54 from LabNConsulting/working/master/afi-safi-vty/a

Working/master/afi safi vty/a

7 years agobgpd: fixup safi as afi confusion in show update-groups
Lou Berger [Sat, 7 Jan 2017 18:41:33 +0000 (13:41 -0500)]
bgpd: fixup safi as afi confusion in show update-groups

7 years agobgpd: restore wildcard handling in show summary (Issue#14)
Lou Berger [Fri, 6 Jan 2017 23:25:56 +0000 (18:25 -0500)]
bgpd: restore wildcard handling in show summary (Issue#14)

7 years agobgpd: restore some missing afi/safi commands (Issue #14)
Lou Berger [Fri, 6 Jan 2017 15:50:31 +0000 (10:50 -0500)]
bgpd: restore some missing afi/safi commands (Issue #14)
      Added defines and parse utility functions
      Fix vty code that treated vpn&encap as AFIs
      and some other related vty printing/handline issues

7 years agoMerge pull request #10 from qlyoung/fix-proto_redistnum
Donald Sharp [Sat, 7 Jan 2017 00:46:41 +0000 (19:46 -0500)]
Merge pull request #10 from qlyoung/fix-proto_redistnum

all: use ->text when parsing protocol argument

7 years agoMerge branch 'master' into fix-proto_redistnum
Quentin Young [Sat, 7 Jan 2017 00:44:46 +0000 (19:44 -0500)]
Merge branch 'master' into fix-proto_redistnum

7 years agoMerge pull request #35 from qlyoung/fix-zebra-rf
Donald Sharp [Sat, 7 Jan 2017 00:42:09 +0000 (19:42 -0500)]
Merge pull request #35 from qlyoung/fix-zebra-rf

zebra: check route flags when deciding whether to update existing route

7 years agoMerge pull request #32 from qlyoung/fix-cli-nits2
Donald Sharp [Sat, 7 Jan 2017 00:38:28 +0000 (19:38 -0500)]
Merge pull request #32 from qlyoung/fix-cli-nits2

bgpd, ospfd, zebra: remove duplicate cli installs

7 years agoMerge pull request #30 from qlyoung/fix-cli-nits
Donald Sharp [Sat, 7 Jan 2017 00:37:28 +0000 (19:37 -0500)]
Merge pull request #30 from qlyoung/fix-cli-nits

vtysh: add `logical-router ...` to extract.pl ignore list

7 years agoMerge pull request #27 from qlyoung/fix-derefs2
Donald Sharp [Sat, 7 Jan 2017 00:36:59 +0000 (19:36 -0500)]
Merge pull request #27 from qlyoung/fix-derefs2

bgpd, lib: fix a few scan-build catches

7 years agoMerge pull request #24 from qlyoung/fix-uninitialized-jump
Donald Sharp [Sat, 7 Jan 2017 00:34:09 +0000 (19:34 -0500)]
Merge pull request #24 from qlyoung/fix-uninitialized-jump

lib: Initialize ->allowrepeat

7 years agoMerge remote-tracking branch 'origin/stable/2.0'
Donald Sharp [Fri, 6 Jan 2017 17:48:32 +0000 (12:48 -0500)]
Merge remote-tracking branch 'origin/stable/2.0'

7 years agoMerge pull request #50 from mwinter-osr/redhat-pkg-rename
Donald Sharp [Fri, 6 Jan 2017 17:41:43 +0000 (12:41 -0500)]
Merge pull request #50 from mwinter-osr/redhat-pkg-rename

Redhat pkg rename

7 years agoconfigure.ac: rename red hat spec from quagga.spec to frr.spec
Martin Winter [Fri, 6 Jan 2017 17:12:16 +0000 (00:12 +0700)]
configure.ac: rename red hat spec from quagga.spec to frr.spec

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agocumulus files: Rename Project from Quagga to FRR
Martin Winter [Fri, 6 Jan 2017 17:10:57 +0000 (00:10 +0700)]
cumulus files: Rename Project from Quagga to FRR

Default files used by redhat package scripts

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoredhat: rename project from Quagga to FRR
Martin Winter [Fri, 6 Jan 2017 16:45:13 +0000 (23:45 +0700)]
redhat: rename project from Quagga to FRR

Rename all instances of Quagga to FRR in red hat package files

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
7 years agoMerge pull request #49 from pguibert6WIND/frr_6wind_mpbgpgracefulrestart_2
Donald Sharp [Fri, 6 Jan 2017 15:22:11 +0000 (10:22 -0500)]
Merge pull request #49 from pguibert6WIND/frr_6wind_mpbgpgracefulrestart_2

Graceful Restart Route Preservation

7 years agoMerge remote-tracking branch 'origin/stable/2.0'
Donald Sharp [Fri, 6 Jan 2017 14:58:21 +0000 (09:58 -0500)]
Merge remote-tracking branch 'origin/stable/2.0'

7 years agobgpd: configure preserve forwarding state from vty
Julien Courtat [Tue, 17 May 2016 14:26:22 +0000 (16:26 +0200)]
bgpd: configure preserve forwarding state from vty

Preserve forwarding state bit can be set in OPEN message with the use of
new vty commands
bgp graceful-restart preserve-fw-state
no bgp graceful-restart preserve-fw-state

This must be set before activating the connection to a peer, since it is
for forging graceful restart capability of OPEN messages.

Signed-off-by: Julien Courtat <julien.courtat@6wind.com>
7 years agobgpd: enable send of Graceful Restart Preserve State F bit
Julien Courtat [Fri, 20 May 2016 10:10:07 +0000 (12:10 +0200)]
bgpd: enable send of Graceful Restart Preserve State F bit

Enhance struct bgp to add a new flag BGP_FLAG_GR_PRESERVE_FWD, which
allow to set the Preserve State F bit of Graceful Restart capability in
OPEN messages.

Signed-off-by: Julien Courtat <julien.courtat@6wind.com>
7 years agoMerge pull request #41 from donaldsharp/quagga_to_frr
Martin Winter [Fri, 6 Jan 2017 13:07:41 +0000 (20:07 +0700)]
Merge pull request #41 from donaldsharp/quagga_to_frr

Quagga to frr - Rename of Quagga to FRR (FreeRangeRouting)

7 years agoMerge pull request #45 from opensourcerouting/fixes/isis-for-stable
Donald Sharp [Fri, 6 Jan 2017 00:32:30 +0000 (19:32 -0500)]
Merge pull request #45 from opensourcerouting/fixes/isis-for-stable

isisd: don't generate LSPs with LSP-ID zero on is-type change

7 years agoisisd: don't generate LSPs with LSP-ID zero on is-type change
Christian Franke [Thu, 5 Jan 2017 19:22:31 +0000 (20:22 +0100)]
isisd: don't generate LSPs with LSP-ID zero on is-type change

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
7 years agoMerge pull request #43 from pguibert6WIND/frr_6wind_mpbgpgracefulrestart_1
Donald Sharp [Thu, 5 Jan 2017 12:58:32 +0000 (07:58 -0500)]
Merge pull request #43 from pguibert6WIND/frr_6wind_mpbgpgracefulrestart_1

 VPNv4 Enhancement of Graceful Restart

7 years agoRationalize Link Parameters flags
Olivier Dugeon [Tue, 20 Dec 2016 14:02:34 +0000 (15:02 +0100)]
Rationalize Link Parameters flags

 * lib/if.h: Remove LP_TE as Link Parameters is set if different from 0
See IS_LINK_PARAMS_SET macro and use LP_TE_METRIC to determine if TE metric
is set or not
 * lib/if.c: replace LP_TE by LP_TE_METRIC in default LP status
 * zebra/interface.c: replace LP_TE by LP_TE_METRIC and check if TE metric
is equal to standard metric or not
 * ospfd/ospf_te.c: replace LP_TE by LP_TE_METRIC
 * isisd/isis_te.c: replace LP_TE by LP_TE_METRIC

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
7 years agobgpd: support End-Of-Rib of VPNv4 address family
Julien Courtat [Fri, 17 Jun 2016 13:31:09 +0000 (15:31 +0200)]
bgpd: support End-Of-Rib of VPNv4 address family

After graceful restart procedure, when BGP speaker has finished to send
its VPNv4 routes to the restarting peer, it also sends End-Of-Rib
message for afi=AFI_IPv4 safi=SAFI_MPLS_VPN.

Signed-off-by: Julien Courtat <julien.courtat@6wind.com>
7 years agobgpd: graceful restart for vpnv4 address family
Julien Courtat [Wed, 25 May 2016 15:28:31 +0000 (17:28 +0200)]
bgpd: graceful restart for vpnv4 address family

This patch enable the support of graceful restart for routes sets with
vpnv4 address family format. In this specific case, data model is
slightly different and some additional processing must be done when
accessing bgp tables and nodes.
The clearing stale algorithm takes into account the specificity where
the 2 node level for MPLS has to be reached.

Signed-off-by: Julien Courtat <julien.courtat@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agolib: remove SAFI_RESERVED_3 and move SAFI_MPLS to that value
Philippe Guibert [Wed, 21 Dec 2016 07:21:02 +0000 (08:21 +0100)]
lib: remove SAFI_RESERVED_3 and move SAFI_MPLS to that value

Because SAFI_RESERVED_3 value is no more used, the SAFI_MPLS value is
lowered to that value.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agolib: add SAFI_RESERVED_4 value
Philippe Guibert [Wed, 21 Dec 2016 07:16:06 +0000 (08:16 +0100)]
lib: add SAFI_RESERVED_4 value

This value is used to limit certain feature to the safi values until
that reserved value.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agobgpd: set Graceful Restart R bit for vpnv4 address family
Julien Courtat [Fri, 20 May 2016 10:08:28 +0000 (12:08 +0200)]
bgpd: set Graceful Restart R bit for vpnv4 address family

Signed-off-by: Julien Courtat <julien.courtat@6wind.com>
7 years agodebian: Convert Quagga -> Frr
Donald Sharp [Wed, 4 Jan 2017 14:25:20 +0000 (09:25 -0500)]
debian: Convert Quagga -> Frr

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: Update ZAPI to version 4 and HEADER_MARKER to 254
Donald Sharp [Wed, 4 Jan 2017 13:03:14 +0000 (08:03 -0500)]
lib: Update ZAPI to version 4 and HEADER_MARKER to 254

Update the ZEBRA_HEADER_MARKER to 254.  This will differentiate
ourselves from Quagga.  Zebra should not listen to people not
properly using the right programs now.

Update the ZAPI version number to 4.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agodoc: Fixup quagga -> frr
Donald Sharp [Wed, 4 Jan 2017 12:53:30 +0000 (07:53 -0500)]
doc: Fixup quagga -> frr

Modify the documentation so that it talks about FRR instead of Quagga.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agowatchfrr: Rename watchquagga -> watchfrr
Donald Sharp [Wed, 4 Jan 2017 01:13:02 +0000 (20:13 -0500)]
watchfrr: Rename watchquagga -> watchfrr

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #37 from LabNConsulting/working/2.0/patch-set-170102a
David Lamparter [Tue, 3 Jan 2017 15:44:44 +0000 (16:44 +0100)]
Merge pull request #37 from LabNConsulting/working/2.0/patch-set-170102a

Working/2.0/patch set 170102a

7 years agoMerge pull request #28 from opensourcerouting/dev/osr/rename-part1
Donald Sharp [Tue, 3 Jan 2017 15:44:11 +0000 (10:44 -0500)]
Merge pull request #28 from opensourcerouting/dev/osr/rename-part1

rename, part1

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 agobgpd: fix ecommunity hash related leak
Lou Berger [Fri, 30 Dec 2016 21:48:29 +0000 (16:48 -0500)]
bgpd: fix ecommunity hash related leak

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgp: Use intern/unintern for encap to fix valgrind identified memory leak
Lou Berger [Sat, 17 Dec 2016 22:58:33 +0000 (17:58 -0500)]
bgp: Use intern/unintern for encap to fix valgrind identified memory leak

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agorfapi: pickup recent changes
Lou Berger [Fri, 4 Nov 2016 13:30:07 +0000 (09:30 -0400)]
rfapi: pickup recent changes
       expose bgp_rfapi_get_group_by_lni_label for use by rfp
       add EVPN Ethernet Tag (VID) RT
       ensure as is init'ed
       fix spelling of information

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgp: first pass at restoring missing vpn&encap show commands (issue#14)
Lou Berger [Sun, 18 Dec 2016 18:45:20 +0000 (13:45 -0500)]
bgp: first pass at restoring missing vpn&encap show commands (issue#14)

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agoBGP: deal with vnc related string ambiguities (issue #9)
G. Paul Ziemba [Fri, 4 Nov 2016 16:47:36 +0000 (09:47 -0700)]
BGP: deal with vnc related string ambiguities (issue #9)
    - "redist foo" parsing modified to check for foo==vnc and foo==vnc-direct
      instead of just leading 'v' character
    - string designating ZEBRA_ROUTE_VNC_DIRECT changed from "vpn" to "vnc-direct"
    - route_types.pl parser recognizes 7th field to restrict availability
      of a route type in the redist command to specific daemons
    - restrict "vnc-direct" to bgpd only (doesn't make sense elsewhere)
    - vnc documentation updated to match

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agolib/command.c: fix leak id'ed by valgrind
Lou Berger [Sat, 17 Dec 2016 18:26:03 +0000 (13:26 -0500)]
lib/command.c: fix leak id'ed by valgrind

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd: fix unitialized value check id'ed by valgrind
Lou Berger [Sat, 17 Dec 2016 18:20:59 +0000 (13:20 -0500)]
bgpd: fix unitialized value check id'ed by valgrind

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agoprefix.c: replace free with XFREE for memory allocated with XMALLOC
Lou Berger [Mon, 7 Nov 2016 12:33:15 +0000 (07:33 -0500)]
prefix.c: replace free with XFREE for memory allocated with XMALLOC

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agozebra: check route flags when deciding whether to update existing route
Quentin Young [Thu, 29 Dec 2016 07:01:05 +0000 (07:01 +0000)]
zebra: check route flags when deciding whether to update existing route

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agobgpd, ospfd, zebra: remove duplicate cli installs
Quentin Young [Thu, 29 Dec 2016 05:44:49 +0000 (05:44 +0000)]
bgpd, ospfd, zebra: remove duplicate cli installs

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #31 from opensourcerouting/freebsd-route-update-fix-for-2.0
David Lamparter [Wed, 28 Dec 2016 14:49:24 +0000 (15:49 +0100)]
Merge pull request #31 from opensourcerouting/freebsd-route-update-fix-for-2.0

Fixes #20

7 years agozebra: remove unused variable
Renato Westphal [Fri, 16 Dec 2016 14:51:07 +0000 (12:51 -0200)]
zebra: remove unused variable

It looks like 'nexthop_fib_num' has been lingering around since 2003
without any use. Remove it.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agodoc: add the ldpd vty port to the SERVICES file
Renato Westphal [Thu, 15 Dec 2016 18:24:54 +0000 (16:24 -0200)]
doc: add the ldpd vty port to the SERVICES file

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: fix FIB route updates on *BSD
Renato Westphal [Fri, 16 Dec 2016 12:48:37 +0000 (10:48 -0200)]
zebra: fix FIB route updates on *BSD

On *BSD, we update a route in the FIB by removing the old one and then
installing the new version.

With that said, on kernel_route_rib() we need to provide a pointer to
both the old version and the new version of the route.

We were, however, passing a pointer to the new version to both the
'old' and 'new' parameters. This is not a problem on Linux, which uses
NLM_F_REPLACE to update routes, but it breaks route updates on *BSD
because the 'old' parameter points to a route that is not installed in
the kernel. The kernel_route_rib() function then fails to uninstall the
supposedly 'old' route and can fail to install the new version as well if
the kernel doesn't support ECMP (e.g. FreeBSD with default configuration).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agovtysh: add `logical-router ...` to extract.pl ignore list
Quentin Young [Fri, 23 Dec 2016 01:58:29 +0000 (01:58 +0000)]
vtysh: add `logical-router ...` to extract.pl ignore list

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agobuild: rename (2 of ?): route_types macros
David Lamparter [Tue, 20 Dec 2016 17:31:42 +0000 (18:31 +0100)]
build: rename (2 of ?): route_types macros

All of the autogenerated macros in lib/route_types.pl are now called
FRR_* instead of QUAGGA_*.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: replace some hardcoding with ./configure
David Lamparter [Tue, 20 Dec 2016 17:10:30 +0000 (18:10 +0100)]
build: replace some hardcoding with ./configure

Several places have paths and names that can change hardcoded, e.g. the
package name and the /var/run path.  This fixes a few of them, there's
still some to do.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: remove INSTALL.quagga.txt
David Lamparter [Tue, 20 Dec 2016 16:59:13 +0000 (17:59 +0100)]
build: remove INSTALL.quagga.txt

It's horribly outdated & wrong info is worse than none.
doc/install.texi should probably be updated instead.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: more renaming in configure.ac
David Lamparter [Wed, 14 Dec 2016 19:22:59 +0000 (20:22 +0100)]
build: more renaming in configure.ac

7 years agobuild: rename (1 of ?): configure.ac + preproc
David Lamparter [Wed, 14 Dec 2016 18:30:44 +0000 (19:30 +0100)]
build: rename (1 of ?): configure.ac + preproc

This replaces Quagga -> FRR in most configure.ac settings as well as
a handful of preprocessor macros in the source code.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agodoc: use config values from configure in manpages
David Lamparter [Wed, 14 Dec 2016 19:22:25 +0000 (20:22 +0100)]
doc: use config values from configure in manpages

This makes the actual change to the manpages to get ./configure effects
applied into them.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agodoc: rename manpages to ".in" for autoconf
David Lamparter [Wed, 14 Dec 2016 19:24:34 +0000 (20:24 +0100)]
doc: rename manpages to ".in" for autoconf

The manpages contain references to installation paths and thus should be
preprocessed by ./configure to get the actual paths.

This commit is an exact-rename so the changes for the preprocessing are
easier to review (diffs in renames are hard to read...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: remove $Format tags
David Lamparter [Wed, 14 Dec 2016 18:14:04 +0000 (19:14 +0100)]
build: remove $Format tags

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #8 from donaldsharp/summary
David Lamparter [Tue, 20 Dec 2016 14:31:56 +0000 (15:31 +0100)]
Merge pull request #8 from donaldsharp/summary

bgpd: Fix 'show ip bgp summary' variable output being wrong

7 years agoMerge pull request #7 from donaldsharp/community
David Lamparter [Tue, 20 Dec 2016 14:29:43 +0000 (15:29 +0100)]
Merge pull request #7 from donaldsharp/community

frr: Modify doc to talk about cli

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 agobgpd, lib: fix a few scan-build catches
Quentin Young [Tue, 20 Dec 2016 03:12:32 +0000 (03:12 +0000)]
bgpd, lib: fix a few scan-build catches

Fixes a couple null pointer derefs and uninit'd values.

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: Initialize ->allowrepeat
Quentin Young [Sun, 18 Dec 2016 05:39:21 +0000 (05:39 +0000)]
lib: Initialize ->allowrepeat

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
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 agobgpd: Fix 'show ip bgp summary' variable output being wrong
Donald Sharp [Fri, 16 Dec 2016 02:28:51 +0000 (21:28 -0500)]
bgpd: Fix 'show ip bgp summary' variable output being wrong

The first time through calling 'show ip bgp summary'
we were always calculating the variable hostname field
size incorrectly.

Ticket: CM-13900
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agofrr: Modify doc to talk about cli
Donald Sharp [Fri, 16 Dec 2016 20:35:14 +0000 (15:35 -0500)]
frr: Modify doc to talk about cli

Add some verbiage to the COMMUNITY.md to talk
about the philosophy of what cli should do.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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 agoall: use ->text when parsing protocol argument
Quentin Young [Fri, 16 Dec 2016 05:39:44 +0000 (05:39 +0000)]
all: use ->text when parsing protocol argument

and match on full protocol name in proto_redistnum()

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #1 from donaldsharp/stable_patches
David Lamparter [Fri, 16 Dec 2016 03:51:12 +0000 (04:51 +0100)]
Merge pull request #1 from donaldsharp/stable_patches

A small collection of patches that fix issues found by valgrind

7 years agobgpd: Fix 'show ip bgp summary' variable output being wrong
Donald Sharp [Fri, 16 Dec 2016 02:28:51 +0000 (21:28 -0500)]
bgpd: Fix 'show ip bgp summary' variable output being wrong

The first time through calling 'show ip bgp summary'
we were always calculating the variable hostname field
size incorrectly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Cleanup double read of free'd data
Donald Sharp [Fri, 16 Dec 2016 01:41:47 +0000 (20:41 -0500)]
bgpd: Cleanup double read of free'd data

Valgrind found this issue.  This cleans it
up from happening.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: Ensure ptrs are NULL on free
Donald Sharp [Fri, 16 Dec 2016 01:39:46 +0000 (20:39 -0500)]
lib: Ensure ptrs are NULL on free

There exists a possibility that when we cleanup
for shutdown that we may attempt to access
them again.

Found via valgrind, stopped showing up in there.

Signed-off-by: Donald Sharp <sharpd@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.