]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years agoMerge pull request #5278 from slankdev/slankdev-bgpd-fix-prefix-sid-fetch-error
Donald Sharp [Thu, 7 Nov 2019 15:36:47 +0000 (10:36 -0500)]
Merge pull request #5278 from slankdev/slankdev-bgpd-fix-prefix-sid-fetch-error

bgpd: skip unsupported PREFIX_SID sub-type

4 years agoMerge pull request #5283 from donaldsharp/bgp_vrf_stuff
Donatas Abraitis [Thu, 7 Nov 2019 15:21:48 +0000 (17:21 +0200)]
Merge pull request #5283 from donaldsharp/bgp_vrf_stuff

bgpd: Have Nexthop Tracking specify vrf we are in for debugs

4 years agobgpd: use bgp->name_pretty in debugs and add vrf to some output
Donald Sharp [Tue, 5 Nov 2019 12:35:36 +0000 (07:35 -0500)]
bgpd: use bgp->name_pretty in debugs and add vrf to some output

Recently had a case where I was attempting to debug a nexthop tracking
issue across multiple bgp vrf's and since the setup vrf's in it with
overlapping address ranges, it became real fun real fast to track
vrf data associated.  Add a bit of code to allow us to figure out
what vrf we are in when we print out debug messages.

Look through the rest of the code and find debugs where we are
not using bgp->name_pretty and switch it over.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5269 from sworleys/Zebra-VRF-Lookup-Not-Get
Russ White [Wed, 6 Nov 2019 19:10:59 +0000 (14:10 -0500)]
Merge pull request #5269 from sworleys/Zebra-VRF-Lookup-Not-Get

zebra: separate zebra_vrf_lookup_table_with_id()

4 years agoMerge pull request #5281 from bisdhdh/bgpv4-over-v6-1
Russ White [Wed, 6 Nov 2019 19:03:52 +0000 (14:03 -0500)]
Merge pull request #5281 from bisdhdh/bgpv4-over-v6-1

BGPD: Prevent IPv6-LL being fwd to IBGP peers not on same link.

4 years agoMerge pull request #5196 from kuldeepkash/testcases
Martin Winter [Wed, 6 Nov 2019 12:18:04 +0000 (07:18 -0500)]
Merge pull request #5196 from kuldeepkash/testcases

tests: Enhance bgp-path-attributes-topo1 test suite

4 years agoMerge pull request #5280 from qlyoung/doc-clean-topotest-json
Donatas Abraitis [Tue, 5 Nov 2019 18:15:37 +0000 (20:15 +0200)]
Merge pull request #5280 from qlyoung/doc-clean-topotest-json

doc: clean up && index topotest json docs

4 years agoMerge pull request #5253 from opensourcerouting/update-vpls-topotest
Donald Sharp [Tue, 5 Nov 2019 16:36:33 +0000 (11:36 -0500)]
Merge pull request #5253 from opensourcerouting/update-vpls-topotest

Fix the LDP VPLS topotest

4 years agoMerge pull request #5261 from donaldsharp/pointer_fun
Lou Berger [Tue, 5 Nov 2019 16:32:20 +0000 (11:32 -0500)]
Merge pull request #5261 from donaldsharp/pointer_fun

Convert some XXX_free lib functions to a double pointer

4 years agoBGPD: Prevent IPv6-LL being fwd to IBGP peers not on same link.
bisdhdh [Tue, 5 Nov 2019 05:29:58 +0000 (10:59 +0530)]
BGPD: Prevent IPv6-LL being fwd to IBGP peers not on same link.

Prevent IPv6 Link-local address being forward to IBGP peer,
which are not directly connected.

R1----IPV6-unnumbered-EBGP-------R2-----IPV6-IBGP-----R3

Configure route-map to set preferred global address on and apply
route-map-IN on R2 for R1-R2 session. Now check on R3's BGP and
RIB table has route nexthop as R1 link-local address, which is
not correct.

As of now we clear link-local address info from mp_nexthop_global,
only if mp_nexthop_global is populated with link-local address.

We should do it even if route-map is configured boz forwarding
link-local address from one link scope to another is violation of
the standards.

Signed-off-by: Biswajit Sadhu sadhub@vmware.com
4 years agobgpd: skip unsupported PREFIX_SID sub-type
Hiroki Shirokura [Mon, 4 Nov 2019 17:33:50 +0000 (17:33 +0000)]
bgpd: skip unsupported PREFIX_SID sub-type

This commit make bgpd to skip and ignore unsupported
sub-type of PREFIX_SID. (especially new defined sub-type)
Current bgpd can't parase unsupported sub-type of PREFIX_SID.
PREFIX_SID is drafted on draft-ietf-idr-bgp-prefix-sid-27.
There are already new sub-type drafted on
draft-dawra-idr-srv6-vpn-05. (Type5,6 is new defined.)
This commit fix the problem reported as #5277 on GitBub.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
4 years agodoc: clean up && index topotest json docs
Quentin Young [Mon, 4 Nov 2019 18:51:31 +0000 (18:51 +0000)]
doc: clean up && index topotest json docs

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5275 from opensourcerouting/emacs-conf
Jafar Al-Gharaibeh [Mon, 4 Nov 2019 17:01:25 +0000 (11:01 -0600)]
Merge pull request #5275 from opensourcerouting/emacs-conf

