]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
5 years agozebra: Convert nexthop_active functions to use bool
Donald Sharp [Thu, 6 Dec 2018 13:09:49 +0000 (08:09 -0500)]
zebra: Convert nexthop_active functions to use bool

The set value was only being used as a bool, formalize this
in the call chain.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3457 from opensourcerouting/keyless-lists
Donald Sharp [Mon, 10 Dec 2018 14:26:00 +0000 (09:26 -0500)]
Merge pull request #3457 from opensourcerouting/keyless-lists

lib, tests: add support for keyless YANG lists

5 years agoospfd: remove call to if_lookup_all_vrf
Philippe Guibert [Thu, 15 Nov 2018 10:14:03 +0000 (11:14 +0100)]
ospfd: remove call to if_lookup_all_vrf

so as to isolate ospf contexts separately for each vrf, the interface
used is cornered to the passed vrf context.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agotools: update checkpatch to stop suggesting the use of kstrto()
Renato Westphal [Sun, 9 Dec 2018 15:57:00 +0000 (13:57 -0200)]
tools: update checkpatch to stop suggesting the use of kstrto()

kstrto() is a kernel-specific function so this suggestion doesn't
make sense for FRR.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib, tests: add support for keyless YANG lists
Renato Westphal [Sat, 8 Dec 2018 19:31:16 +0000 (17:31 -0200)]
lib, tests: add support for keyless YANG lists

YANG allows lists without keys for operational data, in which case
the list elements are uniquely identified using a positional index
(starting from one).

This commit does the following:
* Remove the need to implement the 'get_keys' and 'lookup_entry'
  callbacks for keyless lists.
* Extend nb_oper_data_iter_list() so that it special-cases keyless
  lists appropriately. Since both the CLI and the sysrepo plugin
  use nb_oper_data_iterate() to fetch operational data, both these
  northbound clients automatically gain the ability to understand
  keyless lists without additional changes.
* Extend the confd plugin to special-case keyless lists as well. This
  was a bit painful to implement given ConfD's clumsy API, but
  keyless lists should work ok now.
* Update the "test_oper_data" unit test to test keyless YANG lists in
  addition to regular lists.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #3449 from opensourcerouting/network-wide-transactions
Donald Sharp [Sun, 9 Dec 2018 14:39:37 +0000 (09:39 -0500)]
Merge pull request #3449 from opensourcerouting/network-wide-transactions

lib: fix NETCONF network-wide transactions for confd and sysrepo

5 years agoMerge pull request #3434 from opensourcerouting/init-new
Donald Sharp [Sun, 9 Dec 2018 14:38:41 +0000 (09:38 -0500)]
Merge pull request #3434 from opensourcerouting/init-new

[master] init script & vtysh pager rework

5 years agoMerge pull request #3452 from opensourcerouting/reprobuild-master
Donald Sharp [Sun, 9 Dec 2018 14:36:24 +0000 (09:36 -0500)]
Merge pull request #3452 from opensourcerouting/reprobuild-master

[master] build reproducibility

5 years agoMerge pull request #3442 from opensourcerouting/confirmed-commits
Donald Sharp [Sun, 9 Dec 2018 14:35:49 +0000 (09:35 -0500)]
Merge pull request #3442 from opensourcerouting/confirmed-commits

lib: add support for confirmed commits

5 years agoMerge pull request #3443 from opensourcerouting/show-command
Donald Sharp [Sat, 8 Dec 2018 18:44:25 +0000 (13:44 -0500)]
Merge pull request #3443 from opensourcerouting/show-command

lib: implement the "show" command

5 years agoMerge pull request #3420 from LabNConsulting/working/master/topotest/ce4-in-vrf
Donald Sharp [Sat, 8 Dec 2018 18:43:01 +0000 (13:43 -0500)]
Merge pull request #3420 from LabNConsulting/working/master/topotest/ce4-in-vrf

Topotest: put ce4 into vrf (no default), plus a couple of lib changes

5 years agotopotest: bgp_l3vpn_to_bgp_vrf put ce4 into vrf (without a default)
Lou Berger [Sat, 1 Dec 2018 02:16:48 +0000 (21:16 -0500)]
topotest: bgp_l3vpn_to_bgp_vrf put ce4 into vrf (without a default)

Signed-off-by: Lou Berger <lberger@labn.net>
5 years agotopotests/lib: help script writers understand wrong VRF failure
Lou Berger [Sat, 1 Dec 2018 17:18:14 +0000 (17:18 +0000)]
topotests/lib: help script writers understand wrong VRF failure

Signed-off-by: Lou Berger <lberger@labn.net>
5 years agotopotest: remove sleep on staticd startup
Lou Berger [Sat, 1 Dec 2018 02:23:02 +0000 (21:23 -0500)]
topotest: remove sleep on staticd startup

