]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
5 years agozebra: maintain mcast tunnel origination and termination SG entries
Anuradha Karuppiah [Tue, 26 Mar 2019 20:30:29 +0000 (13:30 -0700)]
zebra: maintain mcast tunnel origination and termination SG entries

Each multicast tunnel is associated with a -
1. Tunnel origination mroute that is used for forwarding the
VxLAN encapsulated flow -
S - local VTEP-IP
G - BUM mcast-group
2. And a tunnel termination entry -
S - * (any remote VTEP)
G - BUM mcast-group

Multiple L2 VNIs can share the same BUM mcast group (and local-VTEP-IP).
Zebra maintains an mcast (SG) hash table to pass this info to pimd for
subsequent MDT setup.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agolib: return listnode on add for subsequent efficent del
Anuradha Karuppiah [Tue, 19 Mar 2019 18:39:51 +0000 (11:39 -0700)]
lib: return listnode on add for subsequent efficent del

Having to lookup the DLL node to delete it defeats one purpose of using
DLLs.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agolib: move SG prefix2str APIs from pimd to lib
Anuradha Karuppiah [Tue, 19 Mar 2019 18:36:41 +0000 (11:36 -0700)]
lib: move SG prefix2str APIs from pimd to lib

This is to allow zebra to use these APIs instead of re-defining.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agozebra: install flood FDB entry only if the remote VTEP asked for HER
Anuradha Karuppiah [Tue, 19 Mar 2019 17:37:22 +0000 (10:37 -0700)]
zebra: install flood FDB entry only if the remote VTEP asked for HER

Remote VTEPs advertise the flood mode via IMET and the ingress VTEP
needs to perform head-end-replication of BUM packets to it only if the
PMSI tunnel type is set to ingress-replication. If a type-3 route is not
rxed or rxed with a mode other than ingress-replication we can skip
installation of the flood fdb entry for that L2-VNI. In that case the
remote VTEP is either not interested in BUM traffic or is using a
"static-config" based replication mode like PIM.

Sample output with HER -
=======================
root@TORS1:~# vtysh -c "show evpn vni 1000" |grep "Remote\|flood"
 Remote VTEPs for this VNI:
  27.0.0.8 flood: HER
root@TORS1:~#

Sample output with PIM-SM -
=========================
root@TORS2:~# vtysh -c "show evpn vni 1000" |grep "Remote\|flood"
 Remote VTEPs for this VNI:
  27.0.0.7 flood: -
root@TORS2:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agobgpd: propagate flood mode to zebra based on the tunnel-type in the IMET route
Anuradha Karuppiah [Tue, 19 Mar 2019 18:29:04 +0000 (11:29 -0700)]
bgpd: propagate flood mode to zebra based on the tunnel-type in the IMET route

IMET/type-3 routes are used by VTEPs to advertise the flood mode for BUM
traffic via the PMSI tunnel attribute. If a type-3 route is not rxed from
a remote-VTEP we default to "no-head-end-rep" for that remote-VTEP. In such
cases static-config such as PIM is likely used for BUM flooding.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agobgpd: suppress IMET route generation if flood mode is PIM-SM
Anuradha Karuppiah [Tue, 26 Mar 2019 20:26:33 +0000 (13:26 -0700)]
bgpd: suppress IMET route generation if flood mode is PIM-SM

IMET route is optional if the flood mode is PIM-SM and serves
no functional purpose. So this change limits type-3 route generation
to flood-mode=head-end-replication.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agobgpd: maintain flood mcast group per-l2-vni
Anuradha Karuppiah [Tue, 19 Mar 2019 18:08:24 +0000 (11:08 -0700)]
bgpd: maintain flood mcast group per-l2-vni

If PIM-SM if used for BUM flooding the multicast group address can be
configured per-vxlan-device. BGP receives this config from zebra via
the L2 VNI add/update.

Sample output -
root@TORS1:~# vtysh -c "show bgp l2vpn evpn vni 1000" |grep Mcast
  Mcast group: 239.1.1.100
root@TORS1:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agozebra: maintain the mcast-grp per-l2vni
Anuradha Karuppiah [Tue, 19 Mar 2019 16:10:47 +0000 (09:10 -0700)]
zebra: maintain the mcast-grp per-l2vni

This info is propagated to bgpd for appropriate IMET route generation.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agozebra: process mcast-grp rxed in the vxlan-device
Anuradha Karuppiah [Tue, 19 Mar 2019 15:57:04 +0000 (08:57 -0700)]
zebra: process mcast-grp rxed in the vxlan-device

BUP mcast IP address is maintained per-vxlan-device.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agozebra: header changes for l2 vni bum-mcast-grp handling
Anuradha Karuppiah [Mon, 18 Mar 2019 19:35:45 +0000 (12:35 -0700)]
zebra: header changes for l2 vni bum-mcast-grp handling

