]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agoMerge pull request #6934 from Niral-Networks/niral_dev_vrf_isis_core_pr4
Renato Westphal [Fri, 4 Sep 2020 21:44:56 +0000 (18:44 -0300)]
Merge pull request #6934 from Niral-Networks/niral_dev_vrf_isis_core_pr4

isisd, yang, doc : Support for different VRF in ISIS.

3 years agoMerge pull request #6971 from volta-networks/fix_ldp_no_config
Renato Westphal [Fri, 4 Sep 2020 19:39:16 +0000 (16:39 -0300)]
Merge pull request #6971 from volta-networks/fix_ldp_no_config

ldpd: Fix issue when starting up LDP with no configuration.

3 years agoMerge pull request #6589 from NaveenThanikachalam/gr_fixes
Donatas Abraitis [Fri, 4 Sep 2020 15:39:26 +0000 (18:39 +0300)]
Merge pull request #6589 from NaveenThanikachalam/gr_fixes

bgpd: GR fixes

3 years agoldpd: Fix issue when starting up LDP with no configuration.
lynne [Wed, 12 Aug 2020 23:15:24 +0000 (19:15 -0400)]
ldpd: Fix issue when starting up LDP with no configuration.

LDP would mark all routes as learned on a non-ldp interface.  Then
when LDP was configured the labels were not updated correctly.  This
commit fixes issues 6841 and 6842.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
3 years agoMerge pull request #6826 from pjdruddy/bgp-auth-vrf-frr
Donatas Abraitis [Fri, 4 Sep 2020 13:03:47 +0000 (16:03 +0300)]
Merge pull request #6826 from pjdruddy/bgp-auth-vrf-frr

Bgp auth vrf frr

3 years agoMerge pull request #7053 from mjstapp/fix_ospf6_intf_sa
Donald Sharp [Fri, 4 Sep 2020 10:47:07 +0000 (06:47 -0400)]
Merge pull request #7053 from mjstapp/fix_ospf6_intf_sa

ospf6d: fix SA warning

3 years agoMerge pull request #7052 from mjstapp/fix_stream_get_data
Donald Sharp [Fri, 4 Sep 2020 00:45:05 +0000 (20:45 -0400)]
Merge pull request #7052 from mjstapp/fix_stream_get_data

lib: remove unused stream_get_data api

3 years agoMerge pull request #6891 from opensourcerouting/feature/sr-te-bgpd
Donald Sharp [Thu, 3 Sep 2020 18:52:30 +0000 (14:52 -0400)]
Merge pull request #6891 from opensourcerouting/feature/sr-te-bgpd

bgpd: Add support for SR-TE Policies in route-maps

3 years agoMerge pull request #6926 from kuldeepkash/dynamic_route_leak
Martin Winter [Thu, 3 Sep 2020 17:03:22 +0000 (19:03 +0200)]
Merge pull request #6926 from kuldeepkash/dynamic_route_leak

tests: Add bgp_vrf_dynamic_route_leak test suite

3 years agoospf6d: fix SA warning
Mark Stapp [Thu, 3 Sep 2020 16:57:36 +0000 (12:57 -0400)]
ospf6d: fix SA warning

Fix an SA issue in ospf6_interface.c.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agolib: remove unused stream_get_data api
Mark Stapp [Thu, 3 Sep 2020 16:37:55 +0000 (12:37 -0400)]
lib: remove unused stream_get_data api

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #7043 from donaldsharp/bgp_features_speedup
Mark Stapp [Thu, 3 Sep 2020 12:14:46 +0000 (08:14 -0400)]
Merge pull request #7043 from donaldsharp/bgp_features_speedup

tests: Speed up bgp_features topotests by a lot

3 years agoMerge pull request #6987 from Niral-Networks/acl_fix
Santosh P K [Thu, 3 Sep 2020 04:21:21 +0000 (09:51 +0530)]
Merge pull request #6987 from Niral-Networks/acl_fix

lib, ospf : Fix when redist is performed with route-map using access-list

3 years agotests: Speed up bgp_features topotests by a lot
Donald Sharp [Wed, 2 Sep 2020 19:42:01 +0000 (15:42 -0400)]
tests: Speed up bgp_features topotests by a lot

Initial run of topotests on my machine takes ~210 seconds
With these changes we are at ~40 seconds

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agoMerge pull request #6997 from opensourcerouting/cisco-acl-name
Donald Sharp [Wed, 2 Sep 2020 12:26:57 +0000 (08:26 -0400)]
Merge pull request #6997 from opensourcerouting/cisco-acl-name

lib,yang: allow cisco access lists to use names plus fixes

3 years agoMerge pull request #7027 from Niral-Networks/niral_dev_vrf_ospf6
Donald Sharp [Wed, 2 Sep 2020 12:25:09 +0000 (08:25 -0400)]
Merge pull request #7027 from Niral-Networks/niral_dev_vrf_ospf6

ospf6d : Preparing for ospf6d VRF support.

3 years agoMerge pull request #7033 from mjstapp/fix_pbr_nhg_sa
Donald Sharp [Wed, 2 Sep 2020 12:20:21 +0000 (08:20 -0400)]
Merge pull request #7033 from mjstapp/fix_pbr_nhg_sa

pbrd: fix SA warnings in nhg map

