Commit Graph

26797 Commits

Author SHA1 Message Date
Donatas Abraitis
5d9e468205
Merge pull request #9701 from AnuradhaKaruppiah/lttng-build-fix
bgpd: fix build error seen when lttng is enabled
2021-10-02 20:11:32 +03:00
rgirada
89eb4727de ospfd: GR helper functionality change in helper exit
Description:
	As per the RFC 3623 section 3.2,
	OSPF nbr shouldn't be deleted even in unsuccessful helper exit.

	1. Made the changes to keep neighbour even after exit.
	2. Restart the dead timer after expiry in helper. Otherwise, Restarter
	   will be in FULL state in helper forever until it receives the 'hello'.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-10-01 11:59:11 -07:00
Anuradha Karuppiah
23aa35ade5 bgpd: initial batch of evpn lttng tracepoints
Low overhead bgp-evpn TPs have been added which push data out in a binary
format -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
root@switch:~# lttng list --userspace |grep "frr_bgp:evpn"
      frr_bgp:evpn_mh_nh_rmac_zsend (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint)
      frr_bgp:evpn_mh_nh_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_nhg_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_vtep_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_bum_vtep_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mac_ip_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
root@switch:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

In addition to the tracepoints a babeltrace python plugin for pretty
printing (binary data is converted into grepable strings). Sample usage -
frr_babeltrace.py trace_path

Sample tracepoint output -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1. frr_bgp: evpn_mac_ip_zsend
frr_bgp:evpn_mac_ip_zsend {'action': 'add', 'vni': 1007, 'mac': '00:02:00:00:00:04', 'ip': 'fe80::202:ff:fe00:4', 'vtep': '27.0.0.15', 'esi': '03:44:38:39:ff:ff:01:00:00:02'}

2. frr_bgp: evpn_mh_vtep_zsend
frr_bgp:evpn_mh_vtep_zsend {'action': 'add', 'esi': '03:44:38:39:ff:ff:01:00:00:02', 'vtep': '27.0.0.16'}

3. frr_bgp: evpn_mh_nhg_zsend
frr_bgp:evpn_mh_nhg_zsend {'action': 'add', 'type': 'v4', 'nhg': 74999998, 'esi': '03:44:38:39:ff:ff:01:00:00:02', 'vrf': 85}

4. frr_bgp: evpn_mh_nh_zsend
frr_bgp:evpn_mh_nh_zsend {'nhg': 74999998, 'vtep': '27.0.0.16', 'svi': 93}

5. frr_bgp: evpn_mh_nh_rmac_zsend
frr_bgp:evpn_mh_nh_rmac_zsend {'action': 'add', 'vrf': 85, 'nh': '::ffff:1b00:12', 'rmac': '00:02:00:00:00:50'}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2021-10-01 09:02:25 -07:00
Igor Ryzhov
0757efc0ce doc: fix range for bgp expanded community list
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-01 18:36:02 +03:00
Mark Stapp
f89211f7c9 tests: fix log string in topotests/lib/bgprib.py
Correct a log string in a method in bgprib.py - cut-and-paste
error, maybe?

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-10-01 08:06:35 -04:00
Mark Stapp
2aad8c4289 bgpd: add 'header' info to show bgp afi safi json detail
The '... json detail' output is missing some data that's shown
via the 'route_vty_out_detail_header' function. Integrate the
json version of that function in the 'json detail' path.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-10-01 08:06:35 -04:00
Mark Stapp
edfee30d64 bgpd: add some const
Add const to a couple of arguments in bgp_label utilities,
and in a show function.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-10-01 07:48:45 -04:00
Igor Ryzhov
e3cb363a73 doc: fix ospf distribute-list command and description
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-01 14:45:21 +03:00
Igor Ryzhov
b0a007df7a bgpd: fix access-list update callback
When a regular access-list is updated, we should update references to
regular access-lists, not as-path access-lists.

Fixes #9707.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-01 14:45:07 +03:00
Donald Sharp
d0bf22a10b
Merge pull request #9712 from idryzhov/travis-gprc
docker: remove grpc from Travis CI
2021-10-01 07:34:44 -04:00
Igor Ryzhov
7a53c83a68 docker: remove grpc from Travis CI
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-10-01 14:04:42 +03:00
Manoj Naragund
25dd89e398 ospf6d: minor struct compare issues.
Problem Statement:
Multiple struct compare using memcmp, which might result in issue due to
structure padding/alignment.