The multicast group ip address for BUM traffic is configurable per-l2-vni.
One way to configure that is to setup a vxlan device that per-l2-vni and
specify the address against that vxlan device -
root@TORS1:~# vtysh -c "show interface vx-1000" |grep -i vxlan
  Interface Type Vxlan
  VxLAN Id 1000 VTEP IP: 27.0.0.15 Access VLAN Id 1000 Mcast 239.1.1.100
root@TORS1:~# vtysh -c "show evpn vni 1000" |grep Mcast
 Mcast group: 239.1.1.100
root@TORS1:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agoMerge pull request #4165 from dslicenc/rnh-invalid-nexthops
Mark Stapp [Fri, 19 Apr 2019 18:11:22 +0000 (14:11 -0400)]
Merge pull request #4165 from dslicenc/rnh-invalid-nexthops

zebra: stop sending invalid nexthops to clients

5 years agozebra: stop sending invalid nexthops to clients
Don Slice [Mon, 15 Apr 2019 18:27:00 +0000 (18:27 +0000)]
zebra: stop sending invalid nexthops to clients

Found that zebra_rnh_apply_nht_rmap would set the
NEXTHOP_FLAG_ACTIVE if not blocked by the route-map, even
if the flag was not active prior to the check.  This fix
changes the flag used to denote the nexthop is filtered so
that proper active state can be retained. Additionally,
found two cases where we would send invalid nexthops via
send_client, which would also cause this crash.  All three
fixed in this commit.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agoMerge pull request #4164 from opensourcerouting/rm-ports
Quentin Young [Fri, 19 Apr 2019 16:03:40 +0000 (12:03 -0400)]
Merge pull request #4164 from opensourcerouting/rm-ports

ports: remove abandoned ports subdirectory

5 years agoMerge pull request #4154 from donaldsharp/zebra_run_once
Mark Stapp [Fri, 19 Apr 2019 15:57:39 +0000 (11:57 -0400)]
Merge pull request #4154 from donaldsharp/zebra_run_once

Zebra: run nht once

5 years agozebra: Update flag output for route entry dump
Donald Sharp [Wed, 17 Apr 2019 15:47:48 +0000 (11:47 -0400)]
zebra: Update flag output for route entry dump

Update the nexthop flag output for the route entry dump to
include all possible flag states be output.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Run nexthop_active_check once
Donald Sharp [Tue, 16 Apr 2019 13:06:35 +0000 (09:06 -0400)]
zebra: Run nexthop_active_check once

We currently run nexthop_active_check multiple times.  Make the
code run once and figure out state from that.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Double check is not necessary in nexthop_active_update
Donald Sharp [Tue, 16 Apr 2019 13:07:12 +0000 (09:07 -0400)]
zebra: Double check is not necessary in nexthop_active_update

The nexthop_active_update command looks at each individual
nexthop and decides if it has changed.  If any nexthop
has changed we will set the re->status to ROUTE_ENTRY_CHANGED
and ROUTE_ENTRY_NEXTHOPS_CHANGED.

Additionally the test for old_nh_num != curr_active
makes no sense because suppose we have several events
we are processing at the same time and a total ecmp
of 16 but 14 are active at the start and 14 are active
at the end but different interfaces are up or down.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib, zebra: Remove unused flag
Donald Sharp [Tue, 16 Apr 2019 12:37:24 +0000 (08:37 -0400)]
lib, zebra: Remove unused flag

The NEXTHOP_FLAG_FILTERED went away when we started treating
static routes like every other route in the system.  This was
a special case for handling static route code that just didn't
get finished cleaning up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: nexthop_active_update does not need set
Donald Sharp [Tue, 16 Apr 2019 12:09:56 +0000 (08:09 -0400)]
zebra: nexthop_active_update does not need set

We are effectively calling nexthop_active_update() on every
route entry being processed for installation at least 2 times.
This is a bit ridiculous.  We need to resolve the nexthops
when we know a route has changed in some manner, so do so.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4116 from nitinsoniism/show_l2vpn_evpn_route_detail
Sri Mohana Singamsetty [Thu, 18 Apr 2019 18:22:50 +0000 (08:22 -1000)]
Merge pull request #4116 from nitinsoniism/show_l2vpn_evpn_route_detail

bgpd: new show cmd - bgp l2vpn evpn route detail

5 years agolib: Add a counter for number of nexthops
Donald Sharp [Fri, 15 Feb 2019 16:02:44 +0000 (11:02 -0500)]
lib: Add a counter for number of nexthops

Add a ability to count the number of nexthops in a nexthop_group.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agotests: bgp_l3vpn_to_bgp_vrf were bailing to quickly
Donald Sharp [Thu, 18 Apr 2019 00:47:44 +0000 (20:47 -0400)]
tests: bgp_l3vpn_to_bgp_vrf were bailing to quickly