tools: fix emacs configuration file

4 years agotopotest: update the LDP VPLS test
Renato Westphal [Wed, 30 Oct 2019 22:28:56 +0000 (19:28 -0300)]
topotest: update the LDP VPLS test

The final test case of this topotest wasn't really testing
anything. Do the following changes to fix this:
* Remove "no link-detect" from the zebra configs so that link down
  failures are detected immediately;
* After shutting down the interface between r1 and r2, wait five
  seconds before testing if the pseudowires reconverged through
  the r3 router.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agotopotest: enable MPLS processing on all interfaces by default
Renato Westphal [Wed, 30 Oct 2019 22:23:41 +0000 (19:23 -0300)]
topotest: enable MPLS processing on all interfaces by default

This is necessary to make some tests work correctly. Only topologies
created using the topogen framework benefit from this change.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoMerge pull request #5265 from Jafaral/deb-changes
Donatas Abraitis [Mon, 4 Nov 2019 15:06:40 +0000 (17:06 +0200)]
Merge pull request #5265 from Jafaral/deb-changes

tools: generate .changes file required for deb pkg upload

4 years agotools: fix emacs configuration file
Rafael Zalamena [Mon, 4 Nov 2019 13:56:42 +0000 (10:56 -0300)]
tools: fix emacs configuration file

