]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agoMerge pull request #8382 from taspelund/add_rd_all_v2
Donatas Abraitis [Fri, 2 Apr 2021 08:08:58 +0000 (11:08 +0300)]
Merge pull request #8382 from taspelund/add_rd_all_v2

Add support for 'rd all' in EVPN and L3VPN commands

3 years agoMerge pull request #8375 from mjstapp/fix_ignore_pcep_test_files
Donald Sharp [Thu, 1 Apr 2021 20:45:20 +0000 (16:45 -0400)]
Merge pull request #8375 from mjstapp/fix_ignore_pcep_test_files

build: add pceplib test output to gitignore

3 years agoMerge pull request #8358 from idryzhov/fix-nb-vrf-crash
Mark Stapp [Thu, 1 Apr 2021 20:42:03 +0000 (16:42 -0400)]
Merge pull request #8358 from idryzhov/fix-nb-vrf-crash

*: modify VRF_CONFIGURED flag only in VRF NB layer

3 years agoMerge pull request #8385 from idryzhov/fix-no-bfd
Mark Stapp [Thu, 1 Apr 2021 16:51:10 +0000 (12:51 -0400)]
Merge pull request #8385 from idryzhov/fix-no-bfd

Fix "no bfd" crash

3 years agoMerge pull request #8383 from idryzhov/bgpd-fix-build
Donald Sharp [Thu, 1 Apr 2021 13:21:00 +0000 (09:21 -0400)]
Merge pull request #8383 from idryzhov/bgpd-fix-build

bgpd: fix build warnings

3 years agobfdd: fix profiles autocompletion
Igor Ryzhov [Thu, 1 Apr 2021 12:48:24 +0000 (15:48 +0300)]
bfdd: fix profiles autocompletion

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobbfd: clear nb config entries when removing bfd node
Igor Ryzhov [Thu, 1 Apr 2021 12:42:53 +0000 (15:42 +0300)]
bbfd: clear nb config entries when removing bfd node

When bfd node is removed, we must clear all NB entries set by its
children - sessions and profiles. Let's store some fake data as an entry
for the bfd node to be able to unset it later.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobfdd: remove profiles when removing bfd node
Igor Ryzhov [Thu, 1 Apr 2021 12:29:18 +0000 (15:29 +0300)]
bfdd: remove profiles when removing bfd node

Fixes #8379.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobgpd: fix build warnings
Igor Ryzhov [Thu, 1 Apr 2021 08:03:58 +0000 (11:03 +0300)]
bgpd: fix build warnings

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobgpd: fix old vpn command compilation failures
Trey Aspelund [Thu, 1 Apr 2021 01:10:12 +0000 (01:10 +0000)]
bgpd: fix old vpn command compilation failures

set_vpn_nexthop/no_set_vpn_nexthop were failing due to missing
declarations and unused variables.
This adds the missing declaration and removes unused variables.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
3 years agodoc: Add Displaying Routes by RD section
Trey Aspelund [Fri, 19 Mar 2021 06:37:43 +0000 (06:37 +0000)]
doc: Add Displaying Routes by RD section

Add docs for commands to display BGP table per-RD.
Also update commands to mention flowspec, routes,
advertised-routes, and received-routes.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
3 years agobgpd: Add 'rd all' keyword to EVPN/L3VPN show cmds
Trey Aspelund [Tue, 9 Mar 2021 04:28:04 +0000 (04:28 +0000)]
bgpd: Add 'rd all' keyword to EVPN/L3VPN show cmds

New and improved submission for this commit -- updated to accommodate
changes from 4027d19b0.

Adds support for 'rd all' matching for EVPN and L3VPN show commands.
Introduces evpn_show_route_rd_all_macip().
Cleans up some show commands to use SHOW_DISPLAY string constants.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
3 years agoMerge pull request #8345 from dslicenc/frr-reload-vrf-static
Mark Stapp [Wed, 31 Mar 2021 20:52:43 +0000 (16:52 -0400)]
Merge pull request #8345 from dslicenc/frr-reload-vrf-static

Frr reload vrf static

3 years agoMerge pull request #8377 from idryzhov/fix-disable-bfdd
Mark Stapp [Wed, 31 Mar 2021 16:39:17 +0000 (12:39 -0400)]
Merge pull request #8377 from idryzhov/fix-disable-bfdd

ospfd: fix building with --disable-bfdd

3 years agotools: frr-reload fixes for deleting vrf static routes
Don Slice [Fri, 19 Mar 2021 19:10:14 +0000 (15:10 -0400)]
tools: frr-reload fixes for deleting vrf static routes

