]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
5 years agoyang, lib: add 'frr-interface.yang' and associated stub callbacks
Renato Westphal [Sun, 8 Jul 2018 01:04:33 +0000 (22:04 -0300)]
yang, lib: add 'frr-interface.yang' and associated stub callbacks

Introduce frr-interface.yang, which defines a model for managing FRR
interfaces.

Update the 'frr_yang_module_info' array of all daemons that will
implement this module.

Add automatically generated stub callbacks in if.c. These callbacks will
be implemented in the following commit.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: add a new northbound plugin for Sysrepo
Renato Westphal [Wed, 23 May 2018 23:12:29 +0000 (20:12 -0300)]
lib: add a new northbound plugin for Sysrepo

This plugin leverages the northbound API to integrate FRR with Sysrepo,
a YANG-based configuration and operational state data store.

The plugin is linked to the libsysrepo library and communicates with
the sysrepod daemon using GPB (Google Protocol Buffers) over AF_UNIX
sockets. The integration consists mostly of glue code that calls the
appropriate FRR northbound callbacks in response to events triggered
by the sysrepod daemon (e.g. request to change the configuration or to
fetch operational data).

To build the sysrepo plugin, provide the --enable-sysrepo option to the
configure script while building FRR (the libsysrepo library needs to be
installed in the system).

When installed, the sysrepo plugin will be available for all FRR daemons
and can be loaded using the -M (or --module) command line option.

Example: bgpd -M sysrepo.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: add a new northbound plugin for ConfD
Renato Westphal [Wed, 23 May 2018 23:11:59 +0000 (20:11 -0300)]
lib: add a new northbound plugin for ConfD

This plugin leverages the northbound API to integrate FRR with the ConfD
management agent.

The plugin is linked to the libconfd library and communicates with the
confd daemon using local TCP sockets. The integration consists mostly
of glue code that calls the appropriate FRR northbound callbacks in
response to events triggered by the confd daemon (e.g. request to change
the configuration or to fetch operational data).

By integrating FRR with the libconfd library, FRR can be managed using
all northbound interfaces provided by ConfD, including NETCONF, RESTCONF
and their Web API.

The ConfD CDB API is used to handle configuration changes and the ConfD
Data Provider API is used to provide operational data, process RPCs and
send notifications. Support for configuration management using the ConfD
Data Provider API is not available at this point.

The ConfD optional 'get_object()' and 'get_next_object()' callbacks were
implemented for optimal performance when fetching operational data.

This plugins requires ConfD 6.5 or later since it uses the new leaf-list
API introduced in ConfD 6.5.

To install the plugin, the --enable-confd option should be given to the
configure script, specifying the location where ConfD is installed.

Example: ./configure --enable-confd=/root/confd-6.6

When installed, the confd plugin will be available for all FRR daemons
and can be loaded using the -M (or --module) command line option.

Example: zebra -M confd.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years ago*: add empty array of YANG modules
Renato Westphal [Wed, 23 May 2018 23:29:50 +0000 (20:29 -0300)]
*: add empty array of YANG modules

FRR_DAEMON_INFO should now contain an array of 'frr_yang_module_info'
structures describing the YANG modules implemented by the daemon.

This array will be used by frr_init() function to load all YANG modules
and initialize the northbound callbacks during the daemon initialization.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: introduce new northbound API
Renato Westphal [Thu, 7 Dec 2017 19:31:48 +0000 (17:31 -0200)]
lib: introduce new northbound API

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #3235 from opensourcerouting/buildfoo-20181024
Lou Berger [Sat, 27 Oct 2018 18:14:35 +0000 (14:14 -0400)]
Merge pull request #3235 from opensourcerouting/buildfoo-20181024

build: potpourri

5 years agoMerge pull request #3206 from qlyoung/mac-token-change
David Lamparter [Sat, 27 Oct 2018 11:57:35 +0000 (13:57 +0200)]
Merge pull request #3206 from qlyoung/mac-token-change

lib: change M:A:C to X:X:X:X:X:X

5 years agoMerge pull request #3199 from donaldsharp/eigrp_key
David Lamparter [Fri, 26 Oct 2018 20:25:36 +0000 (22:25 +0200)]
Merge pull request #3199 from donaldsharp/eigrp_key

Eigrp cli stuff

5 years agoMerge pull request #2926 from donaldsharp/router
David Lamparter [Fri, 26 Oct 2018 20:24:15 +0000 (22:24 +0200)]
Merge pull request #2926 from donaldsharp/router

zebra_ns split up

5 years agoMerge pull request #3237 from donaldsharp/actual_error
David Lamparter [Fri, 26 Oct 2018 20:21:44 +0000 (22:21 +0200)]
Merge pull request #3237 from donaldsharp/actual_error

lib: If command was successful don't store the command as an error

5 years agoMerge pull request #3227 from qlyoung/fix-exit-vrf-placement-upstream
David Lamparter [Fri, 26 Oct 2018 20:21:27 +0000 (22:21 +0200)]
Merge pull request #3227 from qlyoung/fix-exit-vrf-placement-upstream