It was missing a set of parentheses and a dot before
`indent-tabs-mode'.

More information here:
https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html#Directory-Variables

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoMerge pull request #5272 from vincentbernat/fix/debian-copyright
Donald Sharp [Sun, 3 Nov 2019 20:05:22 +0000 (15:05 -0500)]
Merge pull request #5272 from vincentbernat/fix/debian-copyright

debian: update debian/copyright

4 years agodebian: update debian/copyright
Vincent Bernat [Sun, 3 Nov 2019 17:32:07 +0000 (18:32 +0100)]
debian: update debian/copyright

Some authors are added in the "GPL-2+" section, notably Alexandre
Cassen for the code in `vrrpd/`, and Cumulus Networks and Open Source
Routing which were uncredited despite many occurrence in the headers.

Signed-off-by: Vincent Bernat <vincent@bernat.ch>
4 years agolib, ospfd, zebra: Convert interface_delete to take double pointer
Donald Sharp [Wed, 30 Oct 2019 00:24:10 +0000 (20:24 -0400)]
lib, ospfd, zebra: Convert interface_delete to take double pointer

When free'ing the interface pointer, set it to NULL.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years ago*: Convert connected_free to a double pointer
Donald Sharp [Wed, 30 Oct 2019 00:16:28 +0000 (20:16 -0400)]
*: Convert connected_free to a double pointer

Set the connected pointer to set the pointer to NULL.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years ago*: Convert prefix_free to double pointer
Donald Sharp [Wed, 30 Oct 2019 00:05:27 +0000 (20:05 -0400)]
*: Convert prefix_free to double pointer

Have the prefix_free code take a double pointer to free the data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: separate zebra_vrf_lookup_table_with_id()
Stephen Worley [Fri, 1 Nov 2019 19:52:47 +0000 (15:52 -0400)]
zebra: separate zebra_vrf_lookup_table_with_id()

We were creating `other` tables in rib_del(), vty commands, and
dataplane return callback via the zebra_vrf_table_with_table_id()
API.

Seperate the API into only a lookup, never create
and added another with `get` in the name (following the standard
we use in other table APIs).

Then changed the rib_del(), rib_find_rn_from_ctx(), and show route
summary vty command to use the lookup API instead.

This was found via a crash where two different vrfs though they owned
the table. On delete, one free'd all the nodes, and then the other tried
to use them. It required specific timing of a VRF existing, going away,
and coming back again to cause the crash.

=23464== Invalid read of size 8
==23464==    at 0x179EA4: rib_dest_from_rnode (rib.h:433)
==23464==    by 0x17ACB1: zebra_vrf_delete (zebra_vrf.c:253)
==23464==    by 0x48F3D45: vrf_delete (vrf.c:243)
==23464==    by 0x48F4468: vrf_terminate (vrf.c:532)
==23464==    by 0x13D8C5: sigint (main.c:172)
==23464==    by 0x48DD25C: quagga_sigevent_process (sigevent.c:105)
==23464==    by 0x48F0502: thread_fetch (thread.c:1417)
==23464==    by 0x48AC82B: frr_run (libfrr.c:1023)
==23464==    by 0x13DD02: main (main.c:483)
==23464==  Address 0x5152788 is 104 bytes inside a block of size 112 free'd
==23464==    at 0x48369AB: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==23464==    by 0x48B25B8: qfree (memory.c:129)
==23464==    by 0x48EA335: route_node_destroy (table.c:500)
==23464==    by 0x48E967F: route_node_free (table.c:90)
==23464==    by 0x48E9742: route_table_free (table.c:124)
==23464==    by 0x48E9599: route_table_finish (table.c:60)
==23464==    by 0x170CEA: zebra_router_free_table (zebra_router.c:165)
==23464==    by 0x170DB4: zebra_router_release_table (zebra_router.c:188)
==23464==    by 0x17AAD2: zebra_vrf_disable (zebra_vrf.c:222)
==23464==    by 0x48F3F0C: vrf_disable (vrf.c:313)
==23464==    by 0x48F3CCF: vrf_delete (vrf.c:223)
==23464==    by 0x48F4468: vrf_terminate (vrf.c:532)
==23464==  Block was alloc'd at
==23464==    at 0x4837B65: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==23464==    by 0x48B24A2: qcalloc (memory.c:110)
==23464==    by 0x48EA2FE: route_node_create (table.c:488)
==23464==    by 0x48E95C7: route_node_new (table.c:66)
==23464==    by 0x48E95E5: route_node_set (table.c:75)
==23464==    by 0x48E9EA9: route_node_get (table.c:326)
==23464==    by 0x48E1EDB: srcdest_rnode_get (srcdest_table.c:244)
==23464==    by 0x16EA4B: rib_add_multipath (zebra_rib.c:2730)
==23464==    by 0x1A5310: zread_route_add (zapi_msg.c:1592)
==23464==    by 0x1A7B8E: zserv_handle_commands (zapi_msg.c:2579)
==23464==    by 0x19D689: zserv_process_messages (zserv.c:523)
==23464==    by 0x48F09F8: thread_call (thread.c:1599)

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agotools: generate .changes file required for deb pkg upload
Jafar Al-Gharaibeh [Fri, 1 Nov 2019 16:23:25 +0000 (11:23 -0500)]
tools: generate .changes file required for deb pkg upload

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
4 years agoMerge pull request #5263 from donaldsharp/pim_excessive_warnings
Mark Stapp [Fri, 1 Nov 2019 16:13:00 +0000 (12:13 -0400)]
Merge pull request #5263 from donaldsharp/pim_excessive_warnings

pimd: Do not spew a million warnings

4 years agoMerge pull request #5258 from dslicenc/ospf-bfd
Rafael Zalamena [Fri, 1 Nov 2019 14:22:56 +0000 (11:22 -0300)]
Merge pull request #5258 from dslicenc/ospf-bfd

ospf: BFD down not tearing down OSPF adjacency for point-to-point net…

4 years agopimd: Do not spew a million warnings
Donald Sharp [Fri, 1 Nov 2019 14:10:10 +0000 (10:10 -0400)]
pimd: Do not spew a million warnings

We have a zlog_warn that is unguarded ( and really is a debug message )
as that there is nothing the end user can do and nothing to note
here other than a debug message to track refcounts.  Change
to an appropriate debug and zlog_debug it instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5168 from donaldsharp/dev_workflow
Martin Winter [Fri, 1 Nov 2019 14:09:00 +0000 (10:09 -0400)]
Merge pull request #5168 from donaldsharp/dev_workflow

doc: Update documentation to talk about development branches

4 years agodoc: Update documentation to talk about development branches
Donald Sharp [Wed, 16 Oct 2019 15:24:21 +0000 (11:24 -0400)]
doc: Update documentation to talk about development branches

As per weekly meeting this is an attempt to document about
how we as a community will work together on development
branches.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoospf: BFD down not tearing down OSPF adjacency for point-to-point network
Radhika Mahankali [Mon, 9 Apr 2018 22:30:32 +0000 (15:30 -0700)]
ospf: BFD down not tearing down OSPF adjacency for point-to-point network

Root Cause:
Lookup for the point-to-point neighbor was failing because the neighbor
lookup was based on neighbor interface IP address. But, for point-to-point
neighbor the key is router-id for lookup. Lookup failure was causing the
BFD updates from PTM to get dropped.

Fix:
Added walk of the neighbor list if the network type is point-to-point to
find the appropriate neighbor. The match is based on source IP address of
the neighbor since that’s the address registered with BFD for monitoring.

Ticket: CM-20411
Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com>
4 years agoMerge pull request #5248 from opensourcerouting/bgp-sender-as-path-loop-detection
Donatas Abraitis [Thu, 31 Oct 2019 06:36:33 +0000 (08:36 +0200)]
Merge pull request #5248 from opensourcerouting/bgp-sender-as-path-loop-detection

bgpd: sender side AS path loop detection

4 years agoMerge pull request #5237 from ton31337/fix/doc_bgp_redistribute_vpn
Renato Westphal [Wed, 30 Oct 2019 23:47:04 +0000 (20:47 -0300)]
Merge pull request #5237 from ton31337/fix/doc_bgp_redistribute_vpn

doc: Add redistribute vnc-direct command and fix typo in redistribute vnc

4 years agoMerge pull request #5251 from qlyoung/vrrp-startup-logs-more
Mark Stapp [Wed, 30 Oct 2019 18:00:33 +0000 (14:00 -0400)]
Merge pull request #5251 from qlyoung/vrrp-startup-logs-more

vrrpd: some more error logging fixes

4 years agoMerge pull request #5186 from opensourcerouting/nb-cbs-reorg
Quentin Young [Wed, 30 Oct 2019 17:59:13 +0000 (13:59 -0400)]
Merge pull request #5186 from opensourcerouting/nb-cbs-reorg

northbound callbacks reorganization

4 years agotools: update the northbound callbacks generator
Renato Westphal [Thu, 17 Oct 2019 20:26:02 +0000 (17:26 -0300)]
tools: update the northbound callbacks generator

Add a new '-s' option which controls whether the generated northbound
callbacks are declared with the 'static' specifier or not. If not
(the default), a prototype is generated for each callback before
their declarations.

It's suggested that daemons shouldn't use the '-s' option so that
their northbound callbacks can be implemented in different files
according to their class (config, state, rpc or notification).

libfrr commands, on the other hand, can use the '-s' option when
their associated YANG module is too small and putting all callbacks
in the same file is desirable.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agobfdd: split northbound callbacks into multiple files
Renato Westphal [Thu, 17 Oct 2019 20:11:17 +0000 (17:11 -0300)]
bfdd: split northbound callbacks into multiple files

Rearrange the bfdd northbound callbacks as following:
* bfd_nb.h: prototypes of all northbound callbacks.
* bfd_nb.c: definition of all northbound callbacks and their
  associated YANG data paths.
* bfd_nb_config.c: implementation of YANG configuration nodes.
* bfd_nb_state.c: implementation of YANG state nodes.

This should help to keep to code more organized and easier to
maintain.

No behavior changes intended.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agodoc: bgp sender side as path loop detection
Rafael Zalamena [Tue, 29 Oct 2019 19:39:40 +0000 (16:39 -0300)]
doc: bgp sender side as path loop detection

Document the new command that does sender side AS path loop detection
and filtering.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoMerge pull request #5249 from donaldsharp/pim_duplicate
Donatas Abraitis [Wed, 30 Oct 2019 10:59:45 +0000 (12:59 +0200)]
Merge pull request #5249 from donaldsharp/pim_duplicate

pimd: Duplicate config is not a CMD_WARNING_CONFIG_FAILED

4 years agoMerge pull request #5246 from sworleys/README-Frr-Chicken
Donatas Abraitis [Wed, 30 Oct 2019 07:08:04 +0000 (09:08 +0200)]
Merge pull request #5246 from sworleys/README-Frr-Chicken

Add FRR Icon to README

4 years agovrrpd: some more error logging fixes
Quentin Young [Tue, 29 Oct 2019 18:47:04 +0000 (18:47 +0000)]
vrrpd: some more error logging fixes

- Give the correct log message when refusing to start because the vr is
  already started
- Fix a couple other : whynot; cases missed

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5247 from ghasemnaddaf/vrrp_ipv4
Quentin Young [Wed, 30 Oct 2019 03:51:44 +0000 (23:51 -0400)]
Merge pull request #5247 from ghasemnaddaf/vrrp_ipv4

vrrpd: only count ipv4 addresses on check start

4 years agopimd: Duplicate config is not a CMD_WARNING_CONFIG_FAILED
Donald Sharp [Wed, 30 Oct 2019 01:37:30 +0000 (21:37 -0400)]
pimd: Duplicate config is not a CMD_WARNING_CONFIG_FAILED

When you enter:
ip pim ssm prefix-list my-custom-ssm-range
ip pim ssm prefix-list my-custom-ssm-range

The second instance would cause a failure to happen which
should not happen w/ duplicate config.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoripngd: split northbound callbacks into multiple files
Renato Westphal [Thu, 17 Oct 2019 19:03:09 +0000 (16:03 -0300)]
ripngd: split northbound callbacks into multiple files

Rearrange the ripngd northbound callbacks as following:
* ripng_nb.h: prototypes of all northbound callbacks.
* ripng_nb.c: definition of all northbound callbacks and their
  associated YANG data paths.
* ripng_nb_config.c: implementation of YANG configuration nodes.
* ripng_nb_state.c: implementation of YANG state nodes.
* ripng_nb_rpcs.c: implementation of YANG RPCs.

This should help to keep to code more organized and easier to
maintain.

No behavior changes intended.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoripd: split northbound callbacks into multiple files
Renato Westphal [Thu, 17 Oct 2019 18:46:54 +0000 (15:46 -0300)]
ripd: split northbound callbacks into multiple files

Rearrange the ripd northbound callbacks as following:
* rip_nb.h: prototypes of all northbound callbacks.
* rip_nb.c: definition of all northbound callbacks and their
  associated YANG data paths.
* rip_nb_config.c: implementation of YANG configuration nodes.
* rip_nb_state.c: implementation of YANG state nodes.
* rip_nb_rpcs.c: implementation of YANG RPCs.
* rip_nb_notifications.c: implementation of YANG notifications.

This should help to keep to code more organized and easier to
maintain.

No behavior changes intended.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoisisd: split northbound callbacks into multiple files
Renato Westphal [Thu, 17 Oct 2019 18:33:53 +0000 (15:33 -0300)]
isisd: split northbound callbacks into multiple files

Rearrange the isisd northbound callbacks as following:
* isis_nb.h: prototypes of all northbound callbacks.
* isis_nb.c: definition of all northbound callbacks and their
  associated YANG data paths.
* isis_nb_config.c: implementation of YANG configuration nodes.
* isis_nb_state.c: implementation of YANG state nodes.
* isis_nb_notifications.c: implementation of YANG notifications.

This should help to keep to code more organized and easier to
maintain.

No behavior changes intended.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agobgpd: expose sender side AS path loop detection
Rafael Zalamena [Tue, 29 Oct 2019 19:29:09 +0000 (16:29 -0300)]
bgpd: expose sender side AS path loop detection

The sender side AS path loop detection code was implemented since the
import of Quagga code, however it was always disabled by a `ifdef`
guard.

Lets allow the user to decide whether or not to enable this feature on
run-time.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agovrrpd: only count ipv4 addresses on check start
Ghasem Naddaf [Tue, 29 Oct 2019 18:02:15 +0000 (11:02 -0700)]
vrrpd: only count ipv4 addresses on check start

Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>
4 years agoREADME.md: Add FRR Icon
Stephen Worley [Tue, 29 Oct 2019 14:51:08 +0000 (10:51 -0400)]
README.md: Add FRR Icon

:chicken:

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agoMerge pull request #5197 from SumitAgarwal123/BFD_ADMIN_DOWN
Rafael Zalamena [Tue, 29 Oct 2019 15:12:27 +0000 (12:12 -0300)]
Merge pull request #5197 from SumitAgarwal123/BFD_ADMIN_DOWN

bfdd: Handling local and remote admin-down

4 years agoMerge pull request #5240 from donaldsharp/zebra_nhg_sa
Donatas Abraitis [Tue, 29 Oct 2019 13:53:27 +0000 (15:53 +0200)]
Merge pull request #5240 from donaldsharp/zebra_nhg_sa

ZEBRA COVERITY STUFF

4 years agoMerge pull request #4941 from ton31337/fix/do_not_include_nexthop_dash_dash
Donald Sharp [Tue, 29 Oct 2019 13:37:04 +0000 (09:37 -0400)]
Merge pull request #4941 from ton31337/fix/do_not_include_nexthop_dash_dash

bgpd: Do not send next-hop as :: in MP_REACH_NLRI if no link-local ex…

4 years agoMerge pull request #5242 from FRRouting/feature/topotests-docker-libyang-from-repo
Donatas Abraitis [Tue, 29 Oct 2019 12:40:16 +0000 (14:40 +0200)]
Merge pull request #5242 from FRRouting/feature/topotests-docker-libyang-from-repo

topotests/Dockerfile: Install libyang from repository

4 years agotopotests/Dockerfile: Install libyang from repository
Christian Franke [Tue, 29 Oct 2019 09:08:19 +0000 (10:08 +0100)]
topotests/Dockerfile: Install libyang from repository

Instead of installing libyang from some old build, let's install
the current libyang from our Debian/Ubuntu repository.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
4 years agoMerge pull request #5234 from donaldsharp/fix_sa_or_else
Donatas Abraitis [Tue, 29 Oct 2019 06:58:51 +0000 (08:58 +0200)]
Merge pull request #5234 from donaldsharp/fix_sa_or_else

Fix sa or else

4 years agobfdd: Handling local and remote admin-down
SumitAgarwal123 [Mon, 21 Oct 2019 05:53:01 +0000 (22:53 -0700)]
bfdd: Handling local and remote admin-down

Scenarios where this code change is required:

1. BFD is un-configured from BGP at remote end.

Neighbour BFD sends ADMIN_DOWN state, but BFD on local side will send
DOWN to BGP, resulting in BGP session DOWN.
Removing BFD session administratively shouldn't bring DOWN BGP session
at local or remote.

2. BFD is un-configured from BGP or shutdown locally.

BFD will send state DOWN to BGP resulting in BGP session DOWN.
(This is akin to saying do not use BFD for BGP)
Removing BFD session administratively shouldn't bring DOWN BGP session at
local or remote.

Signed-off-by: Sayed Mohd Saquib sayed.saquib@broadcom.com
4 years agozebra: zvni_map_to_svi may return NULL act accordingly
Donald Sharp [Tue, 29 Oct 2019 00:52:40 +0000 (20:52 -0400)]
zebra: zvni_map_to_svi may return NULL act accordingly

The zvni_map_to_svi function may return NULL as such prevent
a deref and crash.  Found via coverity

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Fix some nhg SA issues found in latest Coverity
Donald Sharp [Tue, 29 Oct 2019 00:30:06 +0000 (20:30 -0400)]
zebra: Fix some nhg SA issues found in latest Coverity

Fix 2 Coverity issues:
1) zebra_nhg.c -> all paths in nhg_ctx_process_finish have
already deref'ed the ctx pointer no need for a test of it

2) the **ifp pointer passed in may be NULL.  Prevent an accidental
deref if calling function does not pass in a ifp pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agodoc: Add redistribute vnc-direct command
Donatas Abraitis [Mon, 28 Oct 2019 14:53:40 +0000 (16:53 +0200)]
doc: Add redistribute vnc-direct command

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agodoc: redistribute vpn --> redistribute vnc
Donatas Abraitis [Mon, 28 Oct 2019 14:53:11 +0000 (16:53 +0200)]
doc: redistribute vpn --> redistribute vnc

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #4897 from sworleys/zebra_nhg_add
Mark Stapp [Mon, 28 Oct 2019 12:07:23 +0000 (13:07 +0100)]
Merge pull request #4897 from sworleys/zebra_nhg_add

Zebra Nexthop Group Rework and Kernel Nexthop Object API Init

4 years agobgpd: write variable is never used in cli function
Donald Sharp [Sat, 26 Oct 2019 01:35:04 +0000 (21:35 -0400)]
bgpd: write variable is never used in cli function

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: bgp_path_info_mpath_next only returns values
Donald Sharp [Sat, 26 Oct 2019 01:10:31 +0000 (21:10 -0400)]
bgpd: bgp_path_info_mpath_next only returns values

Since we don't set a value from the return of bgp_path_info_mpath_next
it is impossible for this function to do anything as such the if statement
is dead code as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Logically dead code
Donald Sharp [Sat, 26 Oct 2019 00:37:26 +0000 (20:37 -0400)]
bgpd: Logically dead code

SAFI_EVPN and SAFI_MPLSVPN have been excluded by previous
if statements.  This code is dead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Remove dead code in rfapi
Donald Sharp [Sat, 26 Oct 2019 00:31:02 +0000 (20:31 -0400)]
bgpd: Remove dead code in rfapi

Coverity spotted some dead code in the rfapi code.  Removing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobfdd: VRF and Coverity
Donald Sharp [Sat, 26 Oct 2019 00:26:29 +0000 (20:26 -0400)]
bfdd: VRF and Coverity

Fixup a couple of Coverity issues surrounding pointers

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5216 from ton31337/fix/override_peers_ttl_if_peer_group_configured
Donald Sharp [Fri, 25 Oct 2019 18:03:06 +0000 (14:03 -0400)]
Merge pull request #5216 from ton31337/fix/override_peers_ttl_if_peer_group_configured

bgpd: Override peer's TTL only if peer-group is configured with TTL

4 years agoMerge pull request #5225 from ton31337/fix/noip_nhrp_map
Donald Sharp [Fri, 25 Oct 2019 18:02:29 +0000 (14:02 -0400)]
Merge pull request #5225 from ton31337/fix/noip_nhrp_map

nhrp: Make sure `no ip nhrp map <something>` works as expected

4 years agoMerge pull request #5223 from donaldsharp/fix_it_it_it_it_it_it
Russ White [Fri, 25 Oct 2019 17:53:39 +0000 (13:53 -0400)]
Merge pull request #5223 from donaldsharp/fix_it_it_it_it_it_it

Fix it it it it it it

4 years agozebra: rt_netlink nexthop handling checkpatch
Stephen Worley [Fri, 25 Oct 2019 15:11:06 +0000 (11:11 -0400)]
zebra: rt_netlink nexthop handling checkpatch

Checkpatch was complaining because this code was extending
beyond 80 characters on a couple lines. Adjusted a conditional
tree to fix that.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Cleanup zebra_nhg APIs
Stephen Worley [Wed, 23 Oct 2019 22:28:10 +0000 (18:28 -0400)]
zebra: Cleanup zebra_nhg APIs

Add a private header file for functions that are internal/special
case like how we do it for `lib/nexthop_group_private.h`.

Remove a bunch of functions from the header file only being used
statically and add some comments for those remaining to indicate
better what their use is.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Re-work zebra_nhg_*_valid APIs
Stephen Worley [Wed, 23 Oct 2019 20:49:07 +0000 (16:49 -0400)]
zebra: Re-work zebra_nhg_*_valid APIs

Re-work the validity setting and checking APIs
for nhg_hash_entry's to make them clearer.

Further, they were originally only beings set
on ifdown and install. Extended their use into
releasing entries and to account for setting
the validity of a recursive dependent.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Improve commenting for group requeue case
Stephen Worley [Wed, 23 Oct 2019 19:07:22 +0000 (15:07 -0400)]
zebra: Improve commenting for group requeue case

The commenting for why we would need to requeue a
group from the kernel to be later processed was not
sufficient. Add a better explanation for the flow
and state of the system.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Change wording of duplicate kernel nhg flag
Stephen Worley [Wed, 23 Oct 2019 18:50:30 +0000 (14:50 -0400)]
zebra: Change wording of duplicate kernel nhg flag

Change the wording of the flag indicating we have received
a nexthop group from the kernel with a different ID but
is fundamentally identical to one we already have.

It was colliding with a flag of similar name in the nexthop struct.

Change it from NEXTHOP_GROUP_DUPLICATE -> NEXTHOP_GROUP_UNHASHABLE
since it is in fact unhashable.

Also change the wording of functions and comments referencing the same
problem.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: Make nexthop_next* use const for nexthop
Stephen Worley [Wed, 23 Oct 2019 18:37:20 +0000 (14:37 -0400)]
lib: Make nexthop_next* use const for nexthop

Make nexthop_next() and nexthop_next_active_resolved() use
const for the nexthop argument. They should not be modifying so
it makes sense here.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Check depends for validity, not dependents
Stephen Worley [Wed, 23 Oct 2019 18:08:12 +0000 (14:08 -0400)]
zebra: Check depends for validity, not dependents

When determining whether to set the nhg_hash_entry as
invalid, we should have been checking the depends, not
the dependents. If its a group and at least one of its
depends is valid, the group is still valid.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Guard nexthop group overflow read
Stephen Worley [Wed, 23 Oct 2019 17:08:10 +0000 (13:08 -0400)]
zebra: Guard nexthop group overflow read

Guard against an overflow read when processing
nexthop groups from netlink. Add a check to ensure
we don't try to write passed the array size.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Adjust nhg handling for dataplane result off on shutdown
Stephen Worley [Fri, 4 Oct 2019 20:48:20 +0000 (16:48 -0400)]
zebra: Adjust nhg handling for dataplane result off on shutdown

Now with this patch we can't use shutdown for cleanup:

```
commit 2fc69f03d2f49fcf34948e82e865cd302ae08da0 (pr_5079)
Author: Mark Stapp <mjs@voltanet.io>
Date:   Fri Sep 27 12:15:34 2019 -0400

    zebra: during shutdown processing, drop dplane results

    Don't process dataplane results in zebra during shutdown (after
    sigint has been seen). The dplane continues to run in order to
    clean up, but zebra main just drops results.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