Problems reported that in certain cases, frr-reload.py would
delete vrf static routes inadvertantly due to two different
reasons. First, vrf statics with null0 or Null0 nexthops would
fail the match since rendered as blackholes.  This was already
fixed for non-vrf statics so added for vrf-based.  Second,
frr-reload would fail to match due to different formats for
adding the command. If entered in the old way
"ip route x.x.x.x/x y.y.y.y vrf NAME" and rendered
in the new sway "vrf NAME\nip route x.x.x.x/x y.y.y.y" it would
fail to match do an inadvertant delete.

Ticket: 2570270
Signed-off-by: Don Slice <dslice@nvidia.com>
3 years agotools: frr-reload.py changes to make black happy
Don Slice [Fri, 19 Mar 2021 19:03:51 +0000 (15:03 -0400)]
tools: frr-reload.py changes to make black happy

Since black is finding issues before applying my change, committing
those changes separately

Signed-off-by: Don Slice <dslice@nvidia.com>
3 years agoMerge pull request #8350 from opensourcerouting/printfrr-revamp
Mark Stapp [Wed, 31 Mar 2021 13:10:30 +0000 (09:10 -0400)]
Merge pull request #8350 from opensourcerouting/printfrr-revamp

lib: `printfrr()` care package

3 years agoospfd: fix building with --disable-bfdd
Igor Ryzhov [Wed, 31 Mar 2021 12:54:34 +0000 (15:54 +0300)]
ospfd: fix building with --disable-bfdd

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobuild: add pceplib test output to gitignore
Mark Stapp [Wed, 31 Mar 2021 12:27:11 +0000 (08:27 -0400)]
build: add pceplib test output to gitignore

Add some pcep unit-test output files to gitignore.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #7419 from patrasar/routemap_nb
Igor Ryzhov [Tue, 30 Mar 2021 23:26:51 +0000 (02:26 +0300)]
Merge pull request #7419 from patrasar/routemap_nb

Routemap nb

3 years agodoc/developer: improve printfrr extension docs
David Lamparter [Sun, 21 Mar 2021 16:35:43 +0000 (17:35 +0100)]
doc/developer: improve printfrr extension docs

The table is getting rather clunky, let's just break this out and make
it pretty there.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: save errno in vty_out()
David Lamparter [Fri, 26 Mar 2021 13:27:51 +0000 (14:27 +0100)]
lib: save errno in vty_out()

... so `%m` works correctly, without us trampling over `errno` before we
get to formatting it.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: add `%dPF` & `%dSO` formats
David Lamparter [Fri, 26 Mar 2021 13:20:08 +0000 (14:20 +0100)]
lib: add `%dPF` & `%dSO` formats

Just quick helpers to print `AF_*` and `SOCK_*` constants.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: fix & improve `%pSU` format
David Lamparter [Fri, 26 Mar 2021 13:16:01 +0000 (14:16 +0100)]
lib: fix & improve `%pSU` format

This wasn't quite formatting IPv6+port in a useful way (no brackets),
and printing the scope ID (interface index) and unix addrs is useful
too.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: add `%pSQ` and `%pSE` string escape formats
David Lamparter [Mon, 22 Mar 2021 09:12:42 +0000 (10:12 +0100)]
lib: add `%pSQ` and `%pSE` string escape formats

These are for string quoting (`%pSQ`) and string escaping (`%pSE`); the
sets / escape methods are currently rather "basic" and might be extended
in the future.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: add `%*pHX` + `%*pHS` hexdump in printfrr
David Lamparter [Thu, 18 Feb 2021 23:08:11 +0000 (00:08 +0100)]
lib: add `%*pHX` + `%*pHS` hexdump in printfrr