Fix:
The code changes involve structure member by member comparison to
remove any issues related to padding/alignment.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
(cherry picked from commit 67db821a1d6d68b19862d50b68ed19278c5f2422)
2021-09-30 09:53:26 -07:00
Anuradha Karuppiah
e439b73606 bgpd: fix build error seen when lttng is enabled
Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2021-09-30 08:54:26 -07:00
Igor Ryzhov
ac32b03f98
Merge pull request #9694 from mjstapp/fix_topo_pim_cmp
tests: fix string comparison in lib/pim.py
2021-09-30 12:40:55 +03:00
Igor Ryzhov
ef322b022f *: cleanup interface loopback/vrf check
There's a helper function to check whether the interface is loopback or
VRF - if_is_loopback_or_vrf. Let's use it whenever we need to check that.

There's no functional change in this commit.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-09-30 12:31:05 +03:00
Mark Stapp
94e8feaa9f tests: fix string comparison in lib/pim.py
Use correct string comparison syntax in lib/pim.py

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-09-29 11:49:43 -04:00
David Lamparter
a89bae26f7
Merge pull request #9560 from LabNConsulting/ziemba/frrmod_load-error-messages
frrmod_load(): fix error messages
2021-09-29 14:35:35 +02:00
Donald Sharp
ffd7467cc4
Merge pull request #9688 from LabNConsulting/working/lb/fix-tt-bgp-vrf
tests:  get bgp_l3vpn_to_bgp_vrf running again, also improve logging (minor)
2021-09-29 07:29:39 -04:00
Sri Mohana Singamsetty
2e2d2be87f
Merge pull request #9422 from pguibert6WIND/update_autort_l3vni
bgpd: update auto route target for l3vni appropriately
2021-09-28 09:15:34 -07:00
Lou Berger
1b9ebabb27 tests: get bgp_l3vpn_to_bgp_vrf running, also improve logging
Signed-off-by: Lou Berger <lberger@labn.net>
2021-09-28 11:29:46 -04:00
Quentin Young
c85f53017a
Merge pull request #9669 from LabNConsulting/chopps/topo-sudo-env 2021-09-28 10:53:23 -04:00
Donald Sharp
8e55e2c87b
Merge pull request #9677 from ton31337/fix/zlog_newline_not_needed
tools: Add coccinelle script to catch \n or \r at the end of zlog_*
2021-09-28 10:44:54 -04:00
Russ White
5393318d81
Merge pull request #9682 from adrianomarto/mesh-group-fix
pimd: fixing command "no ip msdp mesh-group member"
2021-09-28 10:21:17 -04:00
Igor Ryzhov
b7c21fad11 zebra: fix buffer overflow
mac is only 6 bytes long and we shouldn't blindly copy unknown number of
bytes into it.

Fixes #9671.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-09-28 15:45:14 +03:00
David Lamparter
f62de63c6a *: frr-format with unmodified GCC
Since there's very few locations where the `frr-format` actually prints
false positive warnings, consensus seems to be to just work around the
false positives even if the code is correct.

In fact, there is only one pattern of false positives currently, in
`bfdd/dplane.c` which does `vty_out("%"PRIu64, (uint64_t)be64toh(...))`.
The workaround/fix for this is a replacement `be64toh` whose type is
always `uint64_t` regardless of what OS we're on, making the cast
unnecessary.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-09-28 11:20:32 +02:00
Fredi Raspall
d97e415dd5 ospfd: fix processing of ext prefix in SR
The existing logic was not comparing the prefix of the extended
prefix TLV. As a result, the code was removing all of the prefix
SIDs except the one received on every LSA update.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:40:33 +02:00
Fredi Raspall
1a41378ecc ospfd: remove duplicate field update
In update_ext_prefix_sid(), the sr_prefix is associated to the
SR node and inherits the adv router ID regardless.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:40:33 +02:00
Fredi Raspall
152656d8ef ospfd: replace iterator by RO version ..
..since it's used for read-only lookups.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:40:33 +02:00
Fredi Raspall
d1db7359ad ospfd: fix logic on SR prefix configuration
The logic was broken in some corner cases.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:40:33 +02:00
Fredi Raspall
6c57d01073 ospfd: validate input SRGB and SRLB
The code was not checking if in these label ranges [a,b], a is
smaller than b, which is assumed in several places, including when
determining the size of the block as b-a+1. As a consequence, the
results of a bad configuration can be unpredictable. Some effects
observed were: 1) segfault 2) de-activation of SR due to label
reservation failure.

The added validation function also checks if the SR blocks are
larger than some minimal size. RFC 8665 mandates that the blocks
be srictly larger than zero. In this patch, the minimum sized is
arbitrarily defined to be 16.

Checking if ranges would fall outside [16,1048575] is omitted
since the vty filtering takes care of that.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:40:32 +02:00
Fredi Raspall
e90c038324 isisd: fix condition to get label from SRLB
The fix is the same as for OSPF SR.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:40:32 +02:00
Fredi Raspall
37a331f8c2 ospfd: fix condition to get label from SRLB
The prior condition was wrong since it ended up allowing for
labels past the end of the SRLB. Variable 'current' should be in
range [0, size-1] for labels not to exceed the SRLB upper boundary.