```

Adjusted nhg uninstall handling to clear data and other
cleanup before sending to the dataplane.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Set the nhe type in the appropriate place
Stephen Worley [Fri, 4 Oct 2019 20:12:19 +0000 (16:12 -0400)]
zebra: Set the nhe type in the appropriate place

We were setting the nhe type on uninstall when it should be on
the install.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Remove cleanup and nhg workqueue boilerplate
Stephen Worley [Fri, 4 Oct 2019 18:32:26 +0000 (14:32 -0400)]
zebra: Remove cleanup and nhg workqueue boilerplate

This code was from a strategies we elected not to use and
can safely be removed.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Comment to indicate where nhg hashtables live
Stephen Worley [Fri, 4 Oct 2019 18:28:33 +0000 (14:28 -0400)]
zebra: Comment to indicate where nhg hashtables live

Add a comment to the header of `zebra_nhg.c` to point the reader
to where the hashtables containing the nhg entries are held.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib,pbrd,zebra: Use one api to delete nexthops/group
Stephen Worley [Fri, 4 Oct 2019 18:04:43 +0000 (14:04 -0400)]
lib,pbrd,zebra: Use one api to delete nexthops/group

Reduce the api for deleting nexthops and the containing
group to just one call rather than having a special case
and handling it separately.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agopbrd: nexthop_group delete cb don't free pbr->nhg
Stephen Worley [Fri, 4 Oct 2019 17:54:39 +0000 (13:54 -0400)]
pbrd: nexthop_group delete cb don't free pbr->nhg

The pbr->nhg callback is used exclusively for individual nexthops
set through `set nexthop`. If an actuall "tracked" nexthop_group is
used, only the `pbrms->nhgrp_name` is set. Thus this delete does
nothing.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Use ng pointer in mpls_ftn_uninstall
Stephen Worley [Tue, 24 Sep 2019 22:40:09 +0000 (18:40 -0400)]
zebra: Use ng pointer in mpls_ftn_uninstall

With the new nexthop group shared memory framework, pointers
are being used in route_entry for the nexthop_group. Update
the use of this in `mpls_ftn_uninstall()` to reflect the change.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Add DPLANE_NEIGH and DPLANE_VTEP to nhg cases
Stephen Worley [Tue, 24 Sep 2019 22:38:28 +0000 (18:38 -0400)]
zebra: Add DPLANE_NEIGH and DPLANE_VTEP to nhg cases

Add DPLANE_OP_NEIGH and DPLANE_OP_VTEP to nhg dplane
handler's switch statements.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agodoc: Add docs for new nexthop group commands
Stephen Worley [Mon, 9 Sep 2019 17:44:17 +0000 (13:44 -0400)]
doc: Add docs for new nexthop group commands

Add some doc information for the new nexthop group commands. Also
had to add some for ones that were missing, which we are adding
additional commands to.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Fallback to default ns if nhg vrf lookup fails
Stephen Worley [Fri, 6 Sep 2019 16:30:30 +0000 (12:30 -0400)]
zebra: Fallback to default ns if nhg vrf lookup fails

If the vrf lookup fails, use the default namespace
to find/delete the nexthop group from the kernel because it
should be there anyway.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: Add common handler for nexthop_group_equal*()
Stephen Worley [Tue, 3 Sep 2019 20:59:57 +0000 (16:59 -0400)]
lib: Add common handler for nexthop_group_equal*()

Add a common handler function for the different nexthop_group_equal*()
comparison functions.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: Add NULL check in nexthop_group_equal*() iter
Stephen Worley [Tue, 3 Sep 2019 20:43:42 +0000 (16:43 -0400)]
lib: Add NULL check in nexthop_group_equal*() iter

Add NULL checks in `nexthop_group_equal*()` iteration
before calling `nexthop_same()` to make Clang SA happy.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Zebra nexthop group re-work checkpatch fixes
Stephen Worley [Tue, 3 Sep 2019 20:12:06 +0000 (16:12 -0400)]
zebra: Zebra nexthop group re-work checkpatch fixes

Checkpatch fixes for the zebra nexthop group re-work.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Fix NULL check in zebra_nhg_rib_find()
Stephen Worley [Tue, 3 Sep 2019 19:10:21 +0000 (15:10 -0400)]
zebra: Fix NULL check in zebra_nhg_rib_find()

Check both the nhg and nexthop are not NULL before passing
them to be hashed. Clang SA caught this.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: Fix nexthop_group_equal*() NULL check
Stephen Worley [Tue, 3 Sep 2019 18:46:14 +0000 (14:46 -0400)]
lib: Fix nexthop_group_equal*() NULL check

Logic error on the second null check for nexthop groups
passed to the `nexthop_group_equal*() functions. This fixes it.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agotopotests: Expect shared nexthop memory
Stephen Worley [Tue, 3 Sep 2019 17:53:45 +0000 (13:53 -0400)]
topotests: Expect shared nexthop memory