(I'll get to `zlog_hexdump()` in a separate pass.)

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: add `%pFB` extension to print struct fbuf *
David Lamparter [Tue, 2 Mar 2021 20:39:49 +0000 (21:39 +0100)]
lib: add `%pFB` extension to print struct fbuf *

Useful to insert output from another bprintfrr() call.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: add `%pVA` recursive printfrr
David Lamparter [Tue, 2 Mar 2021 19:45:57 +0000 (20:45 +0100)]
lib: add `%pVA` recursive printfrr

Analogous to Linux kernel `%pV` (but our mechanism expects 2 specifier
chars and `%pVA` is clearer anyway.)

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: add `FMT_NSTD()` for non-standard printf exts
David Lamparter [Fri, 26 Mar 2021 17:11:21 +0000 (18:11 +0100)]
lib: add `FMT_NSTD()` for non-standard printf exts

... to suppress the warnings when using something that isn't quite ISO C
compatible and would otherwise cause compiler warnings from `-Wformat`.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: allow discerning unspec width in printfrr ext
David Lamparter [Fri, 26 Mar 2021 16:58:54 +0000 (17:58 +0100)]
lib: allow discerning unspec width in printfrr ext

With 0 currently the default value for the width specifier, it's not
possible to discern that from a %*p where 0 was passed as the length
parameter.  Use -1 to allow for that.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: put printfrr extension args into struct
David Lamparter [Sat, 20 Mar 2021 08:02:04 +0000 (09:02 +0100)]
lib: put printfrr extension args into struct

... for easier extensibility.  Add width, # and - flags while at it.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agobgpd: North-bound implementation for bgp rmaps
Sarita Patra [Fri, 30 Oct 2020 07:45:43 +0000 (00:45 -0700)]
bgpd: North-bound implementation for bgp rmaps

This commit introduces the implementation for the north-bound
callbacks for the bgp-specific route-map match and set clauses.

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
Signed-off-by: Sarita Patra <saritap@vmware.com>
3 years agoospfd: North-bound implementation for ospfd rmaps
Sarita Patra [Fri, 30 Oct 2020 07:44:04 +0000 (00:44 -0700)]
ospfd: North-bound implementation for ospfd rmaps

This commit introduces the implementation for the north-bound
callbacks for the ospfd-specific route-map match and set clauses.

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
Signed-off-by: Sarita Patra <saritap@vmware.com>
3 years agoospf6d: North-bound implementation for ospf6d rmaps
Sarita Patra [Fri, 30 Oct 2020 07:42:34 +0000 (00:42 -0700)]
ospf6d: North-bound implementation for ospf6d rmaps

This commit introduces the implementation for the north-bound
callbacks for the ospf6d-specific route-map match and set clauses.

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
Signed-off-by: Sarita Patra <saritap@vmware.com>
3 years agozebra: North-bound implementation for zebra rmaps
Sarita Patra [Fri, 30 Oct 2020 07:41:19 +0000 (00:41 -0700)]
zebra: North-bound implementation for zebra rmaps

This commit introduces the implementation for the north-bound
callbacks for the zebra-specific route-map match and set clauses.

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
Signed-off-by: Sarita Patra <saritap@vmware.com>
3 years agolib: Modifications to route-map NB
Sarita Patra [Fri, 30 Oct 2020 07:38:41 +0000 (00:38 -0700)]
lib: Modifications to route-map NB

This commit introduces the changes to the library route-map
north-bound callback implementation in order to align it to
the modified yang definitions.

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
Signed-off-by: Sarita Patra <saritap@vmware.com>
3 years agolib,zebra,bgpd,ospfd,ospf6d: Route-map yang defns
Sarita Patra [Fri, 30 Oct 2020 06:40:10 +0000 (23:40 -0700)]
lib,zebra,bgpd,ospfd,ospf6d: Route-map yang defns

This commit includes the following:
1) Modifications to the frr-route-map.yang to enable addition of
   bgpd, ospfd, ospf6d and zebra specific route map match/set clauses.
2) Yang definitions for bgpd match/set clauses.
3) Yang definitions for ospfd and ospf6d match/set clauses.
4) Yang definitions for zebra match/set clauses.

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
Signed-off-by: Sarita Patra <saritap@vmware.com>
3 years agoMerge pull request #8058 from rgirada/ospf-ecmp
Mark Stapp [Tue, 30 Mar 2021 15:57:33 +0000 (11:57 -0400)]
Merge pull request #8058 from rgirada/ospf-ecmp

ospfd: Max multipath config support

3 years agoMerge pull request #8372 from FRRouting/revert-8216-add_rd_all
Russ White [Tue, 30 Mar 2021 15:34:00 +0000 (11:34 -0400)]
Merge pull request #8372 from FRRouting/revert-8216-add_rd_all

Revert "bgpd: Add 'rd all' keyword to EVPN/L3VPN show cmds"

3 years agoRevert "bgpd: Add 'rd all' keyword to EVPN/L3VPN show cmds"
Lou Berger [Tue, 30 Mar 2021 15:27:07 +0000 (11:27 -0400)]
Revert "bgpd: Add 'rd all' keyword to EVPN/L3VPN show cmds"

3 years agoMerge pull request #8216 from taspelund/add_rd_all
Russ White [Tue, 30 Mar 2021 14:41:08 +0000 (10:41 -0400)]
Merge pull request #8216 from taspelund/add_rd_all

bgpd: Add 'rd all' keyword to EVPN/L3VPN show cmds

3 years agoMerge pull request #8267 from idryzhov/bgp-cli-fixes
Russ White [Tue, 30 Mar 2021 14:40:43 +0000 (10:40 -0400)]
Merge pull request #8267 from idryzhov/bgp-cli-fixes