vtysh: fix exit-vrf printing

5 years agoMerge pull request #3236 from qlyoung/finish-onlink
David Lamparter [Fri, 26 Oct 2018 20:19:33 +0000 (22:19 +0200)]
Merge pull request #3236 from qlyoung/finish-onlink

Finish onlink stuff

5 years agoMerge pull request #3247 from opensourcerouting/spelchek
Quentin Young [Thu, 25 Oct 2018 19:46:51 +0000 (15:46 -0400)]
Merge pull request #3247 from opensourcerouting/spelchek

*: spelchek

5 years ago*: spelchek
David Lamparter [Thu, 25 Oct 2018 18:06:59 +0000 (20:06 +0200)]
*: spelchek

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agolib: If command was successful don't store the command as an error
Donald Sharp [Thu, 25 Oct 2018 01:03:18 +0000 (21:03 -0400)]
lib: If command was successful don't store the command as an error

The CMD_SUCCESS_DAEMON case should be excluded from storing the command line
that we think failed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoeigrpd: Fix bandwidth command to actually read input properly
Donald Sharp [Wed, 24 Oct 2018 23:58:14 +0000 (19:58 -0400)]
eigrpd: Fix bandwidth command to actually read input properly

The bandwidth command was not properly reading cli input
and would do weird stuff with the input.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoeigrpd: Convert keychain authentication to DEFPY
Donald Sharp [Thu, 18 Oct 2018 12:13:38 +0000 (08:13 -0400)]
eigrpd: Convert keychain authentication to DEFPY

The keychain authentication code under eigrp was
using the wrong argv numbers for keychain lookup.  Convert
to DEFPY.

I do not actually know if this allows eigrp authentication to
work.  But this connects up a bit more of the pieces if it does.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agovtysh: Allow eigrp and rip access to keychain.c config
Donald Sharp [Thu, 18 Oct 2018 12:12:39 +0000 (08:12 -0400)]
vtysh: Allow eigrp and rip access to keychain.c config

The key-chain code was specific to rip and as such was not
being delivered to eigrp.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3121 from pguibert6WIND/flowspec_json_issue
Donald Sharp [Wed, 24 Oct 2018 23:41:15 +0000 (19:41 -0400)]
Merge pull request #3121 from pguibert6WIND/flowspec_json_issue

bgpd: fill in prefix for flowspec entry when json format is requested

5 years agolib: change M:A:C to X:X:X:X:X:X
Quentin Young [Fri, 19 Oct 2018 18:36:06 +0000 (18:36 +0000)]
lib: change M:A:C to X:X:X:X:X:X

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #3234 from donaldsharp/bsd_install_failure
Renato Westphal [Wed, 24 Oct 2018 19:14:15 +0000 (16:14 -0300)]
Merge pull request #3234 from donaldsharp/bsd_install_failure

zebra: Notice when a route fails to install on *bsd

5 years agobuild: add "redistclean" target
David Lamparter [Wed, 24 Oct 2018 15:31:31 +0000 (17:31 +0200)]
build: add "redistclean" target

This puts a source tree back in the state it was in after unpacking a
dist tarball.  Different from distclean in that it doesn't remove files
that are included in the tarball.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agobuild: make clean and dist consistent
David Lamparter [Wed, 24 Oct 2018 15:44:04 +0000 (17:44 +0200)]
build: make clean and dist consistent

We weren't cleaning up some files (a whole lot of python foobar) and had
some files in the dist tarball that don't quite belong there.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agobuild: work around automake wtf
David Lamparter [Mon, 15 Oct 2018 04:51:30 +0000 (06:51 +0200)]
build: work around automake wtf

For some reason, automake was "randomizing" the order of these few lines
in the generated output Makefile.in.

I have absolutely no clue what's going on, but it's the only thing
preventing me from building reproducible source tarballs (i.e.
bit-exactly identical), so... just slightly "rephrase" this.

Should behave exactly the same as before.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #3229 from opensourcerouting/bugfix/fabricd-distribution
Donald Sharp [Wed, 24 Oct 2018 16:22:13 +0000 (12:22 -0400)]
Merge pull request #3229 from opensourcerouting/bugfix/fabricd-distribution

Add fabricd to distribution scripts

5 years agozebra: Notice when a route fails to install on *bsd
Donald Sharp [Wed, 24 Oct 2018 15:34:50 +0000 (11:34 -0400)]
zebra: Notice when a route fails to install on *bsd

When we fail to install a route into bsd, note the case
where we have no viable nexthops installed for it, so
that we can know in zebra if the route is good or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agodebianpkg, tools: Add fabricd to distribution scripts
Christian Franke [Wed, 24 Oct 2018 02:31:09 +0000 (04:31 +0200)]
debianpkg, tools: Add fabricd to distribution scripts

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agobuild: carry --with-pkg-extra-version into tarballs
David Lamparter [Tue, 23 Oct 2018 12:06:25 +0000 (14:06 +0200)]
build: carry --with-pkg-extra-version into tarballs