The tests are not coming up consistently on my test box.  Add a bit of wait
time to test to allow normal bgp when the first attempt doesn't come up.
Especially since bgp timeouts are 120 seconds with non datacenter compiles.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4141 from opensourcerouting/nb-minor-fixes
Mark Stapp [Thu, 18 Apr 2019 17:48:15 +0000 (13:48 -0400)]
Merge pull request #4141 from opensourcerouting/nb-minor-fixes

northbound minor fixes and improvements

5 years agoports: remove abandoned ports subdirectory
Renato Westphal [Thu, 18 Apr 2019 17:05:07 +0000 (14:05 -0300)]
ports: remove abandoned ports subdirectory

This subdirectory is outdated in all possible ways. Remove it.

FRR already has a FreeBSD port and it's maintained separately.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #4160 from pguibert6WIND/optionZforgotten
Renato Westphal [Thu, 18 Apr 2019 16:18:42 +0000 (13:18 -0300)]
Merge pull request #4160 from pguibert6WIND/optionZforgotten

bgpd: add the -Z option to run bgp without zebra

5 years agolib: make nb_candidate_edit() more flexible
Renato Westphal [Mon, 15 Apr 2019 22:04:30 +0000 (19:04 -0300)]
lib: make nb_candidate_edit() more flexible

Certain operations, like removing non-presence containers or
modifying list keys, are not considered to be valid from the
perspective of the northbound layer. This is because we want to
implement a minimum set of northbound configuration callbacks and
use them to process all possible configuration changes.

The removal of a np-container [1], for example, can be processed by
calling the "delete" callback of all of its child nodes (recursion
is used for np-container child nodes). Similarly, the modification
of a list key can be processed as if the corresponding list entry
was removed and readded with updated key values. This strategy saves
us the burden of implementing lots of extra configuration callbacks.

That said, the nb_operation_is_valid() function shouldn't be used
for anything other than checking which callbacks are valid for
which YANG nodes. Using it in the nb_candidate_edit() function
is inappropriate as we want as much flexibility as possible when
editing a candidate configuration. We should allow CLI commands,
for example, to remove np-containers (the northbound layer will then
figure out which callbacks need to be called when this candidate
is committed). Remove the check.

[1] We can't do the same for presence containers since they have a
"create" callback associated with them.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: introduce flog() to simplify the northbound code a little bit
Renato Westphal [Mon, 15 Apr 2019 22:03:57 +0000 (19:03 -0300)]
lib: introduce flog() to simplify the northbound code a little bit

flog() is a small wrapper around zlog() that can be useful in a
few places to reduce code duplication.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: move zlog() prototype back to the public logging API
Renato Westphal [Thu, 18 Apr 2019 16:13:26 +0000 (13:13 -0300)]
lib: move zlog() prototype back to the public logging API

zlog() should be part of the public logging API as it's useful in
the cases where the logging priority isn't known at compile time
(i.e. it depends on a variable).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: don't initialize the northbound database in the unit tests
Renato Westphal [Mon, 15 Apr 2019 22:03:15 +0000 (19:03 -0300)]
lib: don't initialize the northbound database in the unit tests

Move call to nb_db_init() from nb_init() to frr_init() so that only
the FRR daemons will initialize the northbound database. This should
fix a few warnings when running some unit tests.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: sync sysrepo module with latest API changes
Renato Westphal [Mon, 15 Apr 2019 22:01:43 +0000 (19:01 -0300)]
lib: sync sysrepo module with latest API changes

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agobgpd: add the -Z option to run bgp without zebra
Philippe Guibert [Thu, 18 Apr 2019 13:46:36 +0000 (15:46 +0200)]
bgpd: add the -Z option to run bgp without zebra

this feature was already pushed, but the way the arguments were passed
to bgp were wrong.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years ago.gitignore: ignore core dumps
Quentin Young [Wed, 17 Apr 2019 20:40:46 +0000 (20:40 +0000)]
.gitignore: ignore core dumps

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agolib: remove core dump
Quentin Young [Wed, 17 Apr 2019 20:31:30 +0000 (20:31 +0000)]
lib: remove core dump

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #4151 from opensourcerouting/ospf-assorted-20190417
Donald Sharp [Wed, 17 Apr 2019 12:47:08 +0000 (08:47 -0400)]
Merge pull request #4151 from opensourcerouting/ospf-assorted-20190417

assorted OSPF fixes

5 years agoMerge pull request #4148 from donaldsharp/ospf6_list_headinator
Mark Stapp [Wed, 17 Apr 2019 12:21:24 +0000 (08:21 -0400)]
Merge pull request #4148 from donaldsharp/ospf6_list_headinator

ospf6d: listhead returns a listnode *

5 years agoospfd: make ECMP nexthop order deterministic
David Lamparter [Tue, 16 Apr 2019 19:33:06 +0000 (21:33 +0200)]
ospfd: make ECMP nexthop order deterministic