bgp cli fixes

3 years agoMerge pull request #8311 from idryzhov/nb-sorting
Russ White [Tue, 30 Mar 2021 14:37:31 +0000 (10:37 -0400)]
Merge pull request #8311 from idryzhov/nb-sorting

Sort route-maps/access-lists/prefix-lists by sequence number in running-config

3 years agoMerge pull request #8057 from ranjanyash54/default-route
Russ White [Tue, 30 Mar 2021 14:34:05 +0000 (10:34 -0400)]
Merge pull request #8057 from ranjanyash54/default-route

ospf6d: Default Route functionality

3 years agoMerge pull request #8137 from Orange-OpenSource/ospf_ls
Russ White [Tue, 30 Mar 2021 14:28:37 +0000 (10:28 -0400)]
Merge pull request #8137 from Orange-OpenSource/ospf_ls

ospfd: Add Link State support

3 years agoMerge pull request #8056 from jmmikkel/peertype
Russ White [Tue, 30 Mar 2021 14:26:57 +0000 (10:26 -0400)]
Merge pull request #8056 from jmmikkel/peertype

bgpd: Add "bgp bestpath peer-type multipath-relax"

3 years agoMerge pull request #8368 from volta-networks/fix_isis_ospfv3_coverity
Russ White [Tue, 30 Mar 2021 14:22:05 +0000 (10:22 -0400)]
Merge pull request #8368 from volta-networks/fix_isis_ospfv3_coverity

ospf6d: fix coverity warning

3 years agoMerge pull request #8369 from idryzhov/filter-fixes
Russ White [Tue, 30 Mar 2021 14:21:37 +0000 (10:21 -0400)]
Merge pull request #8369 from idryzhov/filter-fixes

access-list and prefix-list fixes

3 years agoMerge pull request #8362 from idryzhov/fix-ospf-cli-count
Mark Stapp [Tue, 30 Mar 2021 12:48:25 +0000 (08:48 -0400)]
Merge pull request #8362 from idryzhov/fix-ospf-cli-count

ospfd: fix counting of "ip ospf area" commands

3 years agoospfd: fix counting of "ip ospf area" commands
Igor Ryzhov [Mon, 29 Mar 2021 11:47:43 +0000 (14:47 +0300)]
ospfd: fix counting of "ip ospf area" commands

Instead of trying to maintain if_ospf_cli_count, let's directly count
the number of configured interfaces when it is needed. Current approach
sometimes leads to an incorrect counter.

Fixes #8321.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoospfd: Max multipath config support
rgirada [Thu, 11 Feb 2021 10:05:12 +0000 (02:05 -0800)]
ospfd: Max multipath config support

Description:
OSPF does not have an option to control the maximum multiple
equal cost paths to reach a destination/route(ECMP).
Currently, it is using the system specific max multiple paths.
But Somtimes, It requires to control the multiple paths from ospf.
This cli helps to configure the max number multiple paths in ospf.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agoMerge pull request #8351 from volta-networks/fix_ospf6_abr_examin_summary_check_cost_...
Martin Winter [Mon, 29 Mar 2021 23:00:51 +0000 (01:00 +0200)]
Merge pull request #8351 from volta-networks/fix_ospf6_abr_examin_summary_check_cost_change

ospf6d: fix ospf6_abr_examin_summary to check for a path cost change

3 years agolib: fix checking for duplicated prefix-list entries
Igor Ryzhov [Mon, 29 Mar 2021 21:37:52 +0000 (00:37 +0300)]
lib: fix checking for duplicated prefix-list entries

Restore the behavior that was before the NB conversion.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: restore checks for duplicated prefix-list entries
Igor Ryzhov [Mon, 29 Mar 2021 21:25:19 +0000 (00:25 +0300)]
lib: restore checks for duplicated prefix-list entries

The checks were incorrectly removed in commit 4d2f546f under the
assumption that it is needed only in CLI. Actually the checks are needed
for the case when the sequence number is explicitly set by a user.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: finish consolidation of prefix-list nb callbacks
Igor Ryzhov [Mon, 29 Mar 2021 19:53:36 +0000 (22:53 +0300)]
lib: finish consolidation of prefix-list nb callbacks

There was an attempt to consolidate the code in commit fae60215, but the
work was not actually finished and some necessary checks were missed.

Let's finish it.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: fix checking for duplicated access-list entries
Igor Ryzhov [Mon, 29 Mar 2021 18:26:28 +0000 (21:26 +0300)]
lib: fix checking for duplicated access-list entries