A few topotests were failing since they were not aware
of shared nexthops and, therefore, matching on flags that
could be changed when another route sharing that nexthop is
installed.

Update routes that are not installed to not match their json output
on the nexthop flag information. The ones that are installed will
still retain their matches though since they can be sure the nexthop
should have those flags (they would be the route that set them).

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Update ip route show with nexthop_num API
Stephen Worley [Fri, 30 Aug 2019 20:18:07 +0000 (16:18 -0400)]
zebra: Update ip route show with nexthop_num API

Switch the nexthop_num dereferences to use the nexthop_group
API in `vty_show_ip_route()`.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Add bsd nexthop install boilerplate
Stephen Worley [Thu, 29 Aug 2019 15:42:52 +0000 (11:42 -0400)]
zebra: Add bsd nexthop install boilerplate

Add some boilerplate for nexthop installation for bsd kernels.
They do not support nexthop objects for now so its just boilerplate.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Fix missed bsd nexthop group pointer
Stephen Worley [Thu, 29 Aug 2019 14:27:31 +0000 (10:27 -0400)]
zebra: Fix missed bsd nexthop group pointer

When moving the nexthop group in a route entry to be a pointer,
we missed one wrapped in a `ifndef` for when the kernel doesn't
have netlink.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Force off kernel nexthop group API for now
Stephen Worley [Wed, 28 Aug 2019 20:15:17 +0000 (16:15 -0400)]
zebra: Force off kernel nexthop group API for now