The order of ECMP nexthops currently depends on whatever order the
pqueue code returns the vertices in, which is essentially random since
they compare as equal.  While this shouldn't cause issues normally, it
is nondeterministic and causes the ldp-topo1 test to fail when the
ordering comes up different.  Also, nondeterministic behaviour is not a
nice thing to have here in general.

Just sort by nexthop address;  realistic numbers of ECMP nexthops should
hopefully not make this a performance issue.  (Also, nexthops should be
hot in the caches here.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
5 years agoospfd: fix clang-SA warning
David Lamparter [Fri, 29 Mar 2019 11:25:45 +0000 (12:25 +0100)]
ospfd: fix clang-SA warning

Need to clear refresh_list before dropping the reference.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
5 years agoospf6d: listhead returns a listnode *
Donald Sharp [Wed, 17 Apr 2019 03:15:56 +0000 (23:15 -0400)]
ospf6d: listhead returns a listnode *

The ospf6_route_get_first_nh_index function call calls
listhead which returns a (listnode *) but we are casting
it to a (struct ospf6_nexthop *) and away we go.

Fixes: #4142
Found By: Kwind
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4147 from mjstapp/fix_pim_zebra_warning
Donald Sharp [Tue, 16 Apr 2019 23:31:34 +0000 (19:31 -0400)]
Merge pull request #4147 from mjstapp/fix_pim_zebra_warning

pimd: fix compile warnings

5 years agoMerge pull request #4084 from qlyoung/bgp-prefix-md5-auth
Russ White [Tue, 16 Apr 2019 23:25:43 +0000 (19:25 -0400)]
Merge pull request #4084 from qlyoung/bgp-prefix-md5-auth

Support TCP MD5 auth on prefixes & enable MD5 auth for BGP listen ranges

5 years agopimd: fix compile warnings
Mark Stapp [Tue, 16 Apr 2019 18:28:10 +0000 (14:28 -0400)]
pimd: fix compile warnings

Remove set-but-unused variables that provoke compile warnings

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #4132 from opensourcerouting/northbound-debug
Mark Stapp [Tue, 16 Apr 2019 16:01:09 +0000 (12:01 -0400)]
Merge pull request #4132 from opensourcerouting/northbound-debug

lib: add fine-grained debugging in the northbound

5 years agoMerge pull request #4143 from opensourcerouting/update-libyang-build-intr
Quentin Young [Tue, 16 Apr 2019 15:58:51 +0000 (11:58 -0400)]
Merge pull request #4143 from opensourcerouting/update-libyang-build-intr

doc: update libyang build instructions to enable compiler optimizations

5 years agoMerge pull request #4031 from nitinsoniism/show_evpn_route_vni_all_detail
Russ White [Tue, 16 Apr 2019 15:42:25 +0000 (11:42 -0400)]
Merge pull request #4031 from nitinsoniism/show_evpn_route_vni_all_detail

bgpd: new show cmd  - bgp l2vpn evpn route vni all detail

5 years agodoc: document bgp listen ranges and md5 behavior
Quentin Young [Tue, 16 Apr 2019 15:19:10 +0000 (15:19 +0000)]
doc: document bgp listen ranges and md5 behavior

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: add support for MD5 auth on listen ranges
Quentin Young [Fri, 29 Mar 2019 23:24:08 +0000 (19:24 -0400)]
bgpd: add support for MD5 auth on listen ranges

Co-authored-by: Donald Sharp <sharpd@cumulusnetworks.com>
Co-authored-by: Quentin Young <qlyoung@cumulusnetworks.com>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agolib: add support for extended TCP MD5 auth
Quentin Young [Mon, 1 Apr 2019 18:16:54 +0000 (18:16 +0000)]
lib: add support for extended TCP MD5 auth

MD5 auth on TCP is supported for prefixes in recent versions of Linux;
add complementary support for FRR.

This is a reworked version of Donald's commit to keep library
compatibility and obviate the need for changes in daemons that don't
need to support this themselves.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #3720 from donaldsharp/bgp_vrf_peering
Renato Westphal [Tue, 16 Apr 2019 15:25:26 +0000 (12:25 -0300)]
Merge pull request #3720 from donaldsharp/bgp_vrf_peering

lib: Allow bgp to always create a listen socket for the vrf

5 years agoMerge pull request #3762 from pguibert6WIND/do_not_alloc_lists_fs_by_def
Lou Berger [Tue, 16 Apr 2019 15:24:48 +0000 (11:24 -0400)]
Merge pull request #3762 from pguibert6WIND/do_not_alloc_lists_fs_by_def

bgpd: do not allocate lists on fs entries of bgp entries.

5 years agoMerge pull request #4096 from donaldsharp/pim_nht_cleanup
Russ White [Tue, 16 Apr 2019 14:27:35 +0000 (10:27 -0400)]
Merge pull request #4096 from donaldsharp/pim_nht_cleanup

Pim nht cleanup

5 years agoMerge pull request #4094 from mjstapp/dplane_system_routes
Russ White [Tue, 16 Apr 2019 14:22:26 +0000 (10:22 -0400)]
Merge pull request #4094 from mjstapp/dplane_system_routes

zebra: dataplane notifications for system route changes

5 years agoMerge pull request #4029 from ak503/isis_yang
Russ White [Tue, 16 Apr 2019 14:09:57 +0000 (10:09 -0400)]
Merge pull request #4029 from ak503/isis_yang

isis: priority of isis commands in interface configuration

5 years agodoc: update libyang build instructions to enable compiler optimizations
Renato Westphal [Tue, 16 Apr 2019 12:52:20 +0000 (09:52 -0300)]
doc: update libyang build instructions to enable compiler optimizations

libyang defaults CMAKE_BUILD_TYPE to "Debug", which disables compiler
optimizations. We should instruct our users to build libyang in the
"Release" mode so that compiler optimizations are enabled and they
can benefit from the associated performance improvements.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agofabricd: allow redistribute statements with both the route-map and metric options
Dmitrii Turlupov [Mon, 1 Apr 2019 13:55:38 +0000 (16:55 +0300)]
fabricd: allow redistribute statements with both the route-map and metric options

Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
5 years agoisisd: allow redistribute statements with both the route-map and metric options
Dmitrii Turlupov [Fri, 29 Mar 2019 11:17:41 +0000 (14:17 +0300)]
isisd: allow redistribute statements with both the route-map and metric options

Fixes #4012.

Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
5 years agoyang: priority of isis commands in interface configuration
Dmitrii Turlupov [Wed, 27 Mar 2019 12:27:36 +0000 (15:27 +0300)]
yang: priority of isis commands in interface configuration

Move down the "circuit-type" leaf in the isisd YANG module so that
"ip[v6] router isis" will be the first commands displayed in the
running configuration.

Fixes #4028.

Signed-off-by: Dmitrii Turlupov <dturlupov@factor-ts.ru>
5 years agoMerge pull request #4139 from qlyoung/doc-add-libyang-denablecache-fix
Renato Westphal [Mon, 15 Apr 2019 19:33:26 +0000 (16:33 -0300)]
Merge pull request #4139 from qlyoung/doc-add-libyang-denablecache-fix

doc: document libyang cache bug workaround

5 years agodoc: document libyang cache bug workaround
Quentin Young [Mon, 15 Apr 2019 19:29:10 +0000 (19:29 +0000)]
doc: document libyang cache bug workaround

Document workaround for
https://github.com/CESNET/libyang/issues/752

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agolib: add fine-grained debugging in the northbound
Renato Westphal [Fri, 12 Apr 2019 21:00:26 +0000 (18:00 -0300)]
lib: add fine-grained debugging in the northbound

Split the "debug northbound" command into the following commands:
* debug northbound callbacks configuration
* debug northbound callbacks state
* debug northbound callbacks rpc
* debug northbound notifications
* debug northbound events
* debug northbound client confd
* debug northbound client sysrepo

If "debug northbound" is entered alone, all of its suboptions
are enabled.

This commit also adds code to debug state/rpc callbacks and
notifications (only configuration callbacks were logged before).

Use the debugging infrastructure from "lib/debug.h" in order to
benefit from its facilities (e.g. MT-safe debugging) and avoid
code duplication.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: fix inverted logic in the "debug all" command
Renato Westphal [Fri, 12 Apr 2019 21:00:05 +0000 (18:00 -0300)]
lib: fix inverted logic in the "debug all" command

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #4130 from donaldsharp/show_frr
Philippe Guibert [Sun, 14 Apr 2019 20:20:12 +0000 (22:20 +0200)]
Merge pull request #4130 from donaldsharp/show_frr

zebra: Add hidden 'show frr' command

5 years agozebra: Add hidden 'show frr' command
Donald Sharp [Fri, 12 Apr 2019 14:25:11 +0000 (10:25 -0400)]
zebra: Add hidden 'show frr' command

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4081 from donaldsharp/rnh_reorder
Russ White [Thu, 11 Apr 2019 22:02:20 +0000 (18:02 -0400)]
Merge pull request #4081 from donaldsharp/rnh_reorder

zebra: Make rnh only send response once on first registration

5 years agoMerge pull request #4103 from qlyoung/fix-ospf-+metric
Russ White [Thu, 11 Apr 2019 21:45:41 +0000 (17:45 -0400)]
Merge pull request #4103 from qlyoung/fix-ospf-+metric

ospfd: fix behavior of +/-metric

5 years agoMerge pull request #4105 from donaldsharp/pim_cleanups
Russ White [Thu, 11 Apr 2019 21:44:50 +0000 (17:44 -0400)]
Merge pull request #4105 from donaldsharp/pim_cleanups

Pim cleanups

5 years agoMerge pull request #4111 from sworleys/Netlink-Rule-SA-Fix
Russ White [Thu, 11 Apr 2019 21:39:48 +0000 (17:39 -0400)]
Merge pull request #4111 from sworleys/Netlink-Rule-SA-Fix

zebra: Fix late memset of pbr rule in rule_netlink

5 years agoMerge pull request #4125 from mjstapp/fix_debug_pim_static
Quentin Young [Thu, 11 Apr 2019 20:14:30 +0000 (16:14 -0400)]
Merge pull request #4125 from mjstapp/fix_debug_pim_static

pimd: use debug pim static

5 years agopimd: use debug pim static
Mark Stapp [Thu, 11 Apr 2019 15:46:40 +0000 (11:46 -0400)]
pimd: use debug pim static

Replace cli 'debug static' with 'debug pim static', to make
the 'debug static' node available for staticd (eventually).

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #4119 from pacovn/201904_master__pw_fixes
Donald Sharp [Thu, 11 Apr 2019 12:20:02 +0000 (08:20 -0400)]
Merge pull request #4119 from pacovn/201904_master__pw_fixes

zebra: pseudowire event recovery (DoS fix)

5 years agobgpd: new show cmd - bgp l2vpn evpn route detail
Nitin Soni [Wed, 10 Apr 2019 06:13:51 +0000 (23:13 -0700)]
bgpd: new show cmd - bgp l2vpn evpn route detail

This command is added to provide detailed information. It will be
useful in troubleshooting as we will be able to dump all detailed info
using a single command.
"show bgp l2vpn evpn route [detail] ...". Additional filtering
can be done by providing type of the route.

Command will display the detailed content for all rd and macs-ip as
displayed by "show bgp l2vpn evpn route rd <> mac <>" for a single
rd, mac, ip from the global bgp routing table.

Ticket: CM-24397
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by:
Testing-Done:

5 years agozebra: dataplane notifications for system route changes
Mark Stapp [Thu, 21 Mar 2019 18:26:54 +0000 (14:26 -0400)]
zebra: dataplane notifications for system route changes

Add notifications from zebra to the dataplane subsystem when
kernel or connected routes change.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: pseudowire event recovery (DoS fix)
F. Aragon [Wed, 10 Apr 2019 17:08:50 +0000 (19:08 +0200)]
zebra: pseudowire event recovery (DoS fix)

When having a route recovery, because of the route installation
cycling and the next hop label check, it could happen that the PW
never gets recovered. The original code shows the intention of retrying,
but the code was missing. The fix includes the call to the timer programming
the recovery attempt.

Example for reproducing the issue:

      |P1|  <->  |P2|  <->  |P3|

- Being P1, P2, P3 nodes, using IS-IS as IGP, and having a pseudowire
betwen P1 and P3 (P1, P2, P3 having configured LDP daemons).
- After 60 seconds, kill the IS-IS daemon in P2.
- Wait 30 seconds
- Launch again the IS-IS daemon in P2
- The bug/issue is that after P1 <-> P3 recovering connectivity sometimes
  the PW is not recovered because the reason explained in the first paragraph.

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agoMerge pull request #4115 from Wojtek242/wojtek242/doc-overview-fix
Donald Sharp [Wed, 10 Apr 2019 02:29:06 +0000 (22:29 -0400)]
Merge pull request #4115 from Wojtek242/wojtek242/doc-overview-fix

doc: replace old text with info about integrated configuration mode

5 years agoMerge pull request #4114 from chiragshah6/evpn_dev2
Mark Stapp [Tue, 9 Apr 2019 20:46:59 +0000 (16:46 -0400)]
Merge pull request #4114 from chiragshah6/evpn_dev2

zebra: avoid removing node twice from rb_tree

5 years agodoc: replace old text with info about integrated configuration mode
Wojciech Kozlowski [Tue, 9 Apr 2019 20:38:35 +0000 (22:38 +0200)]
doc: replace old text with info about integrated configuration mode

Signed-off-by: W. Kozlowski <wk@wojciechkozlowski.eu>
5 years agozebra: avoid removing node twice from rb_tree
Chirag Shah [Tue, 9 Apr 2019 19:30:15 +0000 (12:30 -0700)]
zebra: avoid removing node twice from rb_tree

In zebra terminate path, the node was attempted to remove
twice from the RB_TREE table. This lead to a crash during
zebra shutdown zebra_router_free_table already calls RB_REMOVE
to remove a node from rb tree table.

    siginfo=0x7fffd9134a30, context=<optimized out>) at lib/sigevent.c:249
     rbt=<optimized out>, t=<optimized out>) at lib/openbsd-tree.c:226
     t=0x56296965ff50 <zebra_router_table_head_RB_INFO>) at lib/openbsd-tree.c:383
    rbt=rbt@entry=0x562969669bd0 <zrouter+16>, elm=elm@entry=0x56296afcf810)
    at lib/openbsd-tree.c:393
    (elm=0x56296afcf810, head=0x562969669bd0 <zrouter+16>) at zebra/zebra_router.h:46