Restore the behavior that was before the NB conversion.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8346 from mjstapp/fix_cov_sa
David Lamparter [Mon, 29 Mar 2021 18:17:12 +0000 (20:17 +0200)]
Merge pull request #8346 from mjstapp/fix_cov_sa

3 years agoospf6d: fix coverity warning
lynne [Mon, 29 Mar 2021 17:33:07 +0000 (13:33 -0400)]
ospf6d: fix coverity warning

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
3 years agotopotests: add tests for OSPFv3 default route
Rafael Zalamena [Wed, 10 Mar 2021 13:21:14 +0000 (10:21 -0300)]
topotests: add tests for OSPFv3 default route

Three new tests:

 - OSPFv3 convergence using 'ipv6 ospf6 neighbor json'
 - Default route functionality:
   * Check that the LSA is present
   * Check that the route was installed

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoospf6d: Minor changes for stub area
Yash Ranjan [Tue, 23 Mar 2021 05:05:01 +0000 (22:05 -0700)]
ospf6d: Minor changes for stub area

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
3 years agodoc: Add documentation for default-information originate.
Yash Ranjan [Mon, 22 Mar 2021 06:40:25 +0000 (23:40 -0700)]
doc: Add documentation for default-information originate.

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
3 years agoospf6d: Add logic to set metric if route-map not present
Yash Ranjan [Wed, 10 Feb 2021 07:28:52 +0000 (23:28 -0800)]
ospf6d: Add logic to set metric if route-map not present

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
3 years agoospf6d: Add logic to change the status of router to ASBR
Yash Ranjan [Wed, 10 Feb 2021 06:44:44 +0000 (22:44 -0800)]
ospf6d: Add logic to change the status of router to ASBR

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
3 years agoospf6d: Add CLI and logic for default-information originate command
Yash Ranjan [Wed, 10 Feb 2021 04:53:46 +0000 (20:53 -0800)]
ospf6d: Add CLI and logic for default-information originate command

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
3 years ago*: modify VRF_CONFIGURED flag only in VRF NB layer
Igor Ryzhov [Sun, 28 Mar 2021 21:49:13 +0000 (00:49 +0300)]
*: modify VRF_CONFIGURED flag only in VRF NB layer

This is to fix the crash reproduced by the following steps:

* ip link add red type vrf table 1

  Creates VRF.

* vtysh -c "conf" -c "vrf red"

  Creates VRF NB node and marks VRF as configured.

* ip route 1.1.1.0/24 2.2.2.2 vrf red
* no ip route 1.1.1.0/24 2.2.2.2 vrf red
  (or similar l3vni set/unset in zebra)

  Marks VRF as NOT configured.

* ip link del red

  VRF is deleted, because it is marked as not configured, but NB node
  stays.

Subsequent attempt to configure something in the VRF leads to a crash
because of the stale pointer in NB layer.

Fixes #8357.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8285 from donaldsharp/rpki_find
Donatas Abraitis [Sun, 28 Mar 2021 17:48:24 +0000 (20:48 +0300)]
Merge pull request #8285 from donaldsharp/rpki_find

Rpki find

3 years agolib: record output positions in printfrr
David Lamparter [Tue, 2 Mar 2021 19:16:18 +0000 (20:16 +0100)]
lib: record output positions in printfrr

This replaces `%n` with a safe, out-of-band option that simply records
the start and end offset of the output produced for each `%...`
specifier.

The old `%n` code is removed.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: print `(null)` rather than `NULL`
David Lamparter [Fri, 26 Mar 2021 18:14:24 +0000 (19:14 +0100)]
lib: print `(null)` rather than `NULL`

... for consistency with `%s`, which also prints `(null)`.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: rework printfrr extensions to output directly
David Lamparter [Thu, 18 Feb 2021 21:52:23 +0000 (22:52 +0100)]
lib: rework printfrr extensions to output directly

Allowing printfrr extensions to directly write to the output buffer has
a few advantages:
- there is no arbitrary length limit imposed (previously 64)
- the output doesn't need to be copied another time
- the extension can directly use bprintfrr() to put together pieces

The downside is that the theoretical length (regardless of available
buffer space) must be computed correctly.

Extended unit tests to test these paths a bit more thoroughly.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agoospf6d: fix unguarded debug
Mark Stapp [Thu, 25 Mar 2021 17:44:50 +0000 (13:44 -0400)]
ospf6d: fix unguarded debug

Put a debug under a conditional.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoisisd: fix coverity SA warning
Mark Stapp [Thu, 25 Mar 2021 17:23:44 +0000 (13:23 -0400)]
isisd: fix coverity SA warning