3 years agoospfd : Fix in lsa refresh when redist is done with route-map using access-list.
Kaushik [Mon, 31 Aug 2020 11:32:30 +0000 (04:32 -0700)]
ospfd : Fix in lsa refresh when redist is done with route-map using access-list.

1. Minor change in distribute-list update timer based on lsa flag.

Co-authored-by: harios <hari@niralnetworks.com>
Signed-off-by: Kaushik <kaushik@niralnetworks.com>
3 years agoMerge pull request #7010 from wesleycoakley/pbrd-more-selective
Mark Stapp [Tue, 1 Sep 2020 18:54:18 +0000 (14:54 -0400)]
Merge pull request #7010 from wesleycoakley/pbrd-more-selective

pbrd: be more selective about route updates

3 years agopbrd: fix SA warning in nhg map
Mark Stapp [Tue, 1 Sep 2020 18:23:40 +0000 (14:23 -0400)]
pbrd: fix SA warning in nhg map

Fix SA warnings in nhg map functions.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agopbrd: nh "valid" semantics in nexthop tracking
Wesley Coakley [Tue, 1 Sep 2020 16:34:48 +0000 (12:34 -0400)]
pbrd: nh "valid" semantics in nexthop tracking

Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
3 years agotests: Add bgp_vrf_dynamic_route_leak test suite
Kuldeep Kashyap [Mon, 17 Aug 2020 04:41:51 +0000 (04:41 +0000)]
tests: Add bgp_vrf_dynamic_route_leak test suite

1. Added test to verify bgp vrf dynamic route leak functionality
2. Total execution time is ~8 mins
3. Added kernel version check, these script would be run for kernel version >= 4.19

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
3 years agotests: Add f/w support for bgp_vrf_dynamic_route_leak tests automation
Kuldeep Kashyap [Mon, 17 Aug 2020 03:57:55 +0000 (03:57 +0000)]
tests: Add f/w support for bgp_vrf_dynamic_route_leak tests automation

1. Adding f/w support for bgp_vrf_dynamic_route_leak tests automation

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
3 years agopbrd: be more selective about route updates
Wesley Coakley [Thu, 27 Aug 2020 14:04:52 +0000 (10:04 -0400)]
pbrd: be more selective about route updates

Given a received nexthop update, only send down an update to the
relevant nexthop group. Avoid sending down superfluous updates

Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
3 years agoMerge pull request #7003 from GalaxyGorilla/ospf_ti_lfa_prep
Olivier Dugeon [Tue, 1 Sep 2020 14:39:29 +0000 (16:39 +0200)]
Merge pull request #7003 from GalaxyGorilla/ospf_ti_lfa_prep

ospfd: use a new vertex list for every SPF run

3 years agoMerge pull request #7016 from donaldsharp/pbr_vrf_is_burf
Russ White [Tue, 1 Sep 2020 14:31:20 +0000 (10:31 -0400)]
Merge pull request #7016 from donaldsharp/pbr_vrf_is_burf

Pbr vrf is burf

3 years agoMerge pull request #7023 from donaldsharp/eigrp_fixups
Russ White [Tue, 1 Sep 2020 14:20:32 +0000 (10:20 -0400)]
Merge pull request #7023 from donaldsharp/eigrp_fixups

Eigrp fixups

3 years agoMerge pull request #7028 from xThaid/netlink_buff
Mark Stapp [Tue, 1 Sep 2020 12:43:13 +0000 (08:43 -0400)]
Merge pull request #7028 from xThaid/netlink_buff

zebra: increase netlink receive buffer size

3 years agoospf6d : Preparing for ospf6d VRF support.
Kaushik [Tue, 1 Sep 2020 08:31:49 +0000 (01:31 -0700)]
ospf6d : Preparing for ospf6d VRF support.

1. Removed the VRF_DEFAULT dependency from ospf6d.
2. The dependency on show command still exist
   will be fixed when the ospf6 master is available.

Co-authored-by: Harios <hari@niralnetworks.com>
Signed-off-by: Kaushik <kaushik@niralnetworks.com>
3 years agozebra: increase netlink receive buffer size
Jakub Urbańczyk [Tue, 1 Sep 2020 09:35:16 +0000 (11:35 +0200)]
zebra: increase netlink receive buffer size

Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
3 years agotests: topotest for bgp authentication
Pat Ruddy [Thu, 6 Aug 2020 08:37:23 +0000 (09:37 +0100)]
tests: topotest for bgp authentication

18 tests which cover
authenticated passord session extablishment
password removal
wrong password
over default, default prefix-based, vrf, vrf prefix-based, multi-vrf and
multi-vrf prefix-based configurations

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agobgpd: do not clear password if peer is dynamic
Pat Ruddy [Mon, 20 Jul 2020 12:54:04 +0000 (13:54 +0100)]
bgpd: do not clear password if peer is dynamic

When deleting a dynamic peer, unsetting md5 password would cause
it to be unset on the listener allowing unauthenticated connections
from any peer in the range.
Check for dynamic peers in peer delete and avoid this.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agobgpd: associate listener with the appropriate bgp instance
Pat Ruddy [Tue, 21 Jul 2020 14:03:41 +0000 (15:03 +0100)]
bgpd: associate listener with  the appropriate bgp instance