Singned-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agopimd: Add JoinDesired(S,G) to deciding to set spt bit
Donald Sharp [Tue, 9 Apr 2019 17:20:32 +0000 (13:20 -0400)]
pimd: Add JoinDesired(S,G) to deciding to set spt bit

The decision for Update_SPTbit(S,G, iif) includes a test
for JoinDesired(S,G) in section 4.2.2.  When we were deciding
to update the spt bit we were not taking this into account.

This commit fixes this issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Update state when receiving S,G join when in S,G RPT Prune state
Donald Sharp [Mon, 8 Apr 2019 18:37:00 +0000 (14:37 -0400)]
pimd: Update state when receiving S,G join when in S,G RPT Prune state

When we receive a S,G join and the ifchannel is in S,G RPT Prune state,
pim should transition the ifchannel state to JOIN and transition the
pim_upstream state for the S,G stream.

Ticket: CM-24513
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Only send triggered response after all of *,G message is read
Donald Sharp [Mon, 8 Apr 2019 22:02:45 +0000 (18:02 -0400)]
pimd: Only send triggered response after all of *,G message is read

pim was sending a triggered response on every S,G RPT prune information
read.  Suppose we had this in a *,G message:

*,G
  S1, G RPT Prune
  S2, G RPT Prune

We would send two triggered *,G messages upstream.  This leads to over
processing and quickly changing state if S1 or S2 were in different
states.

