]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
5 years agolib: fix fetching enum values for derived types
Emanuele Di Pascale [Wed, 17 Oct 2018 13:10:47 +0000 (15:10 +0200)]
lib: fix fetching enum values for derived types

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
5 years agodoc: add build instructions for libyang
Renato Westphal [Tue, 16 Oct 2018 01:00:12 +0000 (22:00 -0300)]
doc: add build instructions for libyang

These instructions are intended to be temporary until we have libyang
packages available for all supported platforms.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agodebianpkg: Add yang files to packages
Martin Winter [Wed, 10 Oct 2018 23:07:44 +0000 (16:07 -0700)]
debianpkg: Add yang files to packages

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
5 years agoredhat: Added libyang dependencies to package
Martin Winter [Thu, 4 Oct 2018 02:00:00 +0000 (19:00 -0700)]
redhat: Added libyang dependencies to package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
5 years agoyang: add a module translator for ietf-rip.yang
Renato Westphal [Sun, 5 Aug 2018 15:28:33 +0000 (12:28 -0300)]
yang: add a module translator for ietf-rip.yang

As it can be seen below, this translator covers only ~13% of the
ietf-rip YANG module. Work must be done to increase that number.

ripd> en
ripd# conf t
ripd(config)# yang module-translator load /tmp/frr-ietf-translator.json
% Module translator "ietf" loaded successfully.

ripd(config)# do show yang module-translator
 Family  Module           Deviations                      Coverage (%)
 -----------------------------------------------------------------------
 ietf    ietf-interfaces  frr-deviations-ietf-interfaces  3.92
 ietf    ietf-routing     frr-deviations-ietf-routing     1.56
 ietf    ietf-rip         frr-deviations-ietf-rip         13.60

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: implement two YANG notifications
Renato Westphal [Wed, 9 May 2018 04:35:04 +0000 (01:35 -0300)]
ripd: implement two YANG notifications

Implement the 'authentication-failure' and 'authentication-type-failure'
notifications defined in the frr-ripd YANG module.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: implement the 'clear-rip-route' YANG RPC
Renato Westphal [Wed, 9 May 2018 04:35:04 +0000 (01:35 -0300)]
ripd: implement the 'clear-rip-route' YANG RPC

This command deletes all received routes from the RIP routing table.
It should be used with caution as it can create black holes in the
network until RIP reconverges. Very useful to make automated testing
(e.g. ANVL) more predictable, since the internal state of ripd can be
cleared after each test.

Implement the command using a YANG RPC so that it can be executed by
other northbound clients in addition to the CLI.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: implement northbound callbacks to fetch route information
Renato Westphal [Wed, 9 May 2018 04:35:03 +0000 (01:35 -0300)]
ripd: implement northbound callbacks to fetch route information

Support for fetching operational data is experimental at this point.
Locks must be introduced to ensure the rip->table routing table won't
be modified while we're iterating asynchronously over it (or iterating
from a separate pthread).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: implement northbound callbacks to fetch neighbor information
Renato Westphal [Wed, 9 May 2018 04:35:03 +0000 (01:35 -0300)]
ripd: implement northbound callbacks to fetch neighbor information

Support for fetching operational data is experimental at this point.
Locks must be introduced to ensure the peer_list global variable won't
be modified while we're iterating asynchronously over it (or iterating
from a separate pthread).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: reduce excessive indentation in a few places
Renato Westphal [Mon, 2 Jul 2018 18:51:15 +0000 (15:51 -0300)]
ripd: reduce excessive indentation in a few places

Make the code a bit easier to read. No binary changes.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: remove vty configuration lock
Renato Westphal [Mon, 28 May 2018 13:18:37 +0000 (10:18 -0300)]
ripd: remove vty configuration lock

The vty configuration lock is used to prevent inconsistencies when
multiple users are editing the configuration at the same time. The
pointer stored in vty->index might become invalid if the associated
configuration object is removed by another user in another CLI session.

Commands converted to the new northbound model don't use vty->index,
but vty->xpath_index and the vty->xpath array. The nb_cli_cfg_change()
function uses the VTY_CHECK_XPATH macro to check if the configuration
object being edited still exists and returns an error if it doesn't.

Now that all ripd commands were converted to the new northbound model,
remove the ripd vty lock because it's not necessary anymore.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: fix SIGHUP handling
Renato Westphal [Mon, 2 Jul 2018 01:24:29 +0000 (22:24 -0300)]
ripd: fix SIGHUP handling

We can now leverage the new northbound API to perform a full configuration
reload in ripd without the need for external help (i.e. frr-reload.py).

When vty_read_config() is called with the 'config' parameter set to
NULL, it performs a new configuration transaction where the running
configuration is *replaced* by the provided configuration file. With that
said, we don't need to do anything other than calling this function in
the SIGHUP handler of all FRR daemons. If a daemon hasn't been converted
to the new northbound model, vty_read_config() will simply *merge*
the configuration file into the running configuration.

