Commit Graph

24238 Commits

Author SHA1 Message Date
Donald Sharp
e524fc1e2c
Merge pull request #8659 from mjstapp/fix_connected_multi
lib,zebra: Use a flag to track down status for connected addrs
2021-05-13 07:23:42 -04:00
Donatas Abraitis
04b122335b
Merge pull request #8663 from donaldsharp/pretty_function
Use __func__ instead of __PRETTY_FUNCTION__
2021-05-13 08:23:06 +03:00
Donald Sharp
d3cc1e4518 pimd: Remove pim->vrf_id and use pim->vrf->vrf_id
VRF creation can happen from either cli or from
knowledged about the vrf learned from zebra.
In the case where we learn about the vrf from
the cli, the vrf id is UNKNOWN.  Upon actual
creation of the vrf, lib/vrf.c touches up the vrf_id
and calls pim_vrf_enable to turn it on properly.
At this point in time we have a pim->vrf_id of
UNKNOWN and the vrf->vrf_id of the right value.

There is no point in duplicating this data.  So just
remove all pim->vrf_id and use the vrf->vrf_id instead
since we keep a copy of the pim->vrf pointer.

This will remove some crashes where we expect the
pim->vrf_id to be usable and it's not.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-12 14:36:59 -04:00
Donald Sharp
e5981db7e9 pimd: There exists a path where on vrf bringup we do not create the pimreg
When creating configuration for a vrf *Before* the vrf has been
created, pim will not properly create the pimreg device and
we will promptly crash when we try to pass data.

Put some code checks in place to ensure that the pimreg is
created for vrf's.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-12 14:08:07 -04:00
Mark Stapp
6806a59321
Merge pull request #8544 from donaldsharp/weird_stuff_in_topo
tests: Fix pylint issues in test_bgp_recursive_route_ebgp_multi_hop.py
2021-05-12 12:28:07 -04:00
Donald Sharp
48c320d2f1 pimd: Use __func__ instead of __PRETTY_FUNCTION__
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-12 12:04:57 -04:00
Donald Sharp
a4544597f4 ospfd: Use _func__ instead of __PRETTY_FUNCTION__
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-12 12:03:59 -04:00
Donald Sharp
7d7be47ef0 zebra: Use __func__ instead of __PRETTY_FUNCTION__
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-12 12:02:05 -04:00
Donald Sharp
cc42c4f00c bgpd: use __func__ instead of __PRETTY_FUNCTION__
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-12 12:00:23 -04:00
Igor Ryzhov
440daf95fd tests: fix bgp_l3vpn_to_bgp_vrf
Too many arguments for format string.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-12 18:55:40 +03:00
Mark Stapp
e3d901f863 lib,zebra: Use a flag to track down status for connected addrs
Track 'down' state of connected addresses with a new flag. We
may have multiple addresses on an interface that share a prefix;
in those cases, we need to determine when the first address
is valid, to install a connected route, and similarly detect
when the last address goes 'down', to remove the connected
route.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-05-12 09:37:00 -04:00
Mark Stapp
58ba06470c
Merge pull request #8661 from donaldsharp/more_privs
lib: Add ZCAP_IPC_LOCK
2021-05-12 07:54:14 -04:00
Donald Sharp
21ef301cad tests: Add pytestmark to the flowspec topotest
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-12 07:33:08 -04:00
Donald Sharp
70492deafc bgpd: Remove usage of prefix2str and use builtin in bgp_zebra.c
Convert over from prefix2str explicit call and use the builtin
%pFX we have now.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-12 07:33:08 -04:00
Donald Sharp
db1fcc98da bgpd: reduce cut-n-paste of bgp_zebra_announce_default for install
This bit of code was cut-n-pasted all over the place:

               if (!bpa->installed && !bpa->install_in_progress) {
                       bgp_send_pbr_rule_action(bpa, NULL, true);
                       bgp_zebra_announce_default(bgp, nh,
                                                  bpa->afi,
                                                  bpa->table_id, true);
               }

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-12 07:33:08 -04:00
Donald Sharp
ebd1a47c95 bgpd: reduce cut-n-paste code in bgp_pbr.c
Create a function bgp_bpr_bpa_remove that is this cut-n-paste code:

       if (bpa->refcnt == 0) {
               if (bpa->installed && bpa->table_id != 0) {
                       bgp_send_pbr_rule_action(bpa, NULL, false);
                       bgp_zebra_announce_default(bpa->bgp, &(bpa->nh),
                                                  AFI_IP,
                                                  bpa->table_id,
                                                  false);
                       bpa->installed = false;
               }
       }

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-12 07:33:08 -04:00
Donald Sharp
b8bd26ad12 tests: Fix pylint issues in test_bgp_recursive_route_ebgp_multi_hop.py
Tests had format for strings with 2 variables but 1 place to put the data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-12 07:30:47 -04:00
Donatas Abraitis
03b682be62
Merge pull request #8660 from qlyoung/fix-bgp-conditional-advertisement-deconfig-removing-unrelated-filters
bgpd: fix deconfig of conditional advertisement
2021-05-12 12:57:50 +03:00
Igor Ryzhov
17daea8a18
Merge pull request #8629 from donaldsharp/parse_rtattr
Parse rtattr
2021-05-12 11:38:09 +03:00
Olivier Dugeon
31db7fc227
Merge pull request #8509 from volta-networks/pathd_ls_client
pathd: Traffic Engineering Database support
2021-05-12 09:42:56 +02:00
Donatas Abraitis
93a3eae793 tests: Skip example_topojson_test and example_test from being tested
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-12 09:00:30 +03:00
Russ White
6158f83225
Merge pull request #8622 from volta-networks/fix_ospf6_max_if_addr
ospf6d: Limit the number of interface addresses being supported in ospfv3
2021-05-11 22:04:07 -04:00
Donald Sharp
c9d842c710 zebra: Consolidate on 1 function netlink_parse_rattr_nested
if_netlink.c created it's on nested parsing #define which
is identical to netlink_parse_rtattr_nested.  Consolidate
on one instead of having this duality.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-11 20:05:51 -04:00
Donald Sharp
269b69d703 zebra: memset the struct rtattr *tb[SIZE] in setting function
In order to parse the netlink message into the
`struct rtattr *tb[size]` it is assumed that the buffer is
memset to 0 before the parsing.  As such if you attempt
to read a value that was not returned in the message
you will not crash when you test for it.