When setting authentication on a BGP peer in a VRF the listener is
looked up from a global list. However there is no check that the
listener is the one associated with the VRF being configured. This
can result in the wrong listener beiong configured with a password,
leaving the intended listener in an open authentication state.
To simplify this lookup stash a pointer to the bgp instance in
the listener on creating (in the same way as is done for NS-based
VRFS).

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agotopotests : Topotest for different VRF in isisd
harios_niral [Tue, 1 Sep 2020 07:56:44 +0000 (00:56 -0700)]
topotests : Topotest for different VRF in isisd

1. Topotest for isis-vrf is added for ipv4 and ipv6.
2. Test case for checking isis topology.
3. Test case for checking zebra isis routes.
4. Test case for checking linux vrf routes.
5. 2 new API's written in topotest/lib for checking vrf routes.

Co-authored-by: Kaushik <kaushik@niralnetworks.com>"
Signed-off-by: harios_niral <hari@niralnetworks.com>
3 years agodoc, yang, isisd : Support for different VRF in isisd
harios_niral [Tue, 18 Aug 2020 07:26:51 +0000 (00:26 -0700)]
doc, yang, isisd : Support for different VRF in isisd

1. Added isis with different vrf and it's dependecies.
2. Added new vrf leaf in yang.
3. A minor change for IF_DOWN_FROM_Z passing argrument is
   replaced with ifp pointer in api "isis_if_delete_hook()".
4. Minor fix in the isisd spf unit test.

Co-authored-by: Kaushik <kaushik@niralnetworks.com>"
Signed-off-by: harios_niral <hari@niralnetworks.com>
3 years agoeigrpd: make `show ip eigrp vrf all neighbor` work correctly
Donald Sharp [Sat, 29 Aug 2020 17:14:10 +0000 (13:14 -0400)]
eigrpd: make `show ip eigrp vrf all neighbor` work correctly

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agoeigrpd: Make `show ip eigrp vrf all interfaces` work correctly
Donald Sharp [Sat, 29 Aug 2020 17:04:46 +0000 (13:04 -0400)]
eigrpd: Make `show ip eigrp vrf all interfaces` work correctly

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agoMerge pull request #7025 from opensourcerouting/silence-cli-warning
Quentin Young [Mon, 31 Aug 2020 18:03:25 +0000 (14:03 -0400)]
Merge pull request #7025 from opensourcerouting/silence-cli-warning

lib: silence overly verbose CLI warning

3 years agolib: silence overly verbose CLI warning
Renato Westphal [Mon, 31 Aug 2020 14:58:24 +0000 (11:58 -0300)]
lib: silence overly verbose CLI warning

When not using the transactional CLI mode, do not display a
warning when a YANG-modeled commmand doesn't perform any effective
configuration change.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoeigrpd: Fix `show ip eigrp vrf all topology` to actually work
Donald Sharp [Sat, 29 Aug 2020 16:57:28 +0000 (12:57 -0400)]
eigrpd: Fix `show ip eigrp vrf all topology` to actually work

Fix multiple forms of this command to behave appropriately
when `vrf all` is specified.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agolib : Fix when redist is performed with route-map using access-list.
Kaushik [Tue, 25 Aug 2020 14:27:43 +0000 (07:27 -0700)]
lib : Fix when redist is performed with route-map using access-list.

1. Added new API for add/delete acl with route map notify.

Co-authored-by: harios <hari@niralnetworks.com>
Signed-off-by: Kaushik <kaushik@niralnetworks.com>
3 years agobgpd: do not unregister for prefix nexthop updates if nh exists
Pat Ruddy [Fri, 26 Jun 2020 16:37:30 +0000 (17:37 +0100)]
bgpd: do not unregister for prefix nexthop updates if nh exists

since the addition of srte_color to the comparison for bgp nexthops
it is possible to have several nexthops per prefix but since zebra
only sores a per prefix registration we should not unregister for
nh notifications for a prefix unti all the nexthops for that prefix
have been deleted. Otherwise we can get into a deadlock situation
where BGP thinks we have registered but we have unregistered from zebra.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agobgpd: extend the NHT code to understand SR-TE colors
Renato Westphal [Wed, 26 Aug 2020 17:39:33 +0000 (14:39 -0300)]
bgpd: extend the NHT code to understand SR-TE colors

Extend the NHT code so that only the affected BGP routes are affected
whenever an SR-policy is updated on zebra.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agobgpd: Add support for SR-TE Policies in route-maps
Sebastien Merle [Tue, 28 Jan 2020 11:59:57 +0000 (11:59 +0000)]
bgpd: Add support for SR-TE Policies in route-maps

Example configuration:
    route-map SET_SR_POLICY permit 10
     set sr-te color 1
     !
    router bgp 1
     bgp router-id 1.1.1.1
     neighbor 2.2.2.2 remote-as 1
     neighbor 2.2.2.2 update-source lo
     address-family ipv4 unicast
      neighbor 2.2.2.2 next-hop-self
      neighbor 2.2.2.2 route-map SET_SR_POLICY in
     exit-address-family
     !
    !
Learned BGP routes from 2.2.2.2 are mapped to the SR-TE Policy
which is uniquely determined by the BGP nexthop (2.2.2.2 in this
case) and the SR-TE color in the route-map.