Force off kernel nexthop group API for now. Will re-enable
after suffient testing.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Only check nexthop status on route install/update
Stephen Worley [Wed, 28 Aug 2019 18:40:16 +0000 (14:40 -0400)]
zebra: Only check nexthop status on route install/update

We do not need to check that the nexthop is installed or queued
when sending a route deletion since we only need to the prefix for it.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Only show route nexthop group ID when asked
Stephen Worley [Mon, 26 Aug 2019 22:20:45 +0000 (18:20 -0400)]
zebra: Only show route nexthop group ID when asked

In lieu of the fact that we probably shouldn't change show
command output too much, changing this to only give nhe_id
output when the user explicitly asks for it. Probably only
going to be used for debugging for now anyway.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Only use passed afi for blackhole/ifindex nexthops
Stephen Worley [Tue, 20 Aug 2019 19:08:01 +0000 (15:08 -0400)]
zebra: Only use passed afi for blackhole/ifindex nexthops

Only used the afi passed into `zebra_nhg_find()` for nexthops
that are blackhole/ifindex. Others should use the type actually declared
in the nexthop struct itself.

Basically, nexthop objects of type blackhole/ifindex in the kernel must
have an address family, they cannot be ambigious and be shared.

This is some requirement in the linux ip core code.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Handle out of order kernel nexthop groups
Stephen Worley [Tue, 13 Aug 2019 00:09:59 +0000 (20:09 -0400)]
zebra: Handle out of order kernel nexthop groups

Add a mechanism to requeue groups we receive from the
kernel if the IDs are in a weird order (Group ID is lower
than individual nexthop IDs for example).

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>