If we use "./configure --with-pkg-extra-version=... && make dist", we
probably want the dist tarball to remember the extra version it was
configured with.

Use --without-pkg-extra-version to kill the tag.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #3225 from donaldsharp/revert_default_originate_changes
David Lamparter [Wed, 24 Oct 2018 13:02:12 +0000 (15:02 +0200)]
Merge pull request #3225 from donaldsharp/revert_default_originate_changes

bgp: Revert default originate changes to allow set

5 years agoMerge pull request #3230 from opensourcerouting/feature/isis-improve-lsp-scheduling
Donald Sharp [Wed, 24 Oct 2018 11:49:50 +0000 (07:49 -0400)]
Merge pull request #3230 from opensourcerouting/feature/isis-improve-lsp-scheduling

Feature: IS-IS improve lsp scheduling

5 years agozebra: Move rtadv to zebra_router
Donald Sharp [Mon, 27 Aug 2018 19:34:36 +0000 (15:34 -0400)]
zebra: Move rtadv to zebra_router

The rtadv setting was not per namespace it is per router.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Remove _wrap_script from hook names
Donald Sharp [Mon, 27 Aug 2018 19:28:52 +0000 (15:28 -0400)]
zebra: Remove _wrap_script from hook names

The _wrap_script inclusion implies a certain end functionality
of which we don't care.  We just care that the hooks are called.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move ipset_hash, ipset_entry_hash and iptable_hash into zrouter
Donald Sharp [Mon, 27 Aug 2018 19:24:02 +0000 (15:24 -0400)]
zebra: Move ipset_hash, ipset_entry_hash and iptable_hash into zrouter

These three data structures belong in the `zebra_router` structure
as that they do not belong in `struct zebra_ns`.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move rules_hash to zrouter
Donald Sharp [Mon, 27 Aug 2018 18:36:46 +0000 (14:36 -0400)]
zebra: Move rules_hash to zrouter

Move the rules_hash to the zrouter data structure and provide
the additional bit of work needed to lookup the rule based upon
the namespace id as well.  Make the callers of functions not
care about what namespace id we are in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Start breakup of zns into zrouter and zns
Donald Sharp [Mon, 27 Aug 2018 14:43:37 +0000 (10:43 -0400)]
zebra: Start breakup of zns into zrouter and zns

The `struct zebra_ns` data structure is being used
for both router information as well as support for
the vrf backend( as appropriate ).  This is a confusing
state.  Start the movement of `struct zebra_ns` into
2 things `struct zebra_router` and `struct zebra_ns`.

In this new regime `struct zebra_router` is purely
for handling data about the router.  It has no knowledge
of the underlying representation of the Data Plane.

`struct zebra_ns` becomes a linux specific bit of code
that allows us to handle the vrf backend and is allowed
to have knowledge about underlying data plane constructs.

When someone implements a *bsd backend the zebra_vrf data
structure will need to be abstracted to take advantage of this
instead of relying on zebra_ns.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agostaticd: finish missing onlink pieces
Quentin Young [Wed, 24 Oct 2018 06:54:15 +0000 (06:54 +0000)]
staticd: finish missing onlink pieces

Missed a cherry-pick somewhere, `onlink` was never actually displayed in
the config although it could be configured.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoisisd: delay lsp regeneration while events are still coming in
Christian Franke [Wed, 24 Oct 2018 05:19:22 +0000 (07:19 +0200)]
isisd: delay lsp regeneration while events are still coming in

When there is a stream of events coming in, where IS-IS learns
about a lot of updates, IS-IS would regenerate its LSPs before
the updates have been processed completely.

This causes suboptimal convergence because the intermediate state
will be flooded. Only after the configured `lsp_gen_interval`, a
new update with the correct and final state will be generated.

Resolve this by holding off LSP generation while there are still
events coming in.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: Combine lsp_l1/l2_refresh
Christian Franke [Wed, 24 Oct 2018 04:27:17 +0000 (06:27 +0200)]
isisd: Combine lsp_l1/l2_refresh

lsp_l1_refresh and lsp_l2_refresh are identical apart from the
hardcoded IS-IS level they are referring to. So merge them and
pass the level as part of the argument.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: Log LSP-update trigger source
Christian Franke [Wed, 24 Oct 2018 03:38:53 +0000 (05:38 +0200)]
isisd: Log LSP-update trigger source

For debugging the timing of LSP generation, it is useful to know
which event caused a regeneration to be scheduled. Therefore, add
this information to the debug log.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: Log SPF trigger source when debugging
Christian Franke [Wed, 24 Oct 2018 03:28:12 +0000 (05:28 +0200)]
isisd: Log SPF trigger source when debugging

For debugging the scheduling of SPF, it is useful to see from
where an SPF run is scheduled. So add this information to the
log.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agovtysh: fix exit-vrf printing
Quentin Young [Tue, 23 Oct 2018 21:20:01 +0000 (21:20 +0000)]
vtysh: fix exit-vrf printing