Co-authored-by: Renato Westphal <renato@opensourcerouting.org>
Co-authored-by: GalaxyGorilla <sascha@netdef.org>
Co-authored-by: Sebastien Merle <sebastien@netdef.org>
Signed-off-by: Sebastien Merle <sebastien@netdef.org>
3 years agobgpd: convert NHT code to use rb-trees instead of routing tables
Renato Westphal [Thu, 9 Apr 2020 18:56:11 +0000 (15:56 -0300)]
bgpd: convert NHT code to use rb-trees instead of routing tables

Fist, routing tables aren't the most appropriate data structure
to store nexthops and imported routes since we don't need to do
longest prefix matches with that information.

Second, by converting the NHT code to use rb-trees, we can index
the nexthops using additional information, not only the destination
address.  This will be useful later to index bgpd's nexthops by
both destination and SR-TE color.

Co-authored-by: Sebastien Merle <sebastien@netdef.org>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoMerge pull request #6925 from kuldeepkash/bgp_basic_functionality
Rafael Zalamena [Sun, 30 Aug 2020 10:40:28 +0000 (07:40 -0300)]
Merge pull request #6925 from kuldeepkash/bgp_basic_functionality

tests: Add new tests to bgp-basic-functionality-topo1

3 years agoMerge pull request #7020 from AnuradhaKaruppiah/evpn-rem-mac-fix
Rafael Zalamena [Sun, 30 Aug 2020 10:19:23 +0000 (07:19 -0300)]
Merge pull request #7020 from AnuradhaKaruppiah/evpn-rem-mac-fix

zebra: fix misc problems with EVPN-MH ES management

3 years agoMerge pull request #7019 from mjstapp/fix_topo_stringio
Donatas Abraitis [Sun, 30 Aug 2020 07:55:00 +0000 (10:55 +0300)]
Merge pull request #7019 from mjstapp/fix_topo_stringio

tests: small topotest improvements for python3

3 years agoeigrpd: Cleanup eigrp interface display to respect 16 characters
Donald Sharp [Sat, 29 Aug 2020 00:14:42 +0000 (20:14 -0400)]
eigrpd: Cleanup eigrp interface display to respect 16 characters

Interface length is 16 characters add some spaces to make everything
line up right.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agozebra: fix misc problems with ES management
Anuradha Karuppiah [Wed, 8 Apr 2020 15:10:13 +0000 (08:10 -0700)]
zebra: fix misc problems with ES management

1. MAC ref of a zero ESI was accidentally creating a new ES with zero
ES id.
2. When an ES was deleted and re-added the ES was not being sent to BGP
because of a stale flag that suppressed the update as a dup.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agoMerge pull request #7015 from donaldsharp/zebra_nht_no_heros_tonight
Mark Stapp [Fri, 28 Aug 2020 21:08:32 +0000 (17:08 -0400)]
Merge pull request #7015 from donaldsharp/zebra_nht_no_heros_tonight

zebra: When shutting down an interface immediately notify about rnh

3 years agozebra: When we get a rib deletion event be smarter
Donald Sharp [Thu, 27 Aug 2020 19:42:16 +0000 (15:42 -0400)]
zebra: When we get a rib deletion event be smarter

When we get a rib deletion event and we already have
that particular route node in the queue to be reprocessed,
just note that someone from kernel land has done us dirty
and allow it to be cleaned up by normal processing

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agozebra: When shutting down an interface immediately notify about rnh
Donald Sharp [Thu, 27 Aug 2020 19:00:55 +0000 (15:00 -0400)]
zebra: When shutting down an interface immediately notify about rnh

Imagine a situation where a interface is bouncing up/down.
The interface comes up and daemons like pbr will get a nht
tracking callback for a connected interface up and will install
the routes down to zebra.  At this same time the interface can
go down.  But since zebra is busy handling route changes ( from pbr )
it has not read the netlink message and can get into a situation
where the route resolves properly and then we attempt to install
it into the kernel( which is rejected ).  If the interface
bounces back up fast at this point, the down then up netlink
message will be read and create two route entries off the connected
route node.  Zebra will then enqueue both route entries for future processing.

After this processing happens the down/up is collapsed into an up
and nexthop tracking sees no changes and does not inform any upper
level protocol( in this case pbr ) that nexthop tracking has changed.
So pbr still believes the nexthops are good but the routes are not
installed since pbr has taken no action.

Fix this by immediately running rnh when we signal a connected
route entry is scheduled for removal.  This should cause
upper level protocols to get a rnh notification for the small
amount of time that the connected route was bouncing around like
a madman.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agotests: small topotest improvements for python3
Mark Stapp [Fri, 28 Aug 2020 12:38:34 +0000 (08:38 -0400)]
tests: small topotest improvements for python3

Avoid unnecessary use of StringIO in one place, use version-
dependent method in another. Remove a couple of other py2->py3
problems.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agotests: Add new tests to bgp-basic-functionality-topo1
Kuldeep Kashyap [Mon, 17 Aug 2020 02:13:04 +0000 (02:13 +0000)]
tests: Add new tests to bgp-basic-functionality-topo1

1. Added new tests to bgp-basic-functionality-topo1
3. Execution time increased by 55 sec

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
3 years agoMerge pull request #7017 from xThaid/netlink_fix
Mark Stapp [Fri, 28 Aug 2020 12:20:28 +0000 (08:20 -0400)]
Merge pull request #7017 from xThaid/netlink_fix

zebra: fix netlink batching

3 years agopbrd: Convert pnhc->nexthop to it's own data
Donald Sharp [Mon, 24 Aug 2020 19:25:34 +0000 (15:25 -0400)]
pbrd: Convert pnhc->nexthop to it's own data