Signed-off-by: Lou Berger <lberger@labn.net>
5 years agoMerge pull request #3444 from donaldsharp/adj_stuff
Russ White [Sat, 8 Dec 2018 15:11:30 +0000 (10:11 -0500)]
Merge pull request #3444 from donaldsharp/adj_stuff

bgpd: Convert adj_out to a RB tree

5 years agoMerge pull request #3455 from donaldsharp/full_revert
Russ White [Sat, 8 Dec 2018 15:07:30 +0000 (10:07 -0500)]
Merge pull request #3455 from donaldsharp/full_revert

bgpd: Back out rest of e23b9ef6d2

5 years agoMerge pull request #3424 from donaldsharp/show_ip_route_json
Renato Westphal [Fri, 7 Dec 2018 22:00:31 +0000 (20:00 -0200)]
Merge pull request #3424 from donaldsharp/show_ip_route_json

zebra: `show ip route A.B.C.D json` would only show last route entry

5 years agoMerge pull request #3453 from opensourcerouting/revert-json-spellfix
Donald Sharp [Fri, 7 Dec 2018 21:00:00 +0000 (16:00 -0500)]
Merge pull request #3453 from opensourcerouting/revert-json-spellfix

bgpd: re-add spelling error in JSON output

5 years agoMerge pull request #3450 from opensourcerouting/staticd-sa-warnings
Donald Sharp [Fri, 7 Dec 2018 20:58:22 +0000 (15:58 -0500)]
Merge pull request #3450 from opensourcerouting/staticd-sa-warnings

staticd: fix static analysis warnings

5 years agobgpd: Back out rest of e23b9ef6d2
Donald Sharp [Fri, 7 Dec 2018 20:55:06 +0000 (15:55 -0500)]
bgpd: Back out rest of e23b9ef6d2

Fully revert the rest of the e23b9ef6d2 commit as that it was breaking
route leaking between vrf's.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agofabricd: Disabling OpenFabric optimization to avoid considering T0 devices only as...
Rodny Molina [Tue, 27 Nov 2018 01:21:31 +0000 (01:21 +0000)]
fabricd: Disabling OpenFabric optimization to avoid considering T0 devices only as DNRs

Signed-off-by: Rodny Molina <rmolina@linkedin.com>
5 years agoisisd: Provide statistics over number of generated purges
Christian Franke [Fri, 23 Nov 2018 23:36:37 +0000 (00:36 +0100)]
isisd: Provide statistics over number of generated purges

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: Provide statistics over number of LSP regenerations
Christian Franke [Fri, 23 Nov 2018 20:36:26 +0000 (21:36 +0100)]
isisd: Provide statistics over number of LSP regenerations

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: Provide statistics about retransmitted LSPs
Christian Franke [Fri, 23 Nov 2018 20:32:18 +0000 (21:32 +0100)]
isisd: Provide statistics about retransmitted LSPs

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: Provide statistics about sent/received PDU count
Christian Franke [Fri, 23 Nov 2018 16:50:33 +0000 (17:50 +0100)]
isisd: Provide statistics about sent/received PDU count

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agofabricd: Update neighbor list on adjacency state change
Christian Franke [Fri, 23 Nov 2018 03:46:09 +0000 (04:46 +0100)]
fabricd: Update neighbor list on adjacency state change

We should update our neighbors list immediately when an adjacency
changes state, not when we run SPF.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agofabricd: make triggered csnp delay configurable
Christian Franke [Fri, 23 Nov 2018 03:26:19 +0000 (04:26 +0100)]
fabricd: make triggered csnp delay configurable

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agofabricd: Improve LSP flooding log
Christian Franke [Fri, 23 Nov 2018 02:34:16 +0000 (03:34 +0100)]
fabricd: Improve LSP flooding log

Also track when we received an LSP as do not reflood, as well as the
time when we last considered flooding it.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agofabricd: Add `show openfabric flooding` command
Christian Franke [Fri, 23 Nov 2018 02:13:56 +0000 (03:13 +0100)]
fabricd: Add `show openfabric flooding` command

Add a command to show to what neighbors an LSP has been flooded.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: Make lspid_print non-static
Christian Franke [Fri, 23 Nov 2018 01:11:07 +0000 (02:11 +0100)]
isisd: Make lspid_print non-static

`lspid_print` is useful in other places, so make it available
in `isis_lsp.h`.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: Move code to find LSP out of show database
Christian Franke [Fri, 23 Nov 2018 00:38:24 +0000 (01:38 +0100)]
isisd: Move code to find LSP out of show database

Finding an LSP by its id is useful not only for the
`show isis database` command.

So move it out into its own function to make it reusable.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agofabricd: Populate NL from adjdb, not spf
Christian Franke [Fri, 23 Nov 2018 00:12:24 +0000 (01:12 +0100)]
fabricd: Populate NL from adjdb, not spf