Modify the code to send just one Triggered *,G upstream after looking
at all S,G state for a *,G.

Ticket: CM-24531
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: new show cmd - bgp l2vpn evpn route vni all detail
Nitin Soni [Thu, 28 Mar 2019 05:49:03 +0000 (22:49 -0700)]
bgpd: new show cmd  - bgp l2vpn evpn route vni all detail

This command is added to provide detailed information. It will be
useful in troubleshooting as we will be able to dump all detailed info
using a single command.
"net show bgp evpn route vni <all|id> [detail]". Additional filtering
can be done by providing vtep ip.

Command will display the detailed content for all vni and macs as
displayed by "net show bgp evpn route vni <> mac <> ip <>" for a single
vni, mac, ip.

Ticket: CM-24397
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by:
Testing-Done:

5 years agoMerge pull request #3779 from opensourcerouting/fix-mpls-label-topotests
Quentin Young [Tue, 9 Apr 2019 15:25:40 +0000 (11:25 -0400)]
Merge pull request #3779 from opensourcerouting/fix-mpls-label-topotests

tests: Remove some inconsistent local labels in check in test_ldp_vpls_topo1

5 years agoMerge pull request #4102 from opensourcerouting/sendbuf_recvbuf_privs
Quentin Young [Tue, 9 Apr 2019 14:59:00 +0000 (10:59 -0400)]
Merge pull request #4102 from opensourcerouting/sendbuf_recvbuf_privs