The pnhc->nexthop was a pointer copy.  Causing issues
with the ability to move pointers around for the
different pnhc since the pnhc mirrored the nexthop
caches.  When we received a vrf change if we shared
pointers it was impossible to know if we had
already updated the code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agopbrd: When multiple items share the pnhc do the right thing
Donald Sharp [Mon, 24 Aug 2020 19:14:44 +0000 (15:14 -0400)]
pbrd: When multiple items share the pnhc do the right thing

We had multiple pnhc cache entries with the same nexthop
pointer.  This causes some large amount of confusion.
Fixup the code to handle this situation better.

Ticket: CM-31044
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agolib: Note old ifindex on shutdown
Donald Sharp [Thu, 20 Aug 2020 18:42:56 +0000 (14:42 -0400)]
lib: Note old ifindex on shutdown

If we have an interface configured in a daemon on shutdown
store the old ifindex value for retrieval on when it is
possibly recreated.

This is especially important for nexthop groups as that we
had at one point in time the ability to restore the
configuration but it was lost when we started deleting
all deleted interfaces.  We need the nexthop group subsystem
to also mark that it has configured an interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agopbrd: Allow interfaces to be deleted then added back in
Donald Sharp [Thu, 20 Aug 2020 16:55:45 +0000 (12:55 -0400)]
pbrd: Allow interfaces to be deleted then added back in

PBR needs the ability to allow ephermeal interfaces( bonds,
vrfs, dummy, bridges, etc ) to be destroyed and then
recreated and at the same time keep track of them and
rebuild state as appropriate when we get a change.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agolib: Allow nexthop simple display to take an alternate ifp name
Donald Sharp [Thu, 20 Aug 2020 15:56:05 +0000 (11:56 -0400)]
lib: Allow nexthop simple display to take an alternate ifp name

The nexthop_group_write_nexthop_simple function outputs the
interface name, because we've stored the ifindex.  The problem
is that there are ephermeal interfaces in linux that can be
destroyed/recreated.  Allow us to keep that data and do something
a bit smarter to allow show run's and other show commands to continue
to work when the interface is deleted.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agopbrd: Properly hook back up when vrf is destroyed than recreated
Donald Sharp [Thu, 20 Aug 2020 14:34:38 +0000 (10:34 -0400)]
pbrd: Properly hook back up when vrf is destroyed than recreated

Currently when a vrf is deleted than added back in PBR was
not going through and touching up all the data structures
that needed to be massaged to allow it to start working again.

This includes:

a) Search through the nexthop groups to find any nexthop
that references the old nexthop id and set it right again.

b) Search through the nexthop cache for nht and reset
those nexthops to the right vrf as well as re-register

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agoMerge pull request #7014 from pjanikx/nlpids
Donald Sharp [Thu, 27 Aug 2020 23:00:53 +0000 (19:00 -0400)]
Merge pull request #7014 from pjanikx/nlpids

isisd:  Remove IPV4 from NLPID's if not enabled

3 years agoMerge pull request #6989 from xThaid/remove_fuzzing
Quentin Young [Thu, 27 Aug 2020 21:33:43 +0000 (17:33 -0400)]
Merge pull request #6989 from xThaid/remove_fuzzing

zebra: remove fuzzing stuff

3 years agolib: break up show nexthop API a bit for reuse
Stephen Worley [Tue, 18 Aug 2020 20:53:44 +0000 (16:53 -0400)]
lib: break up show nexthop API a bit for reuse

Not everything cares about the vrf and backup info. Break
up the API to add a simple version to just write gateway/interface
info.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
3 years agozebra: fix netlink batching
Jakub Urbańczyk [Thu, 27 Aug 2020 19:41:37 +0000 (21:41 +0200)]
zebra: fix netlink batching

It was wrongly assumed that the kernel is replying in batches when multiple
requests fail. The kernel sends one error message at a time, so we can
simply keep reading data from the socket as long as possible.

Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
3 years agoisisd: Remove IPV4 from NLPID's if not enabled
Przemyslaw [Wed, 26 Aug 2020 18:22:56 +0000 (20:22 +0200)]
isisd:  Remove IPV4 from NLPID's if not enabled

Signed-off-by: Przemyslaw <PJanik@advaoptical.com>
3 years agoMerge pull request #7008 from donaldsharp/zebra_lies
Mark Stapp [Thu, 27 Aug 2020 11:58:37 +0000 (07:58 -0400)]
Merge pull request #7008 from donaldsharp/zebra_lies

Zebra lies

3 years agoMerge pull request #6999 from opensourcerouting/isisd-modular-spf
Donald Sharp [Thu, 27 Aug 2020 11:24:18 +0000 (07:24 -0400)]
Merge pull request #6999 from opensourcerouting/isisd-modular-spf

isisd: make the SPF code more modular + reverse SPF + unit tests

3 years agoMerge pull request #7002 from mjstapp/fix_doc_sphinx_api
Donald Sharp [Thu, 27 Aug 2020 11:17:17 +0000 (07:17 -0400)]
Merge pull request #7002 from mjstapp/fix_doc_sphinx_api

doc: test sphinx version, use correct apis