The code has places were we memset it and places where we don't.
This *will* lead to crashes when the kernel changes.  In
our parsing routines let's have them memset instead of having
to remember to do it pre pass in to the parser.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-11 20:05:51 -04:00
Donald Sharp
575a25974b lib: Add ZCAP_IPC_LOCK
We'll need ZCAP_IPC_LOCK for future work coming down the pike
related to dataplane work being done.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-11 19:54:40 -04:00
Quentin Young
5b083e4e95 bgpd: fix deconfig of conditional advertisement
Deconfiguring conditional advertisement resulted in all other policy
settings on the peer getting removed due to an excessively large memset.

This also created a desync with the northbound config tree, which caused
its own set of problems...

Fix the memset to just remove the conditional advertisement config.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-05-11 16:58:38 -04:00
lynne
9160389122 ospf6d: document the interface address limits for ospfv3
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-05-11 09:43:07 -04:00
lynne
f85b76195a ospf6d: Limit the number of interface addresses being supported
The code had no limits on addresses configured on an interface running
ospf6d.  The code would crash when more than 100 addresses were added.
This change limits the number of interface address to 100 if mtu is set
to the default value.  If the mtu is set to a jumbo packet size or larger
we will support 200 interface addresses.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-05-11 09:43:07 -04:00
Igor Ryzhov
449e54fd12
Merge pull request #8652 from ton31337/fix/doc_bgp_alias
doc: Move BGP community alias under a separate section
2021-05-11 16:11:46 +03:00
Russ White
825f41b486
Merge pull request #8589 from idryzhov/bgp-cli-nb-fixes
bgp cli/nb fixes
2021-05-11 07:58:23 -04:00
Russ White
6099bb989d
Merge pull request #8650 from idryzhov/bgp-fix-redist
bgpd: fix redistribution in vrf
2021-05-11 07:28:42 -04:00
Donatas Abraitis
ab16b591b0 tools: Ignore mass renaming of topotests for git blame
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-11 14:14:26 +03:00
Donatas Abraitis
764b81858f tests: Unify directory naming for topotests
Change every `-` to `_` in directory names. This is to avoid mixing _ and -.