Resolves issue with exit-vrf being placed at the end of zebra's portion
of a vrf block, but before other daemons' portions of the same config
block.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoRevert "bgpd: Set attributes according route-maps if applied for default-originate"
Donald Sharp [Tue, 23 Oct 2018 20:25:08 +0000 (16:25 -0400)]
Revert "bgpd: Set attributes according route-maps if applied for default-originate"

This reverts commit 74401e62721b8f83ff0e34127d6235fda112c7c8.

5 years agoRevert "bgpd: Make sure default-originate works without route-map as well"
Donald Sharp [Tue, 23 Oct 2018 20:21:02 +0000 (16:21 -0400)]
Revert "bgpd: Make sure default-originate works without route-map as well"

This reverts commit c2e10422033771da9f12a4a283b0bc767240a3d8.

5 years agobgpd: When displaying default originate debugs don't print gibberish
Donald Sharp [Tue, 23 Oct 2018 20:13:46 +0000 (16:13 -0400)]
bgpd: When displaying default originate debugs don't print gibberish

The tx_id_buf was not being set to anything in some cases,
make sure it's a null string before using.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3222 from srimohans/community
David Lamparter [Tue, 23 Oct 2018 19:34:04 +0000 (21:34 +0200)]
Merge pull request #3222 from srimohans/community

bgpd:Fixing the signature of community_free function

5 years agoMerge branch 'master' of https://github.com/FRRouting/frr into community
Sri Mohana Singamsetty [Tue, 23 Oct 2018 16:53:39 +0000 (09:53 -0700)]
Merge branch 'master' of https://github.com/FRRouting/frr into community

5 years agobgpd:Fixing the signature of community_free function
Sri Mohana Singamsetty [Mon, 22 Oct 2018 19:58:39 +0000 (12:58 -0700)]
bgpd:Fixing the signature of community_free function

community_free, lcommunity_free and ecommunity_free are similar type of functions. Most of the places, these three are called together. The signature of community_free is different from other two functions. Modified the community_free API signature to align with other two functions to avoid any confusion. There is no functionality impact with this and this is just to avoid any confusion.

Testing: manual testing and show commands
Signed-off-by: Sri Mohana Singamsetty msingamsetty@vmware.com
5 years agoMerge pull request #3204 from ton31337/fix/make_vrf_import_default_selectable
David Lamparter [Tue, 23 Oct 2018 16:34:15 +0000 (18:34 +0200)]
Merge pull request #3204 from ton31337/fix/make_vrf_import_default_selectable

bgpd: Select default routing table when importing VRF routes into global

5 years agobgpd: Select default routing table when importing VRF routes into global
Donatas Abraitis [Fri, 19 Oct 2018 12:56:09 +0000 (15:56 +0300)]
bgpd: Select default routing table when importing VRF routes into global

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agobgpd: fill in prefix for flowspec entry when json format is requested
Philippe Guibert [Mon, 1 Oct 2018 15:06:26 +0000 (17:06 +0200)]
bgpd: fill in prefix for flowspec entry when json format is requested

as prefix is opaque for flowspec, and json needs to have a non empty
full of meaning value in prefix, the proposal is to encode the
displayable form of flowspec entry.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agoMerge pull request #3175 from donaldsharp/show_run_static
David Lamparter [Tue, 23 Oct 2018 10:46:09 +0000 (12:46 +0200)]
Merge pull request #3175 from donaldsharp/show_run_static

vtysh: Add some missing daemons to some commands in vtysh

5 years agoMerge branch 'pull/3165'
David Lamparter [Tue, 23 Oct 2018 10:42:42 +0000 (12:42 +0200)]
Merge branch 'pull/3165'

...with an additional comment.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agozebra: add comment about Linux ifdown handling
David Lamparter [Tue, 23 Oct 2018 10:42:06 +0000 (12:42 +0200)]
zebra: add comment about Linux ifdown handling

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge branch 'pull/3197'
David Lamparter [Tue, 23 Oct 2018 10:31:25 +0000 (12:31 +0200)]
Merge branch 'pull/3197'

...with a nit fix

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoripd: fix list compare order
David Lamparter [Tue, 23 Oct 2018 10:30:00 +0000 (12:30 +0200)]
ripd: fix list compare order

As noted in review comment by @rwestphal

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #3209 from opensourcerouting/cli-fuzzer-fixes
Quentin Young [Mon, 22 Oct 2018 19:48:46 +0000 (15:48 -0400)]
Merge pull request #3209 from opensourcerouting/cli-fuzzer-fixes

CLI fuzzer fixes

5 years agoMerge pull request #3214 from donaldsharp/ospf_crash
Lou Berger [Sat, 20 Oct 2018 18:28:00 +0000 (14:28 -0400)]
Merge pull request #3214 from donaldsharp/ospf_crash

ospfd: Do not allow thread drop