3 years agoMerge pull request #7005 from Orange-OpenSource/dev_ospf_sr
Donald Sharp [Thu, 27 Aug 2020 11:15:38 +0000 (07:15 -0400)]
Merge pull request #7005 from Orange-OpenSource/dev_ospf_sr

ospfd: Coverity corrections

3 years agoMerge pull request #6979 from Jafaral/pim-dup
Donald Sharp [Thu, 27 Aug 2020 11:09:36 +0000 (07:09 -0400)]
Merge pull request #6979 from Jafaral/pim-dup

pimd: fix igmp querier election and IP address mapping

3 years agoospfd: use a new vertex list for every SPF run
GalaxyGorilla [Tue, 25 Aug 2020 14:13:08 +0000 (14:13 +0000)]
ospfd: use a new vertex list for every SPF run

In the context of TI-LFA it is necessary to have multiple
representations of SPFs for so called P and Q spaces. Hence it makes
sense to start with fresh vertex lists, and only delete them when
the SPF calculation is not a 'dry run'.

Signed-off-by: GalaxyGorilla <sascha@netdef.org>
3 years agoMerge pull request #6996 from ne-vlezay80/patch-6
Donatas Abraitis [Thu, 27 Aug 2020 07:06:15 +0000 (10:06 +0300)]
Merge pull request #6996 from ne-vlezay80/patch-6

github: Add lost chapter witch issue template

3 years agozebra: When we fail, actually note the failure
Donald Sharp [Thu, 27 Aug 2020 01:38:47 +0000 (21:38 -0400)]
zebra: When we fail, actually note the failure

During testing it was noticed that routes were considered
installed by zebra, but the kernel did not have the route.
Upon close debugging of the rib it was noticed that FRR
was turning a dplane_ctx_route_init into a success and
FRR was now in a bad state.

2020/08/26 17:55:53.897436 PBR: route_notify_owner: [0.0.0.0/0] Route Removed succeeded for table: 10012
2020/08/26 17:55:53.897572 ZEBRA: 0.0.0.0/0: uptime == 432033, type == 24, instance == 0, table == 10012
2020/08/26 17:55:53.897622 ZEBRA: rib_meta_queue_add: (0:10012):0.0.0.0/0: queued rn 0x5566b0ea7680 into sub-queue 5
2020/08/26 17:55:53.907637 ZEBRA: default(0:10012):0.0.0.0/0: Processing rn 0x5566b0ea7680
2020/08/26 17:55:53.907665 ZEBRA: default(0:10012):0.0.0.0/0: Examine re 0x5566b0d01200 (pbr) status 2 flags 1 dist 200 metric 0
2020/08/26 17:55:53.907702 ZEBRA: default(0:10012):0.0.0.0/0: After processing: old_selected 0x0 new_selected 0x5566b0d01200 old_fib 0x0 new_fib 0x5566b0d01200
2020/08/26 17:55:53.907713 ZEBRA: default(0:10012):0.0.0.0/0: Adding route rn 0x5566b0ea7680, re 0x5566b0d01200 (pbr)
2020/08/26 17:55:53.907879 ZEBRA: default(0:10012):0.0.0.0/0: rn 0x5566b0ea7680 dequeued from sub-queue 5
2020/08/26 17:55:53.907943 ZEBRA: netlink_route_multipath: RTM_NEWROUTE 0.0.0.0/0 vrf 0(10012)
2020/08/26 17:55:53.910756 ZEBRA: default(0:10012):0.0.0.0/0 Processing dplane result ctx 0x5566b0ea82f0, op ROUTE_INSTALL result SUCCESS
2020/08/26 17:55:53.910769 ZEBRA: update_from_ctx: default(0:10012):0.0.0.0/0: SELECTED, re 0x5566b0d01200
2020/08/26 17:55:53.910785 ZEBRA: default(0:10012):0.0.0.0/0 update_from_ctx(): no fib nhg
2020/08/26 17:55:53.910793 ZEBRA: default(0:10012):0.0.0.0/0 update_from_ctx(): rib nhg matched, changed 'true'
2020/08/26 17:55:53.910802 ZEBRA: (0:10012):0.0.0.0/0: Redist update re 0x5566b0d01200 (pbr), old 0x0 (None)
2020/08/26 17:55:53.910812 ZEBRA: Notifying Owner: 24 about prefix 0.0.0.0/0(10012) 2 vrf: 0
2020/08/26 17:55:53.910912 PBR: route_notify_owner: [0.0.0.0/0] Route installed succeeded for table: 10012
2020/08/26 17:55:55.400516 ZEBRA: RTM_DELROUTE 0.0.0.0/0 vrf default(0) table_id: 10012 metric: 20 Admin Distance: 0
2020/08/26 17:55:55.400527 ZEBRA: rib_delete: (0:10012):0.0.0.0/0: rn 0x5566b0ea7680, re 0x5566b0d01200 (pbr) was deleted from kernel, adding

We were receiving a notification from the kernel that the route was deleted and deciding
that we needed to reinstall it.  At that point in time when it got into the dplane
handlers to convert it to the dplane pthread, the dplane decided to drop the request
convert it too a success and not do anything.

This code change removes the conversion from this failure to success and
notifies the upper level about it.  After this change the default route
to table 10012 is now properly marked as rejected:

root@mlx-2700-07:mgmt:/var/log/frr# vtysh -c "show ip route table 10012"
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, q - queued route, r - rejected route