*: setting the socket send/recv buffer sizes doesn't need elevated privs

5 years agozebra: Fix late memset of pbr rule in rule_netlink
Stephen Worley [Tue, 9 Apr 2019 14:35:11 +0000 (10:35 -0400)]
zebra: Fix late memset of pbr rule in rule_netlink

We were memsetting zebra_pbr_rule struct after
we had already put some information in it. Also updated
the init of the struct to use braces instead of a
memset.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agoMerge pull request #4095 from pacovn/201904_master__lm_aliasing_fixes
Donald Sharp [Tue, 9 Apr 2019 12:38:02 +0000 (08:38 -0400)]
Merge pull request #4095 from pacovn/201904_master__lm_aliasing_fixes

zebra: label manager race condition fix

5 years agoMerge pull request #4099 from donaldsharp/clang_sa
Mark Stapp [Mon, 8 Apr 2019 17:43:16 +0000 (19:43 +0200)]
Merge pull request #4099 from donaldsharp/clang_sa

Clang sa fixes

5 years agoospfd: fix behavior of +/-metric
Quentin Young [Mon, 8 Apr 2019 17:05:45 +0000 (17:05 +0000)]
ospfd: fix behavior of +/-metric

OSPFD uses -1 as a sentinel value for uninitialized metrics. When
applying a route map with a +/-metric to redistributed routes, we were
using -1 as our base value to increment or decrement on, which meant
that if you set e.g. +10, you would end up with a redistributed route of
metric 9.

This patch also removes an off-by-one sanity check that would cause a
set metric +1 or set metric 0 to result in a metric value of 20 :-)

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years ago*: setting the socket send/recv buffer sizes doesn't need elevated privs
Renato Westphal [Mon, 8 Apr 2019 16:08:00 +0000 (13:08 -0300)]
*: setting the socket send/recv buffer sizes doesn't need elevated privs