Just for consistency and directory sorting properly.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-11 14:14:26 +03:00
Donatas Abraitis
9ce6865047 tools: Fix topotest directory for Travis
ospf1-topo1 => ospf1_topo1

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-11 14:14:26 +03:00
Donatas Abraitis
f101a83b46 doc: Require topotests directory to be consistent with others
Just add a requirement to avoid hyphens in directory naming.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-11 14:14:26 +03:00
Donatas Abraitis
6a89dd1ee6 doc: Move BGP community alias under a separate section
There are more useful CLI commands comming, thus it's desired to have it's
own section.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-11 14:06:05 +03:00
Russ White
41e4b0c0ee
Merge pull request #8406 from adharkar/frr-es_rd
bgpd: Handle EAD/EVI local route updates on VNI RD change
2021-05-11 06:51:41 -04:00
Martin Buck
2d84ae9c29 ospf6d: Send MAXAGE LS update for received old self-originated LSAs
Fixes OSPFv3-26.13 ANVL RFC conformance bug #8576 by improving the bugfix
for #7030 from 4c63a76a. That commit changed handling of received old
non-MAXAGE LSAs with a MAXAGE counterpart in the LSDB from "add all LSAs to
LSDB and flood non-self-originated ones" to "add & flood only
non-self-originated LSAs and ignore self-originated LSAs". The new behaviour
is similar but adds sending a MAXAGE LS Update for received self-originated
LSAs to remove the old LSAs from the network, resulting in "add & flood
non-self-originated LSAs, don't add but send MAXAGE LS Update for
self-originated LSAs". The missing MAXAGE LS Update is what OSPFv3-26.13
ANVL complained about.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2021-05-11 11:52:07 +02:00
Neal Shrader
5df2642292 bgpd: scope evpn specific path selection to type-2 routes
For EVPN routes, there is specific logic in place for path selection
surrounding MAC Mobility.  For pure type-5 routes, if a route is
advertised with a MED, this is ignored since it ultimately falls inside
of the EVPN specific path selection logic, and ultimately selects the
lower IP address.  This change ensures only type-2 routes fall into the
EVPN BGP path selection.

Signed-off-by: Neal Shrader <neal@digitalocean.com>
2021-05-10 15:35:57 -04:00
Javier Garcia
f7d5bdcf5c pathd. Pathd TED support . Documentation update - [part 4/4]
- As an example of pathd and igp (ospfd) config:

    ! igp ospfv2 snippet
    interface eth0
     ip ospf network point-to-point
    !
    router ospf$
     mpls-te on
     mpls-te export
     ...

    !pathd snippet
    segment-routing
     traffic-eng
      mpls-te on
      mpls-te import ospfv2

      segment-list sl-1
      index 10  nai adjacency 10.1.2.11 10.1.2.1
      index 20  nai adjacency 10.1.20.1 10.1.20.2
      index 30  nai adjacency 10.2.5.2 10.2.5.5
      !
      policy color 5 endpoint 10.10.10.5
      name five
      binding-sid 5555
      candidate-path preference 600 name cp51 explicit segment-list sl-1
      candidate-path preference 500 name cp52-dyn dynamic

Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
2021-05-10 15:25:13 +02:00
Javier Garcia
f008db919d pathd. TED support . Topotest - [part 3/4]
Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
2021-05-10 15:25:13 +02:00
Javier Garcia
f2b9485d6f pathd. TED support . Validation of candidate path - [part 2/4]
- Explicit segment list nai will be resolved to corresponded sid.
    - Dynamic segment list (from pce) will be validated.
    - If segment list could not be resolved or validated won't be used.
    - Now this new config is supported

segment-list sl-1
 index 10  nai prefix 10.1.2.1/32 iface 1
 index 30  nai adjacency 10.2.5.2 10.2.5.5
 index 40  nai prefix 10.10.10.5/32 algorithm 0

Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
2021-05-10 15:24:59 +02:00
David Lamparter
3b20069fd6
Merge pull request #8648 from idryzhov/fix-test-assert
tests: fix build warning
2021-05-10 12:52:21 +02:00
Javier Garcia
75c69d151c pathd. TED support . Client to link State - [part 1/4]
- pathd will act as a client to for the configured igp.
    - pathd must be configured to activate and receive data from igp.

    !pathd config snippet
    segment-routing
     traffic-eng
      mpls-te on
      mpls-te import ospfv2

Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
2021-05-10 12:36:46 +02:00
Igor Ryzhov
6cc0114b6e bgpd: deregister bgp instance from zebra when vrf is deleted
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-10 01:22:34 +03:00
Rafael Zalamena
34723b2fad
Merge pull request #8639 from idryzhov/isis-new-bfd-lib
isisd: rework BFD integration
2021-05-09 17:10:42 -03:00
Igor Ryzhov
d9083050c8 Revert "bgpd: vrf route leaking, fix vrf redistribute"
This reverts commit 6b2433c63f.
2021-05-09 22:28:36 +03:00
David Lamparter
16819a24a4
Merge pull request #8627 from volta-networks/fix_pceplib_scan_build
pceplib. Clean scan-build static analyzer messages.
2021-05-09 20:25:24 +02:00
David Lamparter
83f5d2581a
Merge pull request #8441 from mjstapp/fix_topo_pylint1 2021-05-09 19:48:33 +02:00
David Lamparter
2ab691e6c0
Merge pull request #8626 from idryzhov/fix-isis-topo1
tests: fix isis-topo1 topologies
2021-05-09 19:46:01 +02:00