5 years agoospfd: fix issue with the "no segment-routing prefix A.B.C.D/M" command
Renato Westphal [Fri, 19 Oct 2018 18:55:47 +0000 (15:55 -0300)]
ospfd: fix issue with the "no segment-routing prefix A.B.C.D/M" command

Add a missing check to bail out earlier when SR is not configured. The
same command without the "no" prefix has the same check as it prevents
unexpected things (i.e. crashes) from happening.

Fixes the following segfaults:
ospfd aborted: vtysh -c "configure terminal" -c "router ospf" -c "no segment-routing prefix 1.1.1.1/32"
ospfd aborted: vtysh -c "configure terminal" -c "router ospf" -c "no segment-routing prefix 1.1.1.1/32 index 65535 no-php-flag"

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoospf6d: fix two "show" commands
Renato Westphal [Fri, 19 Oct 2018 18:55:41 +0000 (15:55 -0300)]
ospf6d: fix two "show" commands

The "show ipv6 ospf6 interface [IFNAME] prefix" command shouldn't accept
the "match" keyword when a prefix is not given, otherwise ospf6d will
crash.

Fixes the following crashes:
ospf6d aborted: vtysh  -c "show ipv6 ospf6 interface eth99 prefix match"
ospf6d aborted: vtysh  -c "show ipv6 ospf6 interface prefix match"

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: fix the "no match ipv6 next-hop type" command
Renato Westphal [Fri, 19 Oct 2018 18:55:31 +0000 (15:55 -0300)]
lib: fix the "no match ipv6 next-hop type" command

Trivial NULL pointer dereference bug.

Fixes the following crash:
bgpd aborted: vtysh -c "configure terminal" -c "route-map RMAP permit 1" -c "no match ipv6 next-hop type"

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobgpd: use the vrf_bitmap_*() helper functions when necessary
Renato Westphal [Fri, 19 Oct 2018 18:55:22 +0000 (15:55 -0300)]
bgpd: use the vrf_bitmap_*() helper functions when necessary

zclient->redist[afi][type] is a hash table and not an integer since a
while ago when VRF support was introduced. As such, zclient->redist[][]
should never be manipulated directly, the vrf_bitmap_*() helper functions
should be used instead. This fixes a few crashes found by the CLI fuzzer.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobgpd: fix bug while iterating over VPN table
Renato Westphal [Fri, 19 Oct 2018 18:55:12 +0000 (15:55 -0300)]
bgpd: fix bug while iterating over VPN table

The routing table data structure can create intermediate route nodes
during its normal operation, so we always need to check if the 'info'
pointer of a route node is NULL or not before dereferencing it.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobgpd: remove wrong assert
Renato Westphal [Fri, 19 Oct 2018 18:55:08 +0000 (15:55 -0300)]
bgpd: remove wrong assert

The vnc_direct_del_rn_group_rd() function can be called with the 'afi'
parameter set to AFI_L2VPN on some specific cases. Remove the assert to
fix the crash.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobgpd: fix NULL pointer dereference bug
Renato Westphal [Fri, 19 Oct 2018 18:55:03 +0000 (15:55 -0300)]
bgpd: fix NULL pointer dereference bug

Other parts of the rfapi code check if the 'rfg->rfapi_import_table'
pointer is NULL or not before using it. Do the same here to fix a crash
detected by the CLI fuzzer.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobgpd: add a NULL check to prevent a crash in the rfapi code
Renato Westphal [Fri, 19 Oct 2018 18:54:57 +0000 (15:54 -0300)]
bgpd: add a NULL check to prevent a crash in the rfapi code

The rfapiDeleteRemotePrefixesIt() function checks on several places if
'p' is NULL or not. Introduce an additional NULL check to prevent a
crash from happening.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobgpd: fix crashes caused by missing input validation
Renato Westphal [Fri, 19 Oct 2018 18:54:47 +0000 (15:54 -0300)]
bgpd: fix crashes caused by missing input validation

The rfapi code wasn't checking if strtoul() succeeded or not when parsing
the list of labels. Fix the affected commands by not allowing the user
to enter a non-numeric input.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobgpd: fix some NULL pointer dereference bugs
Renato Westphal [Fri, 19 Oct 2018 18:54:26 +0000 (15:54 -0300)]
bgpd: fix some NULL pointer dereference bugs

Other parts of the rfapi code also check if these pointers are NULL or
not before using them.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobgpd: fix the "no neighbor A.B.C.D maximum-prefix" command
Renato Westphal [Fri, 19 Oct 2018 18:54:05 +0000 (15:54 -0300)]
bgpd: fix the "no neighbor A.B.C.D maximum-prefix" command

The peer->group pointer is set only if the PEER_STATUS_GROUP flag is
set in the peer. Add a protection to prevent a NULL pointer dereference.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobgpd: handle NULL pointers in lcommunity_cmp()
Renato Westphal [Fri, 19 Oct 2018 18:53:55 +0000 (15:53 -0300)]
bgpd: handle NULL pointers in lcommunity_cmp()