The less code running under elevated privileges the better.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #4101 from pacovn/doc_typo1
Quentin Young [Mon, 8 Apr 2019 15:11:27 +0000 (11:11 -0400)]
Merge pull request #4101 from pacovn/doc_typo1

doc: fix typo

5 years agodoc: fix typo
F. Aragon [Mon, 8 Apr 2019 14:46:33 +0000 (16:46 +0200)]
doc: fix typo

Signed-off-by: F. Aragon <paco@voltanet.io>
5 years agobgpd: Remove extra alloc function bgp_path_info_new
Donald Sharp [Sun, 7 Apr 2019 00:08:34 +0000 (20:08 -0400)]
bgpd: Remove extra alloc function bgp_path_info_new

The bgp_path_info_new function whenever it was called
pretty much duplicated the info_make function call.  So
convert over to using it and remove the bgp_path_info_new
function so people are not tempted.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoospfd: rn may be null
Donald Sharp [Sat, 6 Apr 2019 23:56:06 +0000 (19:56 -0400)]
ospfd: rn may be null

rn is not set the first time through the do {} while (); loop
As such we need to protect against it from being null( although
highly unlikely to ever happen given the ospf code base.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: pi->peer assignment exists no need for null check
Donald Sharp [Sat, 6 Apr 2019 23:53:55 +0000 (19:53 -0400)]
bgpd: pi->peer assignment exists no need for null check

The creation of a new `struct bgp_path_info` requires a legitimate
peer being passed in for creation.  There exists no code paths
where this is not true.  As such checking pi->peer for null convinces
SA that it might happen.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Fixup IFF_OUT_LOG macro to make SA happy
Donald Sharp [Sat, 6 Apr 2019 22:38:54 +0000 (18:38 -0400)]
lib: Fixup IFF_OUT_LOG macro to make SA happy

The IFF_OUT_LOG macro is using BUFSIZE, which is the sizeof(logbuf)
but for some reason 8.0 clang SA is not happy with it.  Just
make it happy.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4066 from sworleys/Add-NG-Hash-Func
Mark Stapp [Fri, 5 Apr 2019 19:31:41 +0000 (21:31 +0200)]
Merge pull request #4066 from sworleys/Add-NG-Hash-Func

lib: Add hash function for nexthop groups

5 years agolib: Add hash function for nexthop groups
Stephen Worley [Tue, 2 Apr 2019 17:57:48 +0000 (13:57 -0400)]
lib: Add hash function for nexthop groups

Add a hash function to turn a nexthop group into a
32 bit unsigned hash key with jhash. We do not care to
hash any recursively resolved nexthops, just the group.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agoMerge pull request #4085 from donaldsharp/zebra_nht_individual_items
Renato Westphal [Fri, 5 Apr 2019 17:38:12 +0000 (14:38 -0300)]
Merge pull request #4085 from donaldsharp/zebra_nht_individual_items

zebra: Allow specification of v[4|6] addrs on some commands

5 years agozebra: Allow specification of v[4|6] addrs on some commands
Donald Sharp [Thu, 4 Apr 2019 18:28:31 +0000 (14:28 -0400)]
zebra: Allow specification of v[4|6] addrs on some commands

The `show ipv[4|6] <nht|import-check> ...` commands are starting
to produce a bunch of output due to multiple daemons now
using the code.  Allow the specification of a v4 or v6 address
to allow the show command to only display the interesting nht.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Initiate *,G S,G RPT Prune in some cases
Donald Sharp [Fri, 5 Apr 2019 12:40:51 +0000 (08:40 -0400)]
pimd: Initiate *,G S,G RPT Prune in some cases

On the LHR after we decide that traffic is flowing and
we set the SPT bit for the S,G *and* the incoming IIF
of the S,G is different than the incoming IIF of the *,G
we should immediately send the *,G S,G RPT Prune as
a triggered response instead of waiting for the next
cycle.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Add a flag PIM_NEXTHOP_ANSWER_RECEIVED
Donald Sharp [Wed, 3 Apr 2019 15:21:37 +0000 (11:21 -0400)]
pimd: Add a flag PIM_NEXTHOP_ANSWER_RECEIVED

Track whether or not we have received an answer from
our query to do nexthop tracking.  This allows us to
go straight to doing a synchronous query for our
RPF.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Tracking of RPF is *separate* from the lookup
Donald Sharp [Tue, 2 Apr 2019 13:40:41 +0000 (09:40 -0400)]
pimd: Tracking of RPF is *separate* from the lookup

Start the separation of tracking a Destination from the act
of looking it up.  The cojoining of these two concepts led
to a bunch of code that had to think about both problems leading
to weird situations and code paths.  Simplify the code by making
pim_ecmp_nexthop_search a static function and we only ever
call pim_ecmp_nexthop_lookup when we need to do a RPF().

pim_ecmp_nexthop_lookup will now attempt to find a stored pnc
and if it finds one it will report on the answer from it.

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