The calls to rip_clean() and rip_reset() in the SIGUP handler were
changing configuration variables directly, bypassing the northbound
layer. Configuration variables should be changed only by the northbound
callbacks, and failure to respect that inevitably leads to inconsistencies
and crashes. Fix this.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: fix memory leaks when interfaces are deleted
Renato Westphal [Mon, 9 Jul 2018 13:46:40 +0000 (10:46 -0300)]
ripd: fix memory leaks when interfaces are deleted

This memleak has been present for at least 16 years. Fix it.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit all RIP interface commands to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:35:03 +0000 (01:35 -0300)]
ripd: retrofit all RIP interface commands to the new northbound model

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: no need to use qobj anymore to keep track of "router rip"
Renato Westphal [Wed, 9 May 2018 04:35:02 +0000 (01:35 -0300)]
ripd: no need to use qobj anymore to keep track of "router rip"

Now that "router rip" and all underlying commands were converted to the
new northbound model, there's no need to use the qobj infrastructure to
keep track of the 'rip' global variable anymore.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit the 'version' command to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:35:01 +0000 (01:35 -0300)]
ripd: retrofit the 'version' command to the new northbound model

Trivial conversion.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit the 'timer basic' command to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:35:01 +0000 (01:35 -0300)]
ripd: retrofit the 'timer basic' command to the new northbound model

Trivial conversion. Use the northbound 'apply_finish()' callback so
we'll call rip_event() only once even if we change the three RIP timers
at the same time.

Convert the timers to uint32_t to match their representation in the
YANG model.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit the 'route' command to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:35:01 +0000 (01:35 -0300)]
ripd: retrofit the 'route' command to the new northbound model

Trivial conversion. Remove the rip->route routing table and associated
code because this variable was used only to show the running
configuration.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit the 'redistribute' commands to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:35:01 +0000 (01:35 -0300)]
ripd: retrofit the 'redistribute' commands to the new northbound model

Trivial conversion. As usual, combine multiple DEFUNs into a single
DEFPY for simplicity.

As a bonus of the northbound conversion, this commit fixes the
redistribution of certain protocols into ripd. The 'redist_type' array
used by the "redistribute" commands was terribly outdated, which was
preventing the CLI to parse correctly certain protocols like isis
and babel.

Remove the route_map hooks installed by rip_route_map_init() since they
were redundant (rip_init() already takes care of that).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit the 'passive-interface' command to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:35:00 +0000 (01:35 -0300)]
ripd: retrofit the 'passive-interface' command to the new northbound model

In ripd, the "passive-interface default" command has the following
behavior:
* All interfaces are converted to the passive mode;
* The "passive-interface IFNAME" command becomes a no-operation and
  "passive-interface IFNAME" statements are removed from the running
  configuration.
* The "no passive-interface IFNAME" can be used to remove interfaces
  from the passive mode.

This command was modeled using the following YANG data nodes in the
frr-ripd module:

  leaf passive-default {
    type boolean;
    default "false";
    description
      "Control whether interfaces are in the passive mode
       by default or not.";
  }
  leaf-list passive-interface {
    when "../passive-default = 'false'";
    type string {
      length "1..16";
    }
    description
      "A list of interfaces where the sending of RIP packets
       is disabled.";
  }
  leaf-list non-passive-interface {
    when "../passive-default = 'true'";
    type string {
      length "1..16";
    }
    description
      "A list of interfaces where the sending of RIP packets
       is enabled.";
  }

The 'when' statements guarantee that the list of passive interfaces
is cleared when the "passive-interface default" command is entered
(likewise, they guarantee that the list of non-passive interfaces is
cleared when the "passive-interface default" command is removed). This
matches exactly the behavior we want to model.

Finally, move the 'passive_default' global variable into the
'rip' structure where it belongs. This fixed the bug where the
"passive-interface default" command was being retained after a "no router
rip" + "router rip".

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit the 'offset-list' command to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:35:00 +0000 (01:35 -0300)]
ripd: retrofit the 'offset-list' command to the new northbound model

Remove the rip_offset_list_set() and rip_offset_list_unset() functions
since they set/unset multiple configuration options at the same time. The
northbound callbacks need to set/unset configuration options individually.

The frr-ripd YANG module models the "offset-list" command using a list
keyed by the 'interface' and 'direction' leafs. One important detail is
that the IFNAME parameter is optional, and when it's not present it means
we want to match all interfaces. This is modeled using an interface name
of '*' since key lists are mandatory by definition in YANG.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit the 'network' command to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:35:00 +0000 (01:35 -0300)]
ripd: retrofit the 'network' command to the new northbound model