Like community_cmp() and ecommunity_cmp(), the lcommunity_cmp() function
also needs to handle NULL pointers for correct operation.

Without this fix, bgpd can crash when entering the following commands:
vtysh -c "configure terminal" -c "ip large-community-list standard WORD deny"
vtysh -c "configure terminal" -c "no ip large-community-list expanded WORD"

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobgpd: fix cleanup of dampening configuration
Renato Westphal [Fri, 19 Oct 2018 18:53:46 +0000 (15:53 -0300)]
bgpd: fix cleanup of dampening configuration

The bgp_damp_config_clean() function was deallocating some arrays without
resetting the variables that represent their sizes. This was leading to
some crashes because other parts of the code iterate over these arrays
by looking at their corresponding sizes, which could be invalid.

Fixes the following segfaults (which only happen under certain
circumstances):
vtysh -c "configure terminal" -c "router bgp 1" -c "bgp dampening"
vtysh -c "configure terminal" -c "router bgp 1" -c "no bgp dampening"
vtysh -c "configure terminal" -c "router bgp 1" -c "no bgp dampening 45"
vtysh -c "" -c "clear ip bgp dampening"

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobfdd: do not allow multihop peers without a local-address
Renato Westphal [Fri, 19 Oct 2018 18:53:33 +0000 (15:53 -0300)]
bfdd: do not allow multihop peers without a local-address

The BFD code assumes that multihop peers have a local address
configured. When that doesn't happen, the BFD client daemons fail to
decode some BFD ZAPI messages and abort. To fix this, do not accept the
configuration of multhop peers unless a local-address is configured.

Fixes the following segfaults:
- bgpd aborted: vtysh -c "configure terminal" -c "bfd" -c "peer 1.1.1.1 multihop"
- bgpd aborted: vtysh -c "configure terminal" -c "bfd" -c "peer 1.1.1.1 multihop vrf NAME"
- bgpd aborted: vtysh -c "configure terminal" -c "bfd" -c "peer 1.1.1.1 vrf NAME multihop"
- ospf6d aborted: vtysh -c "configure terminal" -c "bfd" -c "peer 1.1.1.1 multihop"
- ospf6d aborted: vtysh -c "configure terminal" -c "bfd" -c "peer 1.1.1.1 multihop vrf NAME"
- ospf6d aborted: vtysh -c "configure terminal" -c "bfd" -c "peer 1.1.1.1 vrf NAME multihop"

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #3212 from donaldsharp/rmap_crash
Renato Westphal [Sat, 20 Oct 2018 14:56:44 +0000 (11:56 -0300)]
Merge pull request #3212 from donaldsharp/rmap_crash

Rmap crash

5 years agoospfd: Do not allow thread drop
Donald Sharp [Sat, 20 Oct 2018 12:59:30 +0000 (08:59 -0400)]
ospfd: Do not allow thread drop

When the ospf->oi_write_q is not empty that means that ospf could
already have a thread scheduled for running.  Just dropping
the pointer before resheduling does not stop the one currently
scheduled for running from running.  The calling of thread_add_write
checks to see if we are already running and does the right thing here
so it is sufficient to just call thread_add_write.