VRF default table 10012:
F>r 0.0.0.0/0 [200/0] via 172.168.1.164, isp2-uplink (vrf PUBLIC), weight 1, 00:24:48

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agozebra: Short circuit test for nexthop groups when not using
Donald Sharp [Thu, 27 Aug 2020 01:34:22 +0000 (21:34 -0400)]
zebra: Short circuit test for nexthop groups when not using

When we are not using nexthop groups, there is no need to
test for whether or not they are installed correctly or not

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
3 years agoisisd: add abiliy to compute the reverse shortest path tree
Renato Westphal [Mon, 24 Aug 2020 18:27:15 +0000 (15:27 -0300)]
isisd: add abiliy to compute the reverse shortest path tree

RFC 7490 says:
 "The reverse SPF computes the cost from each remote node to root. This
  is achieved by running the normal SPF algorithm but using the link
  cost in the direction from the next hop back towards root in place of
  the link cost in the direction away from root towards the next hop".

Support for reverse SPF will be necessary later as it's one of the
algorithms used to compute R-LFA/TI-LFA repair paths.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agotests, isisd: add IS-IS SPF unit tests
Renato Westphal [Mon, 24 Aug 2020 17:46:36 +0000 (14:46 -0300)]
tests, isisd: add IS-IS SPF unit tests

Now that the IS-IS SPF code is more modular, write some unit tests
for it.

This commit includes a new test program called "test_isis_spf" which
can load any test topology (there are 13 different ones available)
and run SPF on any desired node. In the future this same test program
and topologies will also be used to test reverse SPF and TI-LFA.

The "test_common.c" file contains helper functions used to parse the
topology descriptions from "test_topologies.c" into LSP databases
that can be used as an input to the SPF code.

This commit also introduces the F_ISIS_UNIT_TEST flag which is used
to prevent the IS-IS code from scheduling any event when running
under the context of an unit test.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoisisd: make the SPF code more modular
Renato Westphal [Sun, 23 Aug 2020 03:22:32 +0000 (00:22 -0300)]
isisd: make the SPF code more modular

The goal of modularizing the SPF code is to make it possible for
isisd to run SPF in the behalf of other nodes in the network, which
is going to be necessary later when implementing the R-LFA/TI-LFA
solutions. On top of that, a modularized SPF opens the door for
much needed unit testing.

Summary of the changes:
* Change the isis_spf_preload_tent() function to use the local LSP
  as an input (as per the ISO specification) instead of populating
  the TENT based on the list of local interfaces;
* Introduce the "isis_spf_adj" structure to represent an SPF
  adjacency.  SPF adjacencies are inferred from the LSPDB, different
  from normal adjacencies formed using IIH messages;
* Introduce the F_SPFTREE_NO_ROUTES flag to control whether the
  SPT should create routes or not;
* Introduce the F_SPFTREE_NO_ADJACENCIES flag to specify whether
  IS-IS adjacency information is available or not. When running SPF
  in the behalf of other nodes, or under the context of an unit test,
  no adjacency information will be present.
* On isis_area_create(), move some code around so that the area's isis
  backpointer is set as early as possible.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoisisd: introduce command to display IS-IS routes
Renato Westphal [Sun, 23 Aug 2020 02:24:06 +0000 (23:24 -0300)]
isisd: introduce command to display IS-IS routes

Introduce the "show isis route" command to display the routes
associated to an SPF tree. Different from the "show ip route" command,
"show isis route" displays the L1 and L2 routes separately (and not
the best routes only).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoisisd: minor cleanup
Renato Westphal [Fri, 21 Aug 2020 00:44:27 +0000 (21:44 -0300)]
isisd: minor cleanup

* Bring back some consts that were removed;
* Replace ALL_LIST_ELEMENTS by ALL_LIST_ELEMENTS_RO whenever
  possible;
* Fix some CLI return values;
* Remove some unnecessary initializations.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoisisd: reuse adjacency state change hook in the SPF code
Renato Westphal [Fri, 21 Aug 2020 00:36:59 +0000 (21:36 -0300)]
isisd: reuse adjacency state change hook in the SPF code

This is mostly a cosmetic change to make the code more modular,
more elegant and easier to understand.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoisisd: introduce two LSP iteration functions
Renato Westphal [Fri, 21 Aug 2020 00:27:56 +0000 (21:27 -0300)]
isisd: introduce two LSP iteration functions

Iterating over all IP or IS reachability information from a given
LSP isn't a trivial task. That information is scattered throughout
different TLV types, and which ones need to be used depend on
multiple variables (e.g. the SPF tree address family, MT-ID,
etc). This not to mention that an LSP might consist of multiple
fragments.

Introduce the following two LSP iteration function to facilitate
obtaining IP/IS reachability information from a given LSP:
* isis_lsp_iterate_ip_reach()
* isis_lsp_iterate_is_reach()

These functions will be used extensively by the upcoming TI-LFA
code.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agodoc: test sphinx version, use correct apis
Mark Stapp [Wed, 26 Aug 2020 14:45:21 +0000 (10:45 -0400)]
doc: test sphinx version, use correct apis

Some Sphinx apis have changed over time; test the installed
version and use the apis that match the version.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agolib: refactory cisco access list net wildcard
Rafael Zalamena [Wed, 26 Aug 2020 15:50:07 +0000 (12:50 -0300)]
lib: refactory cisco access list net wildcard