We should really populate the neighbor list for the flooding
optimization from our local adjacency database and not from
a one-hop SPF.

If we use SPF, we may end up never exchanging information with
some neighbors since the bidirectional connection check for spf
fails, since LSPs did not get exchanged.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: Provide better flooding debugging
Christian Franke [Fri, 16 Nov 2018 15:31:37 +0000 (16:31 +0100)]
isisd: Provide better flooding debugging

Show from where LSP flooding is triggered.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: Remove unused t_send_lsp timer
Christian Franke [Fri, 16 Nov 2018 15:07:18 +0000 (16:07 +0100)]
isisd: Remove unused t_send_lsp timer

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: Add debug output for tx-queues
Christian Franke [Fri, 16 Nov 2018 15:05:54 +0000 (16:05 +0100)]
isisd: Add debug output for tx-queues

To allow easier debugging of LSP transmission scheduling, add a debug
mode where all tx-queue insertions/deletions are logged.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agobgpd: re-add spelling error in JSON output
David Lamparter [Fri, 7 Dec 2018 19:06:53 +0000 (20:06 +0100)]
bgpd: re-add spelling error in JSON output

I bulk-fixed "recieved" as a misspelling in 0437e10... but didn't notice
there was a JSON value among these.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agobuild: fix reproducibility re. -fdebug-prefix-map
David Lamparter [Tue, 30 Oct 2018 01:02:00 +0000 (02:02 +0100)]
build: fix reproducibility re. -fdebug-prefix-map