This issue was tracked down from this stack trace:

Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [EC 134217739] interface eth2.1032:172.16.4.110: ospf_check_md5 bad sequence 5333618 (expect 5333649)
Oct 19 18:04:00 VYOS-R1 ospfd[1811]: message repeated 3 times: [ [EC 134217739] interface eth2.1032:172.16.4.110: ospf_check_md5 bad sequence 5333618 (expect 5333649)]
Oct 19 18:04:00 VYOS-R1 ospfd[1811]: Assertion `node’ failed in file ospfd/ospf_packet.c, line 666, function ospf_write
Oct 19 18:04:00 VYOS-R1 ospfd[1811]: Backtrace for 8 stack frames:
Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 0] /usr/lib/libfrr.so.0(zlog_backtrace+0x3a) [0x7fef3efe9f8a]
Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 1] /usr/lib/libfrr.so.0(_zlog_assert_failed+0x61) [0x7fef3efea501]
Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 2] /usr/lib/frr/ospfd(+0x2f15e) [0x562e0c91815e]
Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 3] /usr/lib/libfrr.so.0(thread_call+0x60) [0x7fef3f00d430]
Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 4] /usr/lib/libfrr.so.0(frr_run+0xd8) [0x7fef3efe7938]
Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 5] /usr/lib/frr/ospfd(main+0x153) [0x562e0c901753]
Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 6] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fef3d83db45]
Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 7] /usr/lib/frr/ospfd(+0x190be) [0x562e0c9020be]
Oct 19 18:04:00 VYOS-R1 ospfd[1811]: Current thread function ospf_write, scheduled from file ospfd/ospf_packet.c, line 881
Oct 19 18:04:00 VYOS-R1 zebra[1771]: [EC 4043309116] Client ‘ospf’ encountered an error and is shutting down.
Oct 19 18:04:00 VYOS-R1 zebra[1771]: client 41 disconnected. 0 ospf routes removed from the rib

We had an assert(node) in ospf_write, which means that the list was empty.  So I just
searched until I saw a code path that allowed multiple writes to the ospf_write function.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Dissallow v6 routes from setting a v4 nexthop
Donald Sharp [Sat, 20 Oct 2018 00:43:47 +0000 (20:43 -0400)]
bgpd: Dissallow v6 routes from setting a v4 nexthop

Do not allow a v6 route to set a v4 nexthop via a routemap.
As that this will crash bgp.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Prep commit to cleanup indentation
Donald Sharp [Sat, 20 Oct 2018 00:38:03 +0000 (20:38 -0400)]
bgpd: Prep commit to cleanup indentation

Signed-off-by: Donald Sharp <sahrpd@cumulusnetworks.com>
5 years ago*: Replace hash_cmp function return value to a bool
Donald Sharp [Wed, 17 Oct 2018 19:27:12 +0000 (15:27 -0400)]
*: Replace hash_cmp function return value to a bool

The ->hash_cmp and linked list ->cmp functions were sometimes
being used interchangeably and this really is not a good
thing.  So let's modify the hash_cmp function pointer to return
a boolean and convert everything to use the new syntax.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years ago*: Fixup to use proper list_cmp functions
Donald Sharp [Wed, 17 Oct 2018 19:31:09 +0000 (15:31 -0400)]
*: Fixup to use proper list_cmp functions

We had a variety of issues with sorted list compare functions.
This commit identifies and fixes these issues.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3203 from opensourcerouting/buildfoo-20181015
Donald Sharp [Fri, 19 Oct 2018 13:11:31 +0000 (09:11 -0400)]
Merge pull request #3203 from opensourcerouting/buildfoo-20181015

Debian packaging & generic build stuff

5 years agobuild: rewrite readline/curses check
David Lamparter [Sat, 6 Oct 2018 21:28:19 +0000 (23:28 +0200)]
build: rewrite readline/curses check

We don't need termcap/tinfo/curses, those are just for libreadline.  On
most modern systems, libreadline will pull in the appropriate libs it
needs on its own, so unconditionally adding them adds an extra unneeded
dependency for us.

Still need to try with curses/... for some systems, but only after bare
readline fails.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agodebianpkg: remove bad USE_* options, add WERROR
David Lamparter [Mon, 15 Oct 2018 05:03:20 +0000 (07:03 +0200)]
debianpkg: remove bad USE_* options, add WERROR

This strips the USE_PIM, USE_BFD and USE_LDP options, all of which are
just straight up counterproductive knobs.

Instead, --enable-werror really needs to default to off, so add an
option for that.

Lastly, use --disable-dependency-tracking to speed up the build.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agodebianpkg: clean up dependencies
David Lamparter [Mon, 15 Oct 2018 05:02:47 +0000 (07:02 +0200)]
debianpkg: clean up dependencies

- accept either python2 or python3 packages for everything
- drop texlive-latex-base, texlive-generic-recommended (only needed for
  PDF docs)
- python-ipaddr is not a build time requirement, only runtime

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agodebianpkg: strip ancient/unused cruft
David Lamparter [Mon, 15 Oct 2018 05:00:42 +0000 (07:00 +0200)]
debianpkg: strip ancient/unused cruft

The SNMP MIB directory is unneeded, --enable-poll has been long gone,
the "build" target is straight up wrong (causing FRR to be built in the
install step) and we haven't needed /proc for configure in ages either.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agobuild: try to use -D option for ar and ranlib
David Lamparter [Sun, 7 Oct 2018 00:49:20 +0000 (02:49 +0200)]
build: try to use -D option for ar and ranlib

The -D option zeroes out timestamps in .a files and has become the
default on recent distributions to enable reproducible builds.

This also shuts up the "u ignored because D is default" warning that is
showing up on some distributions.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agobuild: fix some escapes in configure.ac
David Lamparter [Sun, 7 Oct 2018 22:49:24 +0000 (00:49 +0200)]
build: fix some escapes in configure.ac

Some test statements were missing "" around variables causing syntax
errors during configure runs.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #3201 from donaldsharp/breadcrumbs_for_donald
David Lamparter [Fri, 19 Oct 2018 11:07:15 +0000 (13:07 +0200)]
Merge pull request #3201 from donaldsharp/breadcrumbs_for_donald

zebra: Add some missing breadcrumbs

5 years agoMerge pull request #3186 from donaldsharp/aggregate_ecomm
David Lamparter [Fri, 19 Oct 2018 10:34:08 +0000 (12:34 +0200)]
Merge pull request #3186 from donaldsharp/aggregate_ecomm

Aggregate ecommunity and lcommunity addition

5 years agoMerge pull request #3163 from donaldsharp/more_vty_errors
David Lamparter [Fri, 19 Oct 2018 10:11:21 +0000 (12:11 +0200)]
Merge pull request #3163 from donaldsharp/more_vty_errors

lib, vtysh: Allow notification across multiple lines of failure

5 years agoMerge pull request #3191 from donaldsharp/more_vty
Renato Westphal [Thu, 18 Oct 2018 14:54:58 +0000 (11:54 -0300)]
Merge pull request #3191 from donaldsharp/more_vty

bgpd: Add a better breadcrumb for interface based peers

5 years agoMerge pull request #3189 from opensourcerouting/libunwind
Donald Sharp [Thu, 18 Oct 2018 14:45:32 +0000 (10:45 -0400)]
Merge pull request #3189 from opensourcerouting/libunwind

lib: add libunwind support for backtraces

5 years agozebra: Add some missing breadcrumbs
Donald Sharp [Thu, 18 Oct 2018 13:13:18 +0000 (09:13 -0400)]
zebra: Add some missing breadcrumbs

During a debugging session last night I discovered that I was
still having some `fun` figuring out why zebra was not making
a route's nexthop active.  After some debugging I figured out
that I was missing some states that we could end up in that
didn't have debug information about what happened in nexthop_active.

Add the missing breadcrumbs for nexthop resolution.  In addition
add a bit of code to notice the ebgp state without recursion turned
on and to let the user know about it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3195 from donaldsharp/nht_crash
David Lamparter [Thu, 18 Oct 2018 03:10:37 +0000 (05:10 +0200)]
Merge pull request #3195 from donaldsharp/nht_crash

Nht crash

5 years agoMerge pull request #3190 from qlyoung/allow-static-onlink
Renato Westphal [Thu, 18 Oct 2018 02:26:04 +0000 (23:26 -0300)]
Merge pull request #3190 from qlyoung/allow-static-onlink

staticd: add ability to create onlink static route

5 years agoMerge pull request #3196 from dslicenc/l2vpn-evpn-upd-grps
Renato Westphal [Thu, 18 Oct 2018 01:49:44 +0000 (22:49 -0300)]
Merge pull request #3196 from dslicenc/l2vpn-evpn-upd-grps

bgpd: add command to display update groups for l2vpn evpn

5 years agolib: add libunwind support for backtraces
David Lamparter [Thu, 24 Aug 2017 14:09:48 +0000 (16:09 +0200)]
lib: add libunwind support for backtraces

libunwind provides an alternate to backtrace() for printing out the call
stack of a particular location.  It doesn't use the frame pointer, it
goes by the DWARF debug info.  In most cases the traces have exactly the
same information, but there are some situations where libunwind traces
are better.

(On some platforms, the libc backtrace() also uses the DWARF debug info
[e.g.: ARM backtraces are impossible without it] but this is not the
case everywhere, especially not on BSD libexecinfo.)

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agozebra: remove kernel routes that are suppressed
Philippe Guibert [Thu, 11 Oct 2018 17:04:05 +0000 (19:04 +0200)]
zebra: remove kernel routes that are suppressed

on some cases, kernel routes are not selected, because the kernel
suppressed it without informing the netlink layer that the route has
been suppressed ( for instance, when an interface goes down, the route
never goes back when interface goes up again). This commit intends to
suppress that entry from zebra.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: add command to display update groups for l2vpn evpn
Don Slice [Wed, 17 Oct 2018 13:35:10 +0000 (13:35 +0000)]
bgpd: add command to display update groups for l2vpn evpn

For troubleshooting purposes, it's useful to display the update-groups
for l2vpn evpn

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agoMerge pull request #3192 from lkrishnamoor/evpn_route_server
Donald Sharp [Wed, 17 Oct 2018 18:38:31 +0000 (14:38 -0400)]
Merge pull request #3192 from lkrishnamoor/evpn_route_server

bgpd: Route Server support for evpn address-family

5 years agoMerge pull request #3194 from opensourcerouting/bugfix/isis-misc
Donald Sharp [Wed, 17 Oct 2018 18:38:16 +0000 (14:38 -0400)]
Merge pull request #3194 from opensourcerouting/bugfix/isis-misc

Bugfix: IS-IS fragmentation issues

5 years agobgpd: Cleanup bnch_nexthop_cache_reset to fit cleaner
Donald Sharp [Wed, 17 Oct 2018 15:31:34 +0000 (11:31 -0400)]
bgpd: Cleanup bnch_nexthop_cache_reset to fit cleaner

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Fix crash when using v4 route w/ v6 nexthop
Donald Sharp [Wed, 17 Oct 2018 15:27:30 +0000 (11:27 -0400)]
bgpd: Fix crash when using v4 route w/ v6 nexthop

Recent changes to the nht code in bgp caused us to actually
keep a true count of v6 nexthop paths when using v4 over v6.
This change introduced a race condition on shutdown on who
got to the bnc cache first( the v4 table or not ).  Effectively
we were allowing the continued existence of the path->nexthop
pointing to the freed bnc.  This was especially true when
we had route leaking.   So when we free the bnc make sure
we clean up the path->nexthop variables pointing at it too.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>