Add assert to clear SA warning.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #8317 from mjstapp/fix_short_printfrr_buf
David Lamparter [Fri, 26 Mar 2021 18:40:21 +0000 (19:40 +0100)]
Merge pull request #8317 from mjstapp/fix_short_printfrr_buf

3 years agoospf6d: fix ospf6_abr_examin_summary to check for a path cost change
Karen Schoener [Fri, 26 Mar 2021 18:20:40 +0000 (14:20 -0400)]
ospf6d: fix ospf6_abr_examin_summary to check for a path cost change

Fixes a regression in test case: anvl-ospfv3-16.14.

Signed-off-by: Karen Schoener <karen@voltanet.io>
3 years agotools/gcc-plugin: support [un]signed in pragma
David Lamparter [Thu, 18 Feb 2021 23:05:35 +0000 (00:05 +0100)]
tools/gcc-plugin: support [un]signed in pragma

Need `unsigned char *` for `%pHX`.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agotools/gcc-plugin: fix format precision/width type
David Lamparter [Thu, 18 Feb 2021 23:04:51 +0000 (00:04 +0100)]
tools/gcc-plugin: fix format precision/width type

`%*.*pEXT` applied the extension type to the precision and width (*.*)
too.  Oops.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agobgpd: Use rpki_curr_state instead of curr_state
Donald Sharp [Thu, 25 Mar 2021 13:28:30 +0000 (09:28 -0400)]
bgpd: Use rpki_curr_state instead of curr_state

During Review it was suggested that appending rpki_
to curr_state and target_state would be better
variable names.  Instead of going and fixing
3 or so commits up.  Just do this one.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agodoc: Add doc for new rpki commands
Donald Sharp [Wed, 17 Mar 2021 20:26:49 +0000 (16:26 -0400)]
doc: Add doc for new rpki commands

`show bgp [afi] [safi] A.B.C.D rpki <valid|invalid|notfound>`
`show bgp [afi] [safi] rpki <valid|invalid|notfound>`

commands need to be documented

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Add rpki filter to some more show commands
Donald Sharp [Wed, 17 Mar 2021 20:19:02 +0000 (16:19 -0400)]
bgpd: Add rpki filter to some more show commands

Add a `show bgp ipv4 uni rpki ...` command.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Add `show bgp <afi> <safi> A.B.C.D [rpki <valid|invalid|notfound>]`
Donald Sharp [Mon, 8 Mar 2021 22:01:57 +0000 (17:01 -0500)]
bgpd: Add `show bgp <afi> <safi> A.B.C.D [rpki <valid|invalid|notfound>]`

Add the ability for the end operator to query the state of valid
or invalid or no information rpki prefix information.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Figure out rpki validation state earlier
Donald Sharp [Mon, 8 Mar 2021 21:16:43 +0000 (16:16 -0500)]
bgpd: Figure out rpki validation state earlier

Figure out the rpki validation state earlier and also check
to see if we care about this state or not.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Convert string output to rpki validation-state:
Donald Sharp [Mon, 8 Mar 2021 20:57:18 +0000 (15:57 -0500)]
bgpd: Convert string output to rpki validation-state:

When displaying data about the rpki state, use the
string `rpki validation-state` instead of `validation-state:`
to avoid confusion with `(valid)`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Convert RPKI states to an enum and use them
Donald Sharp [Mon, 8 Mar 2021 20:56:12 +0000 (15:56 -0500)]
bgpd: Convert RPKI states to an enum and use them

Convert the rpki states to an enum and use them in the code

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8154 from AnuradhaKaruppiah/evpn-mh-irb-2
Patrick Ruddy [Fri, 26 Mar 2021 12:16:01 +0000 (12:16 +0000)]
Merge pull request #8154 from AnuradhaKaruppiah/evpn-mh-irb-2

bgpd, lib, zebra: Complete support for sym-IRB with EVPN-MH

3 years agobgpd: cleanup prefix2str usage
Anuradha Karuppiah [Fri, 26 Feb 2021 02:32:32 +0000 (18:32 -0800)]
bgpd: cleanup prefix2str usage

Use %pFX where possible.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
3 years agobgpd: fix crash in the MH cleanup handling
Anuradha Karuppiah [Thu, 10 Sep 2020 20:51:56 +0000 (13:51 -0700)]
bgpd: fix crash in the MH cleanup handling

The MH datastructures were being released before the paths that were
referencing them. Fix is to do the MH cleanup last.

The MH finish function has also been stripped down to only do a
datastructure cleanup i.e. avoid sending route updates etc.

Ticket: 31376

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: handle local ES del or transition to LACP bypass
Anuradha Karuppiah [Sun, 30 Aug 2020 21:05:33 +0000 (14:05 -0700)]
bgpd: handle local ES del or transition to LACP bypass