Wildcards bits have the opposite representation of a network mask,
example:

192.168.0.0/24 has the following netmask 255.255.0.0 and the wildcard
representation is 0.0.255.255.

To avoid future confusion lets put those definitions into a macro so we
know for sure which form to use.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agopimd: fix IGMP querier election
Nathan Bahr [Mon, 24 Aug 2020 18:52:51 +0000 (13:52 -0500)]
pimd: fix IGMP querier election

Match by exact address rather than by prefix match to
determine if we generated the IGMPP query. Othwerwise
we will be ignoring IGMP queries coming from other
hosts on the same subnet.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
Reviewed-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 years agopimd: fix IGMP source address on transmit
Nathan Bahr [Wed, 19 Aug 2020 19:42:07 +0000 (14:42 -0500)]
pimd: fix IGMP source address on transmit

IGMP queries should contain the source address of the IGMP socket
they are being sent from.
Added binding the IGMP sockets to their specific source, otherwise
interfaces with multiple addresses will send multiple queries using
the same source, which is determined by the kernel.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
Reviewed-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 years agopimd: fix IGMP receive handling
Nathan Bahr [Wed, 19 Aug 2020 19:26:41 +0000 (14:26 -0500)]
pimd: fix IGMP receive handling

IGMP packets received from a source that does not match the subnet
of any configured addresses on the receive interface should be
ignored.
Also, find and use the correct IGMP socket object for the received
IGMP packet.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
3 years agoospfd: Coverity corrections
Olivier Dugeon [Wed, 26 Aug 2020 15:27:16 +0000 (17:27 +0200)]
ospfd: Coverity corrections

Following PR #6726, Coverity Scan detected some new errors in the OSPF Segment
Routing code. This patch corrects them.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
3 years agoisisd: don't add Adj-SIDs when an IP address is missing
Renato Westphal [Fri, 21 Aug 2020 00:25:24 +0000 (21:25 -0300)]
isisd: don't add Adj-SIDs when an IP address is missing

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoisisd: make vid2string() fully reentrant
Renato Westphal [Fri, 21 Aug 2020 00:24:07 +0000 (21:24 -0300)]
isisd: make vid2string() fully reentrant

Always fill the buffer provided by the user to prevent unexpected
results and make the function fully reentrant.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoMerge pull request #7001 from ton31337/fix/deadcode_bgp_show_all_instances_neighbors_vty
Donald Sharp [Wed, 26 Aug 2020 13:27:12 +0000 (09:27 -0400)]
Merge pull request #7001 from ton31337/fix/deadcode_bgp_show_all_instances_neighbors_vty

bgpd: Remove a deadcode freeing JSON in bgp_show_all_instances_neighbors_vty

3 years agoMerge pull request #6903 from ton31337/fix/prevent_null_pointer_dereference_for_aspath
Rafael Zalamena [Wed, 26 Aug 2020 13:07:53 +0000 (10:07 -0300)]
Merge pull request #6903 from ton31337/fix/prevent_null_pointer_dereference_for_aspath

bgpd: Reuse bgp_adj_in for attr to avoid null dereference under aspath

3 years agoMerge pull request #5799 from pguibert6WIND/flowspec_ipv6
Donald Sharp [Wed, 26 Aug 2020 12:26:46 +0000 (08:26 -0400)]
Merge pull request #5799 from pguibert6WIND/flowspec_ipv6

Flowspec ipv6

3 years agobgpd: Remove a deadcode freeing JSON in bgp_show_all_instances_neighbors_vty
Donatas Abraitis [Wed, 26 Aug 2020 05:46:28 +0000 (08:46 +0300)]
bgpd: Remove a deadcode freeing JSON in bgp_show_all_instances_neighbors_vty

json = NULL; is set in a loop above and here we are trying to check and
free the object again which is never be reached.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #6983 from achernavin22/bgp_def_route_rt_map_no_match
Donald Sharp [Tue, 25 Aug 2020 19:32:33 +0000 (15:32 -0400)]
Merge pull request #6983 from achernavin22/bgp_def_route_rt_map_no_match

bgpd: withdraw default route when route-map has no match

3 years agoMerge pull request #6986 from achernavin22/bgp_reset_sess_if_ebgp_multihop
Donald Sharp [Tue, 25 Aug 2020 19:29:24 +0000 (15:29 -0400)]
Merge pull request #6986 from achernavin22/bgp_reset_sess_if_ebgp_multihop

bgpd: reset session if ebgp-multihop is set and no session established

3 years agoMerge pull request #6988 from mjstapp/fix_topo_stop_logic
Donald Sharp [Tue, 25 Aug 2020 18:59:11 +0000 (14:59 -0400)]
Merge pull request #6988 from mjstapp/fix_topo_stop_logic

tests: improve topotest stop logic

3 years agogithub: Add lost chapter witch issue template
ne-vlezay80 [Tue, 25 Aug 2020 18:44:13 +0000 (21:44 +0300)]
github: Add lost chapter witch issue template

Add lost chapter from issue with bug report

Signed-off-by: Alexey Boldyrev <ne-vlezay80@yandex.ru>
3 years agoMerge pull request #6970 from oleg-umnik/patch-1
Renato Westphal [Tue, 25 Aug 2020 16:16:54 +0000 (13:16 -0300)]
Merge pull request #6970 from oleg-umnik/patch-1

doc: vrf socket creation logic