If CFLAGS contains something like `-fdebug-prefix-map=/build/path=.`, we
need to remove it from CONFIG_ARGS so it doesn't get baked into `show
version`.  Otherwise, build becomes non-reproducible if the build path
changes.  To avoid other things creeping in, let's just remove *FLAGS in
their entirety.  (Not really reliable information anyway.)

With this commit, FRR build should be 100% reproducible.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agotests: fix domainname dependency
David Lamparter [Tue, 30 Oct 2018 00:43:31 +0000 (01:43 +0100)]
tests: fix domainname dependency

These are causing random test failures when the host's domainname is
actually set to something (as opposed to empty/unset, which it is 99% of
times.)

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agostaticd: fix static analysis warnings
Renato Westphal [Fri, 7 Dec 2018 18:16:34 +0000 (16:16 -0200)]
staticd: fix static analysis warnings

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: fix NETCONF network-wide transactions for confd and sysrepo
Renato Westphal [Fri, 7 Dec 2018 17:27:34 +0000 (15:27 -0200)]
lib: fix NETCONF network-wide transactions for confd and sysrepo

ConfD and Sysrepo implement configuration transactions using a
two-phase commit protocol (prepare + abort/apply). For network-wide
transactions to work, ConfD and Sysrepo move to the second phase of
the commit protocol only after receiving the results of the first
phase from all devices involved in the transaction. If all devices
succeed in the 'prepare' phase, then all of them move to the 'apply'
phase and the transaction is committed. On the other hand, if any
device fails in the 'prepare' phase, all of them move to 'abort'
phase and the transaction is aborted.

The confd and sysrepo plugins were implementing the full
two-phase commit protocol upon receiving a request to validate
the configuration changes and allocate all resources required to
apply them (first phase). The notifications to abort or apply the
changes (second phase) were being ignored since everything was being
done in the first phase for simplicity. This wasn't a problem for
single-device transactions, but it is for transactions involving
multiple devices.  Rework the code a bit to do things properly and
fix this problem.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobgpd: Convert adj_out to a RB tree
Donald Sharp [Fri, 7 Dec 2018 14:01:59 +0000 (09:01 -0500)]
bgpd: Convert adj_out to a RB tree

The adj_out data structure is a linked list of adjacencies
1 per update group.  In a large scale env where we are
not using peer groups, this list lookup starts to become
rather costly.  Convert to a better data structure for this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: implement the "show" command
Renato Westphal [Fri, 7 Dec 2018 12:35:16 +0000 (10:35 -0200)]
lib: implement the "show" command

The "show" command will be available in the configuration mode and
all configuration subnodes. It's used to display the section of
the candidate configuration being edited, instead of displaying
the entire candidate configuration like when "show configuration
candidate" is used. The goal is to add more convenience when editing
huge configurations.

When the transactional CLI mode is not used, the candidate
configuration and the running configuration are identical, hence in
this case we can say that the "show" command displays the section
of the running configuration being edited.

Example:
ripd(config)# show
Configuration:
!
frr version 6.1-dev
frr defaults traditional
!
interface eth0
 ip rip split-horizon poisoned-reverse
 ip rip authentication mode md5
 ip rip authentication string supersecret
!
interface eth1
 ip rip receive version 1
 ip rip send version 1
!
router rip
 allow-ecmp
 route 10.0.1.0/24
 route 10.0.2.0/24
!
end
ripd(config)#
ripd(config)#
ripd(config)# interface eth0
ripd(config-if)# show
!
interface eth0
 ip rip split-horizon poisoned-reverse
 ip rip authentication mode md5
 ip rip authentication string supersecret
!
ripd(config-if)# exit
ripd(config)#
ripd(config)#
ripd(config)# router rip
ripd(config-router)# show
!
router rip
 allow-ecmp
 route 10.0.1.0/24
 route 10.0.2.0/24
!
ripd(config-router)#

The "show" command only works for daemons converted to the new
northbound model. vtysh support will be implemented at a later
time as it will require some level of coordination between vtysh
and the FRR daemons.

Fixes #3148.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: add support for confirmed commits
Renato Westphal [Thu, 6 Dec 2018 22:37:05 +0000 (20:37 -0200)]
lib: add support for confirmed commits

Confirmed commits allow the user to request an automatic rollback to
the previous configuration if the commit operation is not confirmed
within a number of minutes. This is particularly useful when the user
is accessing the CLI through the network (e.g. using SSH) and any
configuration change might cause an unexpected loss of connectivity
between the user and the managed device (e.g. misconfiguration of a
routing protocol). By using a confirmed commit, the user can rest
assured the connectivity will be restored after the given timeout
expires, avoiding the need to access the router physically to fix
the problem.

When "commit confirmed TIMEOUT" is used, a new "commit" command is
expected to confirm the previous commit before the given timeout
expires. If "commit confirmed TIMEOUT" is used while there's already
a confirmed-commit in progress, the confirmed-commit timeout is
reset to the new value.

In the current implementation, if other users perform commits while
there's a confirmed-commit in progress, all commits are rolled back
when the confirmed-commit timeout expires. It's recommended to use
the "configure exclusive" configuration mode to prevent unexpected
outcomes when using confirmed commits.

When an user exits from the configuration mode while there's a
confirmed-commit in progress, the commit is automatically rolled
back and the user is notified about it. In the future we might
want to prompt the user if he or she really wants to exit from the
configuration mode when there's a pending confirmed commit.

Needless to say, confirmed commit only work for configuration
commands converted to the new northbound model. vtysh support will
be implemented at a later time.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #3438 from opensourcerouting/bgp-rfapi-default-value
Donald Sharp [Fri, 7 Dec 2018 00:32:07 +0000 (19:32 -0500)]
Merge pull request #3438 from opensourcerouting/bgp-rfapi-default-value

bgpd: don't show default value in configuration

5 years agoMerge pull request #3437 from opensourcerouting/bugfix/topotests-use-copy
Donald Sharp [Fri, 7 Dec 2018 00:31:26 +0000 (19:31 -0500)]
Merge pull request #3437 from opensourcerouting/bugfix/topotests-use-copy

tests/topotests: Use copied tests in Docker

5 years agoMerge pull request #3436 from opensourcerouting/bugfix/topotest-sbin-dir
Donald Sharp [Fri, 7 Dec 2018 00:30:55 +0000 (19:30 -0500)]
Merge pull request #3436 from opensourcerouting/bugfix/topotest-sbin-dir

tests/topotests: Also search sbin for modprobe

5 years agoMerge pull request #3421 from pguibert6WIND/bgp_lp_finish_called_too_early
Donald Sharp [Fri, 7 Dec 2018 00:30:18 +0000 (19:30 -0500)]
Merge pull request #3421 from pguibert6WIND/bgp_lp_finish_called_too_early

bgpd: delay destruction of label pool

5 years agoMerge pull request #3425 from chiragshah6/evpn_dev1
Russ White [Thu, 6 Dec 2018 23:43:03 +0000 (18:43 -0500)]
Merge pull request #3425 from chiragshah6/evpn_dev1

bgpd: set attribute change flag to evpn imported route

5 years agovtysh: rework/straighten pager handling
David Lamparter [Thu, 8 Nov 2018 05:50:13 +0000 (06:50 +0100)]
vtysh: rework/straighten pager handling

- no longer try to special-case a custom terminal length; the OS has
  procedures for that (SIGWINCH & TIOCGWINSZ)
- only use a pager if requested by CLI command or VTYSH_PAGER.  The
  behaviour with VTYSH_PAGER set should be compatible to previous
  versions.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years ago*: get rid of most daemons.conf references
David Lamparter [Thu, 6 Dec 2018 13:34:13 +0000 (14:34 +0100)]
*: get rid of most daemons.conf references

There's a few left over to get compatibility and not break user
installs, but most is gone.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agodebian/tools: new init script
David Lamparter [Fri, 30 Nov 2018 20:40:39 +0000 (21:40 +0100)]
debian/tools: new init script

This separates the init script used for the system (and called in the
systemd unit file) from the script that watchfrr uses to control
daemons.  Mixing these two caused the entire thing to become a rather
huge spaghetti mess.

Note that there is a behaviour change in that the new script always
starts zebra regardless of zebra_enable.

Side changes:
- Ubuntu 12.04 removed from backports since it doesn't work anyway
- zebra is always started regardless of zebra_enable.  To disable FRR,
  the entire init script should be disabled through policy.
- no-watchfrr operation is no longer supported by the scripts in the
  Debian packages.  (This is intentional.)

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agowatchfrr: add status command
David Lamparter [Fri, 30 Nov 2018 16:56:42 +0000 (17:56 +0100)]
watchfrr: add status command

Just to see WTF is going on inside watchfrr...

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agowatchfrr: immediately try connecting after start
David Lamparter [Fri, 30 Nov 2018 16:56:04 +0000 (17:56 +0100)]
watchfrr: immediately try connecting after start

When we make a call to (re)start some daemon(s), we can immediately try
connecting to its VTY socket after the script completes.  If the daemon
started correctly, this will always succeed since the start script only
returns after daemon startup is complete.

Among other things, this reduces the delay to "startup complete"
notification at initial watchfrr start.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agobgpd: don't show default value in configuration
Rafael Zalamena [Thu, 6 Dec 2018 19:26:10 +0000 (17:26 -0200)]
bgpd: don't show default value in configuration

Don't show the configuration line `rfp full-table-download off` by
default as it is not the default value, instead only show
`rfp full-table-download on` (the non-default value) when it is
configured.

This standardizes this knob to the FRR default behavior.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agotests/topotests: Also search sbin for modprobe
Christian Franke [Thu, 6 Dec 2018 17:31:34 +0000 (18:31 +0100)]
tests/topotests: Also search sbin for modprobe

We call `modprobe -n` to check if mpls modules are available to be
loaded. We do this as normal user, to only ask for root permissions
if we are actually loading the module.

This breaks if `modprobe` is in `/sbin` and normal users don't have
sbin in path.

So add `/sbin` to the search path to work around this.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agowatchfrr: don't wait around pointlessly at startup
David Lamparter [Fri, 30 Nov 2018 16:55:42 +0000 (17:55 +0100)]
watchfrr: don't wait around pointlessly at startup

We were waiting for timers to expire even when we already know the
status of all daemons.  This delays startup for no good reason.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agotools/frr: get rid of the bash array and "bB"
David Lamparter [Fri, 26 Oct 2018 19:02:22 +0000 (21:02 +0200)]
tools/frr: get rid of the bash array and "bB"

With a little shell-fu, this can actually be escaped properly.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agotests/topotests: Use copied tests in Docker
Christian Franke [Thu, 6 Dec 2018 14:26:57 +0000 (15:26 +0100)]
tests/topotests: Use copied tests in Docker

If we mount the tests into the container from the host, we also
mount any `*.pyc` files with them, which will lead to issues
as the mount is done read-only to avoid any changes to the host.

Since the tests are now integrated and we already create a writeable
copy of the FRR tree, just use the tests from the FRR tree to avoid
this issue.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoMerge pull request #3419 from opensourcerouting/freebsd-route-warning-fix
Donald Sharp [Thu, 6 Dec 2018 12:53:30 +0000 (07:53 -0500)]
Merge pull request #3419 from opensourcerouting/freebsd-route-warning-fix

zebra: fix some boot up warnings on FreeBSD

5 years agobgpd: set attribute change flag to evpn imported
Chirag Shah [Wed, 5 Dec 2018 01:08:47 +0000 (17:08 -0800)]
bgpd: set attribute change flag to evpn imported

EVPN route's attribute changes,
mark attribute change flag to imported unicast route.

A scenario where AS_PATH attribute have changed for an EVPN type-5
route, set attribute change
to imported route.

Ticket:CM-23008
Reviewed By:
Testing Done:
Validated via marking EVPN route with AS_PATH prepand.
At the receiving VTEP, ensure attribute change flag is set to
imported unicast route and bgp update sent to VTEPs subsequent
bgp peers with AS_PATH prepend update.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agozebra: `show ip route A.B.C.D json` would only show last route entry
Donald Sharp [Wed, 5 Dec 2018 20:12:50 +0000 (15:12 -0500)]
zebra: `show ip route A.B.C.D json` would only show last route entry

The `show ip route A.B.C.D json` command was only displaying
the last route entry looked at and we would drop the data
associated with other route entries.  This fixes the issue:

robot# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route

K>* 0.0.0.0/0 [0/100] via 192.168.201.1, enp3s0, 00:13:31
C>* 4.50.50.50/32 is directly connected, lo, 00:13:31
D   10.0.0.1/32 [150/0] via 192.168.201.1, enp3s0, 00:09:46
S>* 10.0.0.1/32 [1/0] via 192.168.201.1, enp3s0, 00:10:04
C>* 192.168.201.0/24 is directly connected, enp3s0, 00:13:31
robot# show ip route 10.0.0.1 json
{
  "10.0.0.1\/32":[
    {
      "prefix":"10.0.0.1\/32",
      "protocol":"sharp",
      "distance":150,
      "metric":0,
      "internalStatus":0,
      "internalFlags":1,
      "uptime":"00:09:50",
      "nexthops":[
        {
          "flags":1,
          "ip":"192.168.201.1",
          "afi":"ipv4",
          "interfaceIndex":2,
          "interfaceName":"enp3s0",
          "active":true
        }
      ]
    },
    {
      "prefix":"10.0.0.1\/32",
      "protocol":"static",
      "selected":true,
      "distance":1,
      "metric":0,
      "internalStatus":0,
      "internalFlags":2064,
      "uptime":"00:10:08",
      "nexthops":[
        {
          "flags":3,
          "fib":true,
          "ip":"192.168.201.1",
          "afi":"ipv4",
          "interfaceIndex":2,
          "interfaceName":"enp3s0",
          "active":true
        }
      ]
    }
  ]
}
robot#

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgp: new topotest BGP templates to display default local preference and local-AS...
Ameya Dharkar [Wed, 5 Dec 2018 19:26:32 +0000 (11:26 -0800)]
bgp: new topotest BGP templates to display default local preference and local-AS in BGP commands

This commit adds a template for "show bgp ipv4/ipv6" display to include default local preference and local-AS O/P.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
5 years agobgpd: Display default local preference and local AS for BGP show commands
Ameya Dharkar [Fri, 2 Nov 2018 21:40:44 +0000 (14:40 -0700)]
bgpd: Display default local preference and local AS for BGP show commands

1. "show bgp ipv4/ipv6 [json]"
2. "show bgp ipv4/ipv6 neighbor <peer> routes [json]"
3. "show bgp ipv4/ipv6 neighbors <peer> advertised-routes [json]"

In the above show commands, when a BGP path is displayed, we do not display the
local preference if it is EBGP route. Route calculation assumes the default
local preference. But, we can change the default local preference using
configuration in FRR. In this case, user should know the default local
preference value that is being used in the route calculation. Thus, adding a
new field 'default local preferece' in the show commands where a BGP path is
displayed.

When a BGP path is displayed in the above show commands, as-path does not
include the local AS. So, user has to execute another show command to display
the local-AS. To avoid this, adding a new field local-AS to above show commands.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
5 years agozebra: don't log errors on unsupported medias
Rafael Zalamena [Wed, 5 Dec 2018 19:22:56 +0000 (17:22 -0200)]
zebra: don't log errors on unsupported medias

When using `SIOCGIFMEDIA` check for `EINVAL`, otherwise we might print
an error message on an unsupported interface.

FreeBSD source code reference:
https://github.com/freebsd/freebsd/blob/master/sys/net/if_media.c#L300

And:
https://github.com/freebsd/freebsd/blob/8cb4b0c0181bd45318ee8977f77aea90c53bb224/usr.sbin/rtsold/if.c#L211

  /*
   * EINVAL simply means that the interface does not support
   * the SIOCGIFMEDIA ioctl. We regard it alive.
   */

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agobgpd: delay destruction of label pool
Philippe Guibert [Wed, 5 Dec 2018 16:54:57 +0000 (17:54 +0100)]
bgpd: delay destruction of label pool

label pool finalisation must be delayed after route deletion on bgp.
otherwise a crash will happen, while labels will be released.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agoMerge pull request #3418 from pguibert6WIND/bgp_rfapi_path_info_extra_free
Lou Berger [Wed, 5 Dec 2018 15:24:33 +0000 (10:24 -0500)]
Merge pull request #3418 from pguibert6WIND/bgp_rfapi_path_info_extra_free

bgpd: reuse bgp_path_info_extra_free() routing in rfapi

5 years agozebra: refactor route socket message handling
Rafael Zalamena [Wed, 5 Dec 2018 13:51:25 +0000 (11:51 -0200)]
zebra: refactor route socket message handling

Some address types were not being skipped triggering a warning log
message, so lets refactor this code to properly handle known and unknown
types.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agobgpd: reuse bgp_path_info_extra_free() routing in rfapi
Philippe Guibert [Wed, 5 Dec 2018 14:09:35 +0000 (15:09 +0100)]
bgpd: reuse bgp_path_info_extra_free() routing in rfapi

rfapi code should use bgp_path_info_extra_free() routine.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agozebra: always define ROUNDUP and ROUND_TYPE
Rafael Zalamena [Wed, 5 Dec 2018 13:50:25 +0000 (11:50 -0200)]
zebra: always define ROUNDUP and ROUND_TYPE

Move the declaration of ROUNDUP and ROUND_TYPE to outside of
`ifdef SA_SIZE`. We'll use these definitions in the next commit.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoMerge pull request #3372 from nitinsoniism/show_evpn_mac_vni_all_detail
Sri Mohana Singamsetty [Tue, 4 Dec 2018 18:19:18 +0000 (10:19 -0800)]
Merge pull request #3372 from nitinsoniism/show_evpn_mac_vni_all_detail

zebra: Add "show evpn mac vni all detail" command

5 years agoMerge pull request #3174 from opensourcerouting/feature/isis-triggered-hello
Olivier Dugeon [Tue, 4 Dec 2018 17:33:36 +0000 (18:33 +0100)]
Merge pull request #3174 from opensourcerouting/feature/isis-triggered-hello

Feature: IS-IS triggered hello

5 years agoMerge pull request #3410 from opensourcerouting/bugfix/topotest-docker-build-context
Quentin Young [Tue, 4 Dec 2018 16:36:11 +0000 (11:36 -0500)]
Merge pull request #3410 from opensourcerouting/bugfix/topotest-docker-build-context

Revert "tests/topotests: Change docker build context"

5 years agoMerge pull request #3340 from nitinsoniism/show_evpn_vni_detail
David Lamparter [Tue, 4 Dec 2018 16:29:50 +0000 (17:29 +0100)]
Merge pull request #3340 from nitinsoniism/show_evpn_vni_detail

zebra: Add "show evpn vni detail" command

5 years agotopotests: Update json_cmp_result to return readable result
Christian Franke [Tue, 4 Dec 2018 15:11:41 +0000 (16:11 +0100)]
topotests: Update json_cmp_result to return readable result

Before this update, json_cmp_results which were formatted as strings
would not show the error mesage but just an object reference.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agotopotests/isis-topo1: Set useful IS-IS debugs
Christian Franke [Tue, 4 Dec 2018 15:11:08 +0000 (16:11 +0100)]
topotests/isis-topo1: Set useful IS-IS debugs

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: trigger hellos on adjacency state change
Christian Franke [Wed, 10 Oct 2018 14:00:16 +0000 (16:00 +0200)]
isisd: trigger hellos on adjacency state change

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: add send_hello_sched function
Christian Franke [Wed, 10 Oct 2018 13:43:01 +0000 (15:43 +0200)]
isisd: add send_hello_sched function

Add a function send_hello_sched so that the logic for scheduling a
hello is not replicated inconsistently into different locations.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoMerge pull request #3413 from chiragshah6/evpn_dev1
David Lamparter [Tue, 4 Dec 2018 14:43:15 +0000 (15:43 +0100)]
Merge pull request #3413 from chiragshah6/evpn_dev1

zebra: dup addr detect clear cmd non-zero return

5 years agoMerge pull request #3357 from ton31337/fix/optional_args_for_extcommunity-lists
David Lamparter [Tue, 4 Dec 2018 14:34:59 +0000 (15:34 +0100)]
Merge pull request #3357 from ton31337/fix/optional_args_for_extcommunity-lists

bgpd: Remove extcommunity-list by name without typing full rule

5 years agolib: add thread_timer_remain_msec function
Christian Franke [Wed, 10 Oct 2018 13:06:17 +0000 (15:06 +0200)]
lib: add thread_timer_remain_msec function

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: Move dr election timer to the end of isis_dr_commence
Christian Franke [Tue, 6 Nov 2018 19:37:24 +0000 (20:37 +0100)]
isisd: Move dr election timer to the end of isis_dr_commence

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: reduce code duplication for levels
Christian Franke [Wed, 10 Oct 2018 09:16:39 +0000 (11:16 +0200)]
isisd: reduce code duplication for levels

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agoisisd: Add level&circuit thread argument to circuit
Christian Franke [Mon, 5 Nov 2018 19:07:11 +0000 (20:07 +0100)]
isisd: Add level&circuit thread argument to circuit

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agozebra: dup addr detect clear cmd non-zero return
Chirag Shah [Mon, 3 Dec 2018 03:08:22 +0000 (19:08 -0800)]
zebra: dup addr detect clear cmd non-zero return

Clear dup address vni needs to return non-zero value
in case of command is not successful.

Ticket:CM-23122
Testing Done:
run clear command and check upon failure return code is non-zero.

root@TORS1:~# vtysh -c "clear evpn dup-addr vni 1000 ip 45.0.1.26"
% Requested IP's associated MAC 00:01:02:03:04:05 is still in duplicate
% state
root@TORS1:~# echo $?
1

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agoMerge pull request #3370 from pguibert6WIND/default_vrf_initialization
Renato Westphal [Mon, 3 Dec 2018 23:30:00 +0000 (21:30 -0200)]
Merge pull request #3370 from pguibert6WIND/default_vrf_initialization

Default vrf initialization

5 years agoMerge pull request #3404 from donaldsharp/nexthop_cleanup
Renato Westphal [Mon, 3 Dec 2018 20:20:27 +0000 (18:20 -0200)]
Merge pull request #3404 from donaldsharp/nexthop_cleanup

lib: Cleanup nexthop2str code to be consistent

5 years agoMerge pull request #3402 from pacovn/Coverity_1475198_1475199
Renato Westphal [Mon, 3 Dec 2018 20:17:59 +0000 (18:17 -0200)]
Merge pull request #3402 from pacovn/Coverity_1475198_1475199

pbrd sharpd: return check fixes (Coverity 1475198 1475199)

5 years agopbrd: return check (Coverity 1475199)
F. Aragon [Fri, 30 Nov 2018 17:09:05 +0000 (18:09 +0100)]
pbrd: return check (Coverity 1475199)

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoripd: fix minor issues from the northbound conversion
Renato Westphal [Thu, 29 Nov 2018 19:06:22 +0000 (17:06 -0200)]
ripd: fix minor issues from the northbound conversion

* Always apply the mask of IPv4 prefixes (user data) in the
  northbound callbacks, we shouldn't assume the northbound plugins
  will do that for us.

* Fix a bug in the "distance" command introduced by commit a6233bfcb3b.

* Remove unnecessary check in the
  ripd_instance_redistribute_route_map_delete() function and
  reset the route-map's map pointer for safety as well.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripd: remove leftovers from the old sighup handler
Renato Westphal [Thu, 29 Nov 2018 19:05:40 +0000 (17:05 -0200)]
ripd: remove leftovers from the old sighup handler

Commit bc1bdde2f6 removed the rip_reset() function but didn't remove
other functions that were only called by rip_reset(). Remove them
now (dead code).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobuild: update vtysh scan list for ripd and ripngd
Renato Westphal [Thu, 29 Nov 2018 18:46:00 +0000 (16:46 -0200)]
build: update vtysh scan list for ripd and ripngd

A few files don't have any CLI commands anymore as they were moved
to either rip_cli.c or ripng_cli.c. Update the ripd/ripngd vtysh_scan
variable to account for this.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripngd: implement northbound callbacks to fetch route information
Renato Westphal [Thu, 29 Nov 2018 18:41:43 +0000 (16:41 -0200)]
ripngd: implement northbound callbacks to fetch route information

The "routes" YANG container was copied and adapted from the ietf-rip
module.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripngd: implement northbound callbacks to fetch neighbor information
Renato Westphal [Thu, 29 Nov 2018 18:41:32 +0000 (16:41 -0200)]
ripngd: implement northbound callbacks to fetch neighbor information

The "neighbors" YANG container was copied and adapted from the
ietf-rip module.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripngd: implement the 'clear-ripng-route' YANG RPC
Renato Westphal [Thu, 29 Nov 2018 15:24:26 +0000 (13:24 -0200)]
ripngd: implement the 'clear-ripng-route' YANG RPC

The "clear ipv6 ripng" command was turned into a YANG RPC so that
other northbound plugins can execute it as well. This RPC closely
matches the 'clear-rip-route' RPC from the ietf-rip module.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripngd: fix SIGHUP handling
Renato Westphal [Thu, 29 Nov 2018 15:11:05 +0000 (13:11 -0200)]
ripngd: fix SIGHUP handling

Now that all ripngd commands were converted to the new northbound
model, the ripngd SIGHUP handler is capable of doing a full
configuration reload just by calling the vty_read_config()
function. Nothing else should be done in the SIGHUP handler.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripngd: retrofit the 'split-horizon' command to the new northbound model
Renato Westphal [Thu, 29 Nov 2018 13:44:55 +0000 (11:44 -0200)]
ripngd: retrofit the 'split-horizon' command to the new northbound model

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripngd: retrofit the 'timer basic' command to the new northbound model
Renato Westphal [Thu, 29 Nov 2018 13:21:13 +0000 (11:21 -0200)]
ripngd: retrofit the 'timer basic' command to the new northbound model

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

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

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoripngd: retrofit the 'aggregate-address' command to the new northbound model
Renato Westphal [Thu, 29 Nov 2018 13:02:35 +0000 (11:02 -0200)]
ripngd: retrofit the 'aggregate-address' command to the new northbound model

Trivial conversion. Remove the ripng->aggregate 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 agoripngd: retrofit the 'route' command to the new northbound model
Renato Westphal [Thu, 29 Nov 2018 12:56:09 +0000 (10:56 -0200)]
ripngd: retrofit the 'route' command to the new northbound model

Trivial conversion. Remove the ripng->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 agoripngd: retrofit the 'redistribute' commands to the new northbound model
Renato Westphal [Thu, 29 Nov 2018 05:06:38 +0000 (03:06 -0200)]
ripngd: 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 ripngd. 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.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>