1. When a local ES is deleted or the ES-bond goes into bypass we treat
imported MAC-IP routes with that ES destination as remote routes instead
of sync routes. This requires a re-evaluation of the routes as
"non-local-dest" and an update to zebra.
2. When a ES is attached to an access port or the ES-bond transitions from
bypass to LACP-up we treat imported MAC-IP routes with that ES destination as
sync routes. This requires a re-evaluation of the routes as
"local-dest" and an update to zebra.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: changes for maintaining evpn nexthops and their rmac mapping
Anuradha Karuppiah [Sat, 12 Sep 2020 17:36:01 +0000 (10:36 -0700)]
bgpd: changes for maintaining evpn nexthops and their rmac mapping

In the case of EVPN type-2 routes that use ES as destination, BGP
consolidates the nh (and nh->rmac mapping) and sends it to zebra as
a nexthop add.

This nexthop is the EVPN remote PE and is created by reference of
VRF IPvx unicast paths imported from EVPN Type-2 routes.

zebra uses this nexthop for setting up a remote neigh enty for the PE
and a remote fdb entry for the PE's RMAC.

Ticket: CM-31398

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: ES evpn nexthop prep work
Anuradha Karuppiah [Fri, 11 Sep 2020 18:11:35 +0000 (11:11 -0700)]
bgpd: ES evpn nexthop prep work

Setup a mh_info indirection in the path extra. This has been done to
avoid increasing evpn route's path size to add new (type based) pointers
in path_info_extra.

Ticket: CM-31398

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agolib/zebra: zapi for installing EVPN nexthops from bgp
Anuradha Karuppiah [Mon, 14 Sep 2020 13:35:45 +0000 (06:35 -0700)]
lib/zebra: zapi for installing EVPN nexthops from bgp

EVPN nexthops are installed as remote neighs by zebra. This was earlier
done only via VRF IPvX uni routes imported from EVPN routes.

With EVPN-MH these VRF routes now reference a L3NHG which is setup based
on the EAD and doesn't include the RMAC. To workaround that BGP now
consolidates and maintains EVPN nexthops which are then sent to zebra.

zebra sets up these nexthops as L3-VNI nh entries using a dummy type-1
route as reference.

Ticket: CM-31398

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: Disable L3NHG support for routes leaked from another VRF
Anuradha Karuppiah [Fri, 4 Sep 2020 15:19:49 +0000 (08:19 -0700)]
bgpd: Disable L3NHG support for routes leaked from another VRF

Theoretically we should just be able to use the L3 NHG in the other-VRF/nh-VRF.
But there is some change list handling (when an ES is added to or
removed from a VRF) that needs to be updated to account for routes in other
VRFs using that ES-VRF as nexthop. Till that is done we will disable L3-NHG
use for routes leaked from a different VRF.

Route in tenant2 with ES/NHG as destination -
===========================================
root@leaf11:mgmt:~# ip route show vrf tenant2 22.1.0.7
22.1.0.7 nhid 75000012 proto bgp metric 20
root@leaf11:mgmt:~# ip nexthop list id 75000012
id 75000012 group 103/107/111 proto bgp
root@leaf11:mgmt:~# ip nexthop |grep "103\|107\|111"
id 103 via 6.0.0.11 dev vlan12 scope link proto bgp onlink
id 107 via 6.0.0.12 dev vlan12 scope link proto bgp onlink
id 111 via 6.0.0.13 dev vlan12 scope link proto bgp onlink
id 75000012 group 103/107/111 proto bgp
root@leaf11:mgmt:~#

Leaked into VRF1 with a flat/exploded mpaths
============================================
root@leaf11:mgmt:~# ip route show vrf tenant1 |grep -A3 22.1.0.7
22.1.0.7 proto bgp metric 20
        nexthop via 6.0.0.11 dev vlan12 weight 1 onlink
        nexthop via 6.0.0.12 dev vlan12 weight 1 onlink
        nexthop via 6.0.0.13 dev vlan12 weight 1 onlink
root@leaf11:mgmt:~#

Ticket: CM-31115

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: flush remote ES-EVI entries when a L2-VNI is deleted
Anuradha Karuppiah [Thu, 27 Aug 2020 23:55:28 +0000 (16:55 -0700)]
bgpd: flush remote ES-EVI entries when a L2-VNI is deleted

Force flush all ES-EVI PE entries when a L2-VNI is deleted. This will
implicitly free up the remote ES-EVI and deref the ES entry.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: re-eval use-l3nhg when a remote ES is [de]activated in a VRF
Anuradha Karuppiah [Mon, 17 Aug 2020 23:24:50 +0000 (16:24 -0700)]
bgpd: re-eval use-l3nhg when a remote ES is [de]activated in a VRF