In addition, emit a warning log when all labels in the SRLB have
been used.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:40:32 +02:00
Fredi Raspall
4e10b4dfba ospfd: add util func to detect SR range overlap
Replaces several complex if conditions by a lookup to a utility
to determine if two ranges of numbers overlap.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:40:32 +02:00
Fredi Raspall
daaebd394c ospfd: homogenize reservation of SRGB & SRLB
Homogenize the code dealing with SRGBs and SRLBs by defining the
same set of utility functions for their reservation.

Unify also the logs and don't display function names since the
operations are only performed from the same functions.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:40:32 +02:00
Fredi Raspall
c181efbe14 ospfd: homogenize deletion of SRGB & SRLB
Homogenize the code dealing with SRGBs and SRLBs by defining the
same set of utility functions for the deletion of SR blocks.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:20:59 +02:00
Fredi Raspall
143661c17f ospfd: remove unnecessary assignment
Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:20:59 +02:00
Fredi Raspall
5403ff15db ospfd: remove unused macro
Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:20:59 +02:00
Fredi Raspall
5bd62f051d ospfd: use existing macro on initialization of SR
Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:20:58 +02:00
Fredi Raspall
2110d03e06 ospfd: remove unused enum case for state of SR ..
In addition, make the relationship among several macros more
explicit.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:20:58 +02:00
Fredi Raspall
6f609c4980 ospfd: fix display of debug flags
* Some of the debug flags were not shown in show debugging.
* The check for TI-LFA debug was made against the wrong variable.
* Some of the debugs were not cleared with 'no debug ospf'

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-09-28 10:20:58 +02:00
Adriano Marto Reis
4687748973 pimd: fixing command "no ip msdp mesh-group member"
Deleting a mesh-group member no longer deletes the mesh-group.

Complete bug description at:
https://github.com/FRRouting/frr/issues/9664

Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
2021-09-28 12:43:52 +10:00
Chirag Shah
6ba578ef29 zebra: add resolver for nexthop in json
zebra rib 'show ip route json' lists all nexthops in a flat list.
To identify the recursively resolved
nexthops relation adding a flag "resolver" as delimiter
to identify recursively resolved nexthop in the list.

Testing Done:
{
  "1.1.1.0\/24":[
    {
      "prefix":"1.1.1.0\/24",
      "protocol":"static",
       ....
      "nexthops":[
        {
          "flags":5,
          "ip":"27.0.0.14",
          "afi":"ipv4",
          "active":true,
          "recursive":true,
          "weight":1
        },
        {
          "flags":3,
          "fib":true,
          "ip":"fe80::202:ff:fe00:11",
          "afi":"ipv6",
          "interfaceIndex":12,
          "interfaceName":"uplink-1",
          "resolver":true,  <-- Resolver for recursive true flag nh
          "active":true,
          "weight":1
        },
      ]
    }
  ]
}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2021-09-27 16:05:08 -07:00
Donald Sharp
027db46917 lib, zebra: Send safi for rnh resolution
Pass down the safi for when we need address
resolution.  At this point in time we are
hard coding the safi to SAFI_UNICAST.
Future commits will take advantage of this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27 15:26:05 -04:00
Donald Sharp
a4598b97d9 zebra: Create the SAFI_MULTICAST rnh tables
Actually create the SAFI_MULTICAST rnh tables.  No code
uses these yet.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27 12:38:08 -04:00
Donald Sharp
d597533a9d zebra: Start carrying safi for rnh processing
PIM is going to need to be able to send down the address it is
trying to resolve in the multicast rib.  We need a way to signal
this to the end developer.  Start the conversion by adding the
ability to have a safi.  But only allow SAFI_UNICAST at the moment.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27 12:38:08 -04:00
Donald Sharp
6cd9a93ddd zebra: Attempt to clarify variable names as they are used
Cleanup the poorly implemented variable names so that we can
understand what is going on a bit better.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27 12:38:08 -04:00
Donald Sharp
93f533c308 zebra: remove zvrf->import_check_table
The import_check_table is no longer used, so let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27 12:38:08 -04:00
Donald Sharp
6071e5e96e zebra: remove 'enum rnh_type' from system
This code is now dead code since there are not two
nexthop resolution types.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27 12:38:08 -04:00
Donald Sharp
7272e2a461 zebra: remove import check resolution from zebra
The entirety of the import checking no longer needs to be
in zebra as that no-one is calling it.  Remove the code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27 12:38:08 -04:00
Donald Sharp
3d174ce08d *: Remove the ZEBRA_IMPORT_ROUTE_XXX zapi messages
These are no longer really needed.  The client just needs
to call nexthop resolution instead.

So let's remove the zapi types.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-09-27 12:38:08 -04:00