The frr-ripd YANG module models the ripd "network" command using two
separate leaf-lists for simplicity: one leaf-list for interfaces and
another leaf-list for actual networks. In the 'cli_show' callbacks,
display the "network" command for entries of both leaf-lists.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit the 'neighbor' command to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:34:59 +0000 (01:34 -0300)]
ripd: retrofit the 'neighbor' command to the new northbound model

Make rip_neighbor_add() and rip_neighbor_delete() return northbound
error codes since their return values are used as the return value of
some northbound callbacks.

These functions shouldn't fail in normal conditions because the northbound
layer guarantees it will never call the 'create' or 'delete' callback
more than once for the same object. Hence any failure in those functions
would indicate an internal inconsistency that needs to be investigated
(by returning NB_ERR the northbound will log a detailed error message
indicating the xpath of the object, the event and the callback where
the error happened).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit the 'distance source' commands to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:34:59 +0000 (01:34 -0300)]
ripd: retrofit the 'distance source' commands to the new northbound model

The "distance (1-255) A.B.C.D/M [WORD]" command was modeled using a
YANG list, which makes it a little bit more complicated to convert to
the new northbound model.

The rip_distance_set() and rip_distance_unset() functions were removed
since they set/unset multiple configuration options at the same time. The
northbound callbacks need to set/unset configuration options individually.

When a distance list is created, use yang_dnode_set_entry() to store
a pointer in the configuration node, and retrieve this pointer in the
other callbacks using yang_dnode_get_entry().

The 'rip_distance' structure was moved to ripd.h so that it can be used
in the rip_northbound.c file.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit the 'distance' command to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:34:59 +0000 (01:34 -0300)]
ripd: retrofit the 'distance' command to the new northbound model

Trivial conversion.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit the 'default-metric' command to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:34:59 +0000 (01:34 -0300)]
ripd: retrofit the 'default-metric' command to the new northbound model

Trivial conversion.

rip->default_metric was converted to an uint8_t to match the way it's
defined in the YANG module.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit the 'default-information' command to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:34:58 +0000 (01:34 -0300)]
ripd: retrofit the 'default-information' command to the new northbound model

Trivial conversion.

'rip->default_information_route_map' was removed since it wasn't being
used anywhere.

'rip->default_information' was removed too because it was being used only
to display the running configuration and thus is not necessary anymore.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit the 'allow-ecmp' command to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:34:58 +0000 (01:34 -0300)]
ripd: retrofit the 'allow-ecmp' command to the new northbound model

Trivial conversion. The rip->ecmp variable was converted to a boolean to
match the way it's defined in the YANG module.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: retrofit the 'router rip' command to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:34:58 +0000 (01:34 -0300)]
ripd: retrofit the 'router rip' command to the new northbound model

* Implement the northbound callbacks associated to the
  '/frr-ripd:ripd/instance' YANG path (the code is mostly a copy and paste
  from the original "router rip" DEFUNs);
* Move rip_create_socket() out of rip_create() since creating a socket
  is an error-prone operation and thus needs to be performed separately
  during the NB_EV_PREPARE phase;
* On rip_create(), fetch the defaults from the frr-ripd YANG model;
* Convert the "[no] router rip" CLI commands to be dumb wrappers around
  the northbound callbacks;
* On config_write_rip(), write logic to call all 'cli_show' northbound
  callbacks defined under the '/frr-ripd:ripd/instance' YANG path.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoyang, ripd: add 'frr-ripd.yang' and associated stub callbacks
Renato Westphal [Wed, 9 May 2018 04:34:57 +0000 (01:34 -0300)]
yang, ripd: add 'frr-ripd.yang' and associated stub callbacks

Introduce frr-ripd.yang, which defines a model for managing the FRR
ripd daemon. Also add frr-route-types.yang which defines typedefs for
FRR route types.

Update the 'frr_yang_module_info' array of ripd with the new 'frr-ripd'
module.

Add two new files (rip_cli.[ch]) which should contain all ripd commands
converted to the new northbound model. Centralizing all commands in a
single place will facilitate the process of moving the CLI to a separate
program in the future.

Add automatically generated stub callbacks in rip_northbound.c. These
callbacks will be implemented gradually in the following commits.

Add example JSON/XML ripd configurations in yang/examples/.

Add the confd.frr-ripd.yang YANG module with annotations specific to
the ConfD daemon.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: retrofit interface commands to the new northbound model
Renato Westphal [Wed, 9 May 2018 04:34:57 +0000 (01:34 -0300)]
lib: retrofit interface commands to the new northbound model

The frr-interface YANG module models interfaces using a YANG list keyed
by the interface name and the interface VRF. Interfaces can't be keyed
only by their name since interface names might not be globally unique
when the netns VRF backend is in use. When using the VRF-Lite backend,
however, interface names *must* be globally unique. In this case, we need
to validate the uniqueness of interface names inside the appropriate
northbound callback since this constraint can't be expressed in the
YANG language. We must also ensure that only inactive interfaces can be
removed, among other things we need to validate in the northbound layer.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
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>