There are two changes in this commit -

1. Maintain a list of global MAC-IP routes per-ES. This list is maintained
for quick processing on the following events -
a. When the first VTEP/PE becomes active in the ES-VRF, the L3 NHG is
activated and the route can be sent to zebra.
b. When there are no active PEs in the ES-VRF the L3 NHG is
de-activated and -
- If the ES is present in the VRF -
The route is not installed in zebra as there are no active PEs for
the ES-VRF
- If the ES is not present in the VRF -
The route is installed with a flat multi-path list i.e. without L3NHG.
This is to handle the case where there are no locally attached L2VNIs
on the ES (for that tenant VRF).

2. Reinstall VRF route when an ES is installed or uninstalled in a
tenant VRF (the global MAC-IP list in #1 is used for this purpose also).
If an ES is present in the VRF we use L3NHG to enable fast-failover of
routed traffic.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: Rename macip_path_list to macip_evi_path_list
Anuradha Karuppiah [Tue, 18 Aug 2020 13:52:40 +0000 (06:52 -0700)]
bgpd: Rename macip_path_list to macip_evi_path_list

This is done to clearly indicate what routes are being linked to
the list i.e. MAC-IP routes in the VNI table.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: allow routes to be imported if the ES/ES-VRF is not present
Anuradha Karuppiah [Sat, 15 Aug 2020 13:41:31 +0000 (06:41 -0700)]
bgpd: allow routes to be imported if the ES/ES-VRF is not present

In a sym-IRB setup the remote ES may not be installed if the tenant
VRF is not present locally. To allow that case while retaining the
fast-failover benefits for the case where the tenant VRF is locally
present we use the following approach -
1. If ES is present in the tenant VRF we use the L3NHG for installing
the MAC-IP based tenant route. This allows for efficient failover via
L3NHG updates.
2. If the ES is not present locally in the corresponding tenant VRF we
fall back to a non-NHG multi-path based routing approach. In this
case individual routes are updated when the ES links flap.

PS: #1 can be turned off entirely by disabling use-l3-nhg in BGP.

Ticket: CM-30935

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: on ES down re-advertise the MAC-IP entry without the L3 ECOM
Anuradha Karuppiah [Fri, 14 Aug 2020 22:48:34 +0000 (15:48 -0700)]
bgpd: on ES down re-advertise the MAC-IP entry without the L3 ECOM

When an ES goes down the MAC-IP route must be updated to remove it from
the tenant VRF routing table. This is because the fast-failover
(via EAD-per-ES withdraw) procedures described in RFC 7432 are only
applicable to L2 forwarding/MAC-ECMP. For L3/routed traffic (in a
sym-IRB setup) failover, individual paths need to be withdrawn.

To handle this difference in L2/L3 requirements BGP updates the MAC-IP
route to include the L3 ECOM if local destination ES is oper-up and
to exclude the L3 ECOM if local ES is oper-down.

Ticket: CM-30935

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agoMerge pull request #8344 from pjdruddy/coverity_mpls_l3vpn
Donald Sharp [Thu, 25 Mar 2021 23:40:34 +0000 (19:40 -0400)]
Merge pull request #8344 from pjdruddy/coverity_mpls_l3vpn

lib, bgpd: add a specific oid_copy function for IPv6 addrs

3 years agoMerge pull request #8341 from simondeziel/systemd-onfailure
Donald Sharp [Thu, 25 Mar 2021 19:00:13 +0000 (15:00 -0400)]
Merge pull request #8341 from simondeziel/systemd-onfailure

systemd's %n already includes the type suffix (.service)

3 years agoMerge pull request #8340 from mjstapp/fix_pcep_timer_race
Donald Sharp [Thu, 25 Mar 2021 18:31:04 +0000 (14:31 -0400)]
Merge pull request #8340 from mjstapp/fix_pcep_timer_race

libs: fix race in pcep lib

3 years agoMerge pull request #8292 from donaldsharp/isis_crash
Mark Stapp [Thu, 25 Mar 2021 16:52:45 +0000 (12:52 -0400)]
Merge pull request #8292 from donaldsharp/isis_crash

isisd: Prevent OOM crash in isis

3 years agoMerge pull request #8338 from idryzhov/fix-ospfd-sa-warning
Mark Stapp [Thu, 25 Mar 2021 16:15:05 +0000 (12:15 -0400)]
Merge pull request #8338 from idryzhov/fix-ospfd-sa-warning

ospfd: fix SA warning