]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
14 months agoMerge pull request #12863 from sri-mohan1/sri-mohan-ldp
Donald Sharp [Wed, 22 Feb 2023 17:14:23 +0000 (12:14 -0500)]
Merge pull request #12863 from sri-mohan1/sri-mohan-ldp

ldpd: changes for code maintainability

14 months agoldpd: changes for code maintainability
sri-mohan1 [Wed, 22 Feb 2023 09:38:50 +0000 (15:08 +0530)]
ldpd: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
14 months agoMerge pull request #12839 from taspelund/evpn_prefix
Donatas Abraitis [Tue, 21 Feb 2023 19:31:33 +0000 (21:31 +0200)]
Merge pull request #12839 from taspelund/evpn_prefix

lib: skip route-map optimization if !AF_INET(6)

14 months agoMerge pull request #12798 from donaldsharp/rib_match_multicast
Russ White [Tue, 21 Feb 2023 16:40:36 +0000 (11:40 -0500)]
Merge pull request #12798 from donaldsharp/rib_match_multicast

Rib match multicast

14 months agoMerge pull request #12818 from imzyxwvu/fix/other-table-inactive
Donald Sharp [Tue, 21 Feb 2023 16:37:31 +0000 (11:37 -0500)]
Merge pull request #12818 from imzyxwvu/fix/other-table-inactive

zebra: Fix other table inactive when ip import-table is on

14 months agolib: skip route-map optimization if !AF_INET(6)
Trey Aspelund [Fri, 17 Feb 2023 21:47:09 +0000 (21:47 +0000)]
lib: skip route-map optimization if !AF_INET(6)

Currently we unconditionally send a prefix through the optimized
route-map codepath if the v4 and v6 LPM tables have been allocated and
optimization has not been disabled.
However prefixes from address-families that are not IPv4/IPv6 unicast
always fail the optimized route-map index lookup, because they occur on
an LPM tree that is IPv4 or IPv6 specific.
e.g.
Even if you have an empty permit route-map clause, Type-3 EVPN routes
are always denied:
```
--config
route-map soo-foo permit 10

--logs
2023/02/17 19:38:42 BGP: [KZK58-6T4Y6] No best match sequence for pfx: [3]:[0]:[32]:[2.2.2.2] in route-map: soo-foo, result: no match
2023/02/17 19:38:42 BGP: [H5AW4-JFYQC] Route-map: soo-foo, prefix: [3]:[0]:[32]:[2.2.2.2], result: deny
```

There is some existing code that creates an AF_INET/AF_INET6 prefix
using the IP/prefix information from a Type-2/5 EVPN route, which
allowed only these two route-types to successfully attempt an LPM lookup
in the route-map optimization trees via the converted prefix.

This commit does 3 things:
1) Reverts to non-optimized route-map lookup for prefixes that are not
   AF_INET or AF_INET6.
2) Cleans up the route-map code so that the AF check is part of the
   index lookup + the EVPN RT-2/5 -> AF_INET/6 prefix conversion occurs
   outside the index lookup.
3) Adds "debug route-map detail" logs to indicate when we attempt to
   convert an AF_EVPN prefix into an AF_INET/6 prefix + when we fallback
   to a non-optimized lookup.

Additional functionality for optimized lookups of prefixes from other
address-families can be added prior to the index lookup, similar to how
the existing EVPN conversion works today.

New behavior:
```
2023/02/17 21:44:27 BGP: [WYP1M-NE4SY] Converted EVPN prefix [5]:[0]:[32]:[192.0.2.7] into 192.0.2.7/32 for optimized route-map lookup
2023/02/17 21:44:27 BGP: [MT1SJ-WEJQ1] Best match route-map: soo-foo, sequence: 10 for pfx: 192.0.2.7/32, result: match
2023/02/17 21:44:27 BGP: [H5AW4-JFYQC] Route-map: soo-foo, prefix: 192.0.2.7/32, result: permit

2023/02/17 21:44:27 BGP: [WYP1M-NE4SY] Converted EVPN prefix [2]:[0]:[48]:[aa:bb:cc:00:22:22]:[32]:[20.0.0.2] into 20.0.0.2/32 for optimized route-map lookup
2023/02/17 21:44:27 BGP: [MT1SJ-WEJQ1] Best match route-map: soo-foo, sequence: 10 for pfx: 20.0.0.2/32, result: match
2023/02/17 21:44:27 BGP: [H5AW4-JFYQC] Route-map: soo-foo, prefix: 20.0.0.2/32, result: permit

2023/02/17 21:44:27 BGP: [KHG7H-RH4PN] Unable to convert EVPN prefix [3]:[0]:[32]:[2.2.2.2] into IPv4/IPv6 prefix. Falling back to non-optimized route-map lookup
2023/02/17 21:44:27 BGP: [MT1SJ-WEJQ1] Best match route-map: soo-foo, sequence: 10 for pfx: [3]:[0]:[32]:[2.2.2.2], result: match
2023/02/17 21:44:27 BGP: [H5AW4-JFYQC] Route-map: soo-foo, prefix: [3]:[0]:[32]:[2.2.2.2], result: permit
```

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
14 months agoMerge pull request #12832 from opensourcerouting/fix/deprecate_bgp_internet_community
Russ White [Tue, 21 Feb 2023 16:35:26 +0000 (11:35 -0500)]
Merge pull request #12832 from opensourcerouting/fix/deprecate_bgp_internet_community

bgpd: Deprecate BGP `internet` community

14 months agolib: use MAX_BITLEN instead of magic number
Trey Aspelund [Fri, 17 Feb 2023 20:41:13 +0000 (20:41 +0000)]
lib: use MAX_BITLEN instead of magic number

Fixes up evpn_prefix2prefix() to use IPV(4|6)_MAX_BITLEN instead of
32/128 directly.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
14 months agoMerge pull request #12805 from karlquan/kquan_self_orig
Russ White [Tue, 21 Feb 2023 13:38:07 +0000 (08:38 -0500)]
Merge pull request #12805 from karlquan/kquan_self_orig

bgpd: BGP troubleshooting - Add a keyword self-originate to display o…

14 months agoMerge pull request #12838 from opensourcerouting/feature/backport_timer_on_shutdown
Russ White [Tue, 21 Feb 2023 13:28:37 +0000 (08:28 -0500)]
Merge pull request #12838 from opensourcerouting/feature/backport_timer_on_shutdown

bgpd: Fix bgp no shutdown

14 months agoMerge pull request #12851 from sri-mohan1/sri-mohan-ldp
Russ White [Tue, 21 Feb 2023 13:28:28 +0000 (08:28 -0500)]
Merge pull request #12851 from sri-mohan1/sri-mohan-ldp

ldpd: changes for code maintainability

14 months agoMerge pull request #12854 from opensourcerouting/fix/bgp_withdraw_attr_not_used
Russ White [Tue, 21 Feb 2023 13:18:37 +0000 (08:18 -0500)]
Merge pull request #12854 from opensourcerouting/fix/bgp_withdraw_attr_not_used

bgpd: Drop struct attr from bgp_withdraw()

14 months agoMerge pull request #12795 from pguibert6WIND/vpnv6_nexthop_encoding
Russ White [Tue, 21 Feb 2023 13:15:43 +0000 (08:15 -0500)]
Merge pull request #12795 from pguibert6WIND/vpnv6_nexthop_encoding

Vpnv6 nexthop encoding

14 months agoMerge pull request #12366 from manojvn/ospfv2-flood-reduction
Russ White [Tue, 21 Feb 2023 13:03:06 +0000 (08:03 -0500)]
Merge pull request #12366 from manojvn/ospfv2-flood-reduction

ospfd: Support OSPF Refresh and Flooding Reduction RFC4136.

14 months agoMerge pull request #12248 from pguibert6WIND/bgpasdot
Russ White [Tue, 21 Feb 2023 13:01:03 +0000 (08:01 -0500)]
Merge pull request #12248 from pguibert6WIND/bgpasdot

lib, bgp: add initial support for asdot format

14 months agobgpd: Drop struct attr from bgp_withdraw()
Donatas Abraitis [Tue, 21 Feb 2023 09:35:59 +0000 (11:35 +0200)]
bgpd: Drop struct attr from bgp_withdraw()

It's not used at all.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #12849 from opensourcerouting/fix/tests_enum
Donald Sharp [Tue, 21 Feb 2023 00:28:25 +0000 (19:28 -0500)]
Merge pull request #12849 from opensourcerouting/fix/tests_enum

tests: Cover all enum values for unit tests

14 months agoMerge pull request #12850 from LabNConsulting/chopps/ospfapi-fixes
Donald Sharp [Tue, 21 Feb 2023 00:27:56 +0000 (19:27 -0500)]
Merge pull request #12850 from LabNConsulting/chopps/ospfapi-fixes

ospfd client api bugfix and refinements

14 months agotests: improve the ospfapi test (move to square topology)
Christian Hopps [Sun, 6 Feb 2022 14:41:12 +0000 (09:41 -0500)]
tests: improve the ospfapi test (move to square topology)

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agoospfclient: remove register "READY" requirement
Christian Hopps [Sun, 20 Feb 2022 08:59:41 +0000 (03:59 -0500)]
ospfclient: remove register "READY" requirement

- also add ability of the apibin to process commands on stdin

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agoospfclient: bugfix and no implicit register
Christian Hopps [Sun, 19 Feb 2023 23:55:58 +0000 (18:55 -0500)]
ospfclient: bugfix and no implicit register

- dont delete the callback on opaque data delete
- require explicit registration

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agoospfd: compare prefix values in host order
Christian Hopps [Sun, 6 Feb 2022 20:01:28 +0000 (15:01 -0500)]
ospfd: compare prefix values in host order

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agoospfd: small bugfix for miscounting A[S]BRs
Christian Hopps [Sun, 6 Feb 2022 14:40:24 +0000 (09:40 -0500)]
ospfd: small bugfix for miscounting A[S]BRs

- improve the debug for the second add router call.

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agoospfd: inc. opaque data in `show opaque info detail json` output
Christian Hopps [Sat, 18 Feb 2023 17:16:18 +0000 (12:16 -0500)]
ospfd: inc. opaque data in `show opaque info detail json` output

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agoldpd: changes for code maintainability
sri-mohan1 [Mon, 20 Feb 2023 16:42:24 +0000 (22:12 +0530)]
ldpd: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
14 months agotests: Cover all enum values for unit tests
Donatas Abraitis [Mon, 20 Feb 2023 15:59:09 +0000 (17:59 +0200)]
tests: Cover all enum values for unit tests

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #12842 from opensourcerouting/fix/convert_flags_inverted_override_...
Donald Sharp [Mon, 20 Feb 2023 01:23:16 +0000 (20:23 -0500)]
Merge pull request #12842 from opensourcerouting/fix/convert_flags_inverted_override_to_uint64

bgpd: Convert flags_invert/flags_override to uint64_t

14 months agoMerge pull request #12830 from anlancs/fix/doc-ripd-rst
Donatas Abraitis [Sun, 19 Feb 2023 11:09:15 +0000 (13:09 +0200)]
Merge pull request #12830 from anlancs/fix/doc-ripd-rst

doc: cosmetic changes for ripd

14 months agobgpd: Convert flags_invert/flags_override to uint64_t
Donatas Abraitis [Sat, 18 Feb 2023 07:58:37 +0000 (09:58 +0200)]
bgpd: Convert flags_invert/flags_override to uint64_t

peer->af_flags got this correctly.
peer->flags were already converted a time ago, but these were missed...

Let's fix this.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #12843 from donaldsharp/use_define
Donatas Abraitis [Sun, 19 Feb 2023 09:25:56 +0000 (11:25 +0200)]
Merge pull request #12843 from donaldsharp/use_define

bgpd: Use actual defines to set values

14 months agoMerge pull request #12845 from sri-mohan1/sri-mohan-ldp
Donatas Abraitis [Sun, 19 Feb 2023 09:25:12 +0000 (11:25 +0200)]
Merge pull request #12845 from sri-mohan1/sri-mohan-ldp

ldpd: changes for code maintainability

14 months agoldpd: changes for code maintainability
sri-mohan1 [Sun, 19 Feb 2023 05:27:25 +0000 (10:57 +0530)]
ldpd: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
14 months agobgpd: Use actual defines to set values
Donald Sharp [Sat, 18 Feb 2023 12:24:12 +0000 (07:24 -0500)]
bgpd: Use actual defines to set values

Instead of hard coding so that if something ever changes
it will break.  Let's use the #defines that FRR has
included for us.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agobgpd: Fix bgp no shutdown
Rafael Zalamena [Fri, 23 Sep 2022 13:14:02 +0000 (10:14 -0300)]
bgpd: Fix bgp no shutdown

When leaving the BGP shutdown state we must restart the peer timers
otherwise nothing will happen.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #12791 from taspelund/loc_rib_json_fix
Donatas Abraitis [Fri, 17 Feb 2023 18:24:33 +0000 (20:24 +0200)]
Merge pull request #12791 from taspelund/loc_rib_json_fix

bgpd: fix 'json detail' output structure

14 months agobgpd: Deprecate BGP `internet` community
Donatas Abraitis [Fri, 17 Feb 2023 16:28:17 +0000 (18:28 +0200)]
bgpd: Deprecate BGP `internet` community

Quite a few well-known communities from IANA's list do
   not receive special treatment in Cisco IOS XR, and at least one
   community on Cisco IOS XR's special treatment list, internet == 0:0,
   is not formally a well-known community as it is not in [IANA-WKC] (it
   is taken from the Reserved range [0x00000000-0x0000FFFF]).

https://datatracker.ietf.org/doc/html/rfc8642

This is Cisco-specific command which is causing lots of questions when it
comes to debugging and/or configuring it properly, but overall, this behavior
is very odd and it's not clear how it should be treated between different
vendor implementations.

Let's deprecate it and let the operators use 0:0/0 communities as they want.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #12780 from opensourcerouting/spdx-license-id
Donald Sharp [Fri, 17 Feb 2023 14:43:05 +0000 (09:43 -0500)]
Merge pull request #12780 from opensourcerouting/spdx-license-id

*: convert to SPDX License identifiers

14 months agodoc: cosmetic changes for ripngd
anlan_cs [Fri, 17 Feb 2023 10:10:09 +0000 (18:10 +0800)]
doc: cosmetic changes for ripngd

Correct `ripngd` doc based on code, and remove one non-existed command.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
14 months agodoc: cosmetic changes for ripd
anlan_cs [Fri, 17 Feb 2023 09:10:00 +0000 (17:10 +0800)]
doc: cosmetic changes for ripd

Correct `ripd` doc based on code.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
14 months agoMerge pull request #12727 from opensourcerouting/feature/bgp_software_version_capability
Donald Sharp [Fri, 17 Feb 2023 13:18:22 +0000 (08:18 -0500)]
Merge pull request #12727 from opensourcerouting/feature/bgp_software_version_capability

bgpd: Software Version Capability

14 months agoMerge pull request #12824 from donaldsharp/coverity_evpn
Donatas Abraitis [Thu, 16 Feb 2023 21:05:09 +0000 (23:05 +0200)]
Merge pull request #12824 from donaldsharp/coverity_evpn

Coverity evpn

14 months agoMerge pull request #12734 from donaldsharp/fixup_helper
Donatas Abraitis [Thu, 16 Feb 2023 20:06:47 +0000 (22:06 +0200)]
Merge pull request #12734 from donaldsharp/fixup_helper

lib: Fix non-use of option

14 months agoMerge pull request #12817 from donaldsharp/fix_determine_med
Donatas Abraitis [Thu, 16 Feb 2023 19:45:44 +0000 (21:45 +0200)]
Merge pull request #12817 from donaldsharp/fix_determine_med

some missed upstream commits

14 months agotests: update tests using 'show bgp json detail'
Trey Aspelund [Mon, 13 Feb 2023 22:14:16 +0000 (22:14 +0000)]
tests: update tests using 'show bgp json detail'

There were a few tests using "show bgp ... json detail" that did json
comparisons against a predefined json structure. This updates those
predefined json structures to match the new format of the output.
(new output moves path array under "paths" key and adds header keys)

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
14 months agobgpd: fix 'json detail' output structure
Trey Aspelund [Fri, 10 Feb 2023 19:05:27 +0000 (19:05 +0000)]
bgpd: fix 'json detail' output structure

"show bgp <afi> <safi> json detail" was incorrectly displaying header
information from route_vty_out_detail_header() as an element of the
"paths" array. This corrects the behavior for 'json detail' so that a
route holds a dictionary with keys for "paths" and header info, which
aligns with how we structure the output for a specific prefix, e.g.
"show bgp <afi> <safi> <prefix> json".

Before:
```
ub20# show ip bgp json detail
{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 3,
 "routerId": "100.64.0.222",
 "defaultLocPrf": 100,
 "localAS": 1,
 "routes": { "2.2.2.2/32": [
  {                           <<<<<<<<<  should be outside the array
    "prefix":"2.2.2.2/32",
    "version":1,
    "advertisedTo":{
      "192.168.122.12":{
        "hostname":"ub20-2"
      }
    }
  },
  {
    "aspath":{
      "string":"Local",
      "segments":[
      ],
      "length":0
    },
<snip>
```

After:
```
ub20# show ip bgp json detail
{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 3,
 "routerId": "100.64.0.222",
 "defaultLocPrf": 100,
 "localAS": 1,
 "routes": { "2.2.2.2/32": {
"prefix": "2.2.2.2/32",
"version": "1",
"advertisedTo": {
  "192.168.122.12":{
    "hostname":"ub20-2"
  }
}
,"paths": [
  {
    "aspath":{
      "string":"Local",
      "segments":[
      ],
      "length":0
    },
```

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
14 months agopimd: Remove impossible situation
Donald Sharp [Thu, 16 Feb 2023 14:17:20 +0000 (09:17 -0500)]
pimd: Remove impossible situation

Coverity complains that MLAG_MSG_NONE cannot be reached in
the switch statement.  Which is true so let's make it happy.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agozebra: Ensure bvlan is non null
Donald Sharp [Thu, 16 Feb 2023 14:06:59 +0000 (09:06 -0500)]
zebra: Ensure bvlan is non null

Coverity rightly points out that a call into zebra_l2_bridge_if_vlan_find
is NULL checked 4/5 times.  Let's make it 5/5

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agolib: Fix non-use of option
Donald Sharp [Thu, 2 Feb 2023 21:28:27 +0000 (16:28 -0500)]
lib: Fix non-use of option

Commit d7c6467ba2f55d1055babbb7fe82716ca3efdc7e added the
ability to specify non pretty printing but unfortunately
forgot to use the option variable to make the whole
thing work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agodoc: Add `show ipv6 rpf X:X::X:X` command to docs
Donald Sharp [Mon, 13 Feb 2023 17:29:17 +0000 (12:29 -0500)]
doc: Add `show ipv6 rpf X:X::X:X` command to docs

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agozebra: Remove code duplication for v4 and v6 versions of rib_match_multicast
Donald Sharp [Mon, 13 Feb 2023 17:13:42 +0000 (12:13 -0500)]
zebra: Remove code duplication for v4 and v6 versions of rib_match_multicast

a) Consolidate v4 and v6 versions of rib_match_multicast
b) Improve debug to show what we matched against as well.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agozebra: Add debug for bridge capability
vivek [Tue, 13 Apr 2021 19:12:40 +0000 (12:12 -0700)]
zebra: Add debug for bridge capability

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
Ticket: #2609944

14 months agobgpd: Prevent multipathing among EVPN and non-EVPN paths
vivek [Fri, 18 Dec 2020 18:55:40 +0000 (10:55 -0800)]
bgpd: Prevent multipathing among EVPN and non-EVPN paths

Ensure that a multipath set is fully comprised of EVPN paths (i.e.,
paths imported into the VRF from EVPN address-family) or non-EVPN
paths. This is actually a condition that existed already in the code
but was not properly enforced.

This change, as a side effect, eliminates the known trigger condition
for bad or missing RMAC programming in an EVPN deployment, described
in tickets CM-29043 and CM-31222. Routes (actually, paths) in a VRF
routing table that require VXLAN tunneling to the next hop currently
need some special handling in zebra to deal with the nexthop (neigh)
and RMAC programming, and this is implemented for the entire route
(prefix), not per-path. This can lead to the bad or missing RMAC
situation, which is now eliminated by ensuring all paths in the route
are 'similar'.

The longer-term solution in CL 5.x will be to deal with the special
programming by means of explicit communication between bgpd and zebra.
This is already implemented for EVPN-MH via CM-31398. These changes
will be extended to non-MH also and the special code in zebra removed
or refined.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
Acked-by: Trey Aspelund <taspelund@nvidia.com>
Acked-by: Anuradha Karuppiah <anuradhak@nvidia.com>
Acked-by: Chirag Shah <chirag@nvidia.com>
Ticket: CM-29043
Testing Done:
1. Manual testing
2. precommit on both MLX and BCM platforms
3. evpn-smoke - BCM and VX

Results described in the ticket

14 months agobgpd: Fix deterministic-med check for stale paths
vivek [Thu, 3 Dec 2020 04:04:19 +0000 (20:04 -0800)]
bgpd: Fix deterministic-med check for stale paths

When performing deterministic MED processing, ensure that the peer
status is not checked when we encounter a stale path. Otherwise, this
path will be skipped from the DMED consideration leading to it potentially
not being installed.

Test scenario: Consider a prefix with 2 (multi)paths. The peer that
announces the path with the winning DMED undergoes a graceful-restart.
Before it comes back up, the other path goes away. Prior to the fix, a
third router that receives both these paths would have ended up not
having any path installed to the prefix after the above events.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
For internal use:
Ticket: CM-32032
Testing done: Multiple manual testing

14 months agobgpd: BGP troubleshooting - Add a keyword self-originate to display only self-origina...
Karl Quan [Tue, 14 Feb 2023 15:54:59 +0000 (07:54 -0800)]
bgpd: BGP troubleshooting - Add a keyword self-originate to display only self-originated prefixes when looking at the BGP table for a given address-family

Add a keyword self-originate" to extend current CLI commands to filter out self-originated routes only

a\) CLI to show ipv4/ipv6 self-originated routes
"show [ip] bgp [afi] [safi] [all] self-originate [wide|json]"

b\) CLI to show evpn self-originated routes
    "show bgp l2vpn evpn route [detail] [type <ead|macip|multicast|es|prefix|1|2|3|4|5>] self-originate [json]"

Signed-off-by: Karl Quan <kquan@nvidia.com>
14 months agoMerge pull request #12794 from anlancs/fix/doc-pid-path
Donatas Abraitis [Wed, 15 Feb 2023 22:04:19 +0000 (00:04 +0200)]
Merge pull request #12794 from anlancs/fix/doc-pid-path

doc: correct the pid path for daemons

14 months agoMerge pull request #12807 from donaldsharp/cleanup_local_pref
Donatas Abraitis [Wed, 15 Feb 2023 21:36:49 +0000 (23:36 +0200)]
Merge pull request #12807 from donaldsharp/cleanup_local_pref

bgpd: Remove unnecessary all_digit() call

14 months agobgpd: Add BGP Software Version Capability
Donatas Abraitis [Sat, 25 Feb 2023 07:00:23 +0000 (07:00 +0000)]
bgpd: Add BGP Software Version Capability

Implement: https://datatracker.ietf.org/doc/html/draft-abraitis-bgp-version-capability

Tested with GoBGP:

```
% ./gobgp neighbor 192.168.10.124
BGP neighbor is 192.168.10.124, remote AS 65001
  BGP version 4, remote router ID 200.200.200.202
  BGP state = ESTABLISHED, up for 00:01:49
  BGP OutQ = 0, Flops = 0
  Hold time is 3, keepalive interval is 1 seconds
  Configured hold time is 90, keepalive interval is 30 seconds

  Neighbor capabilities:
    multiprotocol:
        ipv4-unicast: advertised and received
        ipv6-unicast: advertised
    route-refresh: advertised and received
    extended-nexthop: advertised
        Local:  nlri: ipv4-unicast, nexthop: ipv6
    UnknownCapability(6): received
    UnknownCapability(9): received
    graceful-restart: advertised and received
        Local: restart time 10 sec
    ipv6-unicast
    ipv4-unicast
        Remote: restart time 120 sec, notification flag set
    ipv4-unicast, forward flag set
    4-octet-as: advertised and received
    add-path: received
      Remote:
         ipv4-unicast: receive
    enhanced-route-refresh: received
    long-lived-graceful-restart: advertised and received
        Local:
    ipv6-unicast, restart time 10 sec
    ipv4-unicast, restart time 20 sec
        Remote:
    ipv4-unicast, restart time 0 sec, forward flag set
    fqdn: advertised and received
      Local:
         name: donatas-pc, domain:
      Remote:
         name: spine1-debian-11, domain:
    software-version: advertised and received
      Local:
         GoBGP/3.10.0
      Remote:
         FRRouting/8.5-dev-MyOwnFRRVersion-gdc92f44a45-dirt
    cisco-route-refresh: received
  Message statistics:
```

FRR side:

```
root@spine1-debian-11:~# vtysh -c 'show bgp neighbor 192.168.10.17 json' | \
> jq '."192.168.10.17".neighborCapabilities.softwareVersion.receivedSoftwareVersion'
"GoBGP/3.10.0"
root@spine1-debian-11:~#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agotests: Increase flags from uint32_t to uint64_t
Donatas Abraitis [Fri, 27 Jan 2023 11:49:16 +0000 (13:49 +0200)]
tests: Increase flags from uint32_t to uint64_t

Missed this part when increasing in the past.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agobgpd: clarify when the vpnv6 nexthop length must be modified
Philippe Guibert [Mon, 13 Feb 2023 11:18:33 +0000 (12:18 +0100)]
bgpd: clarify when the vpnv6 nexthop length must be modified

Using a route-map to update the local ipv6 address has to be
better clarified. Actually, when a VPN SAFI is used, the nexthop
length must be changed to 48 bytes. Other cases, the length will
be 32 bytes.

Fixes: 9795e9f23465 ("bgpd: fix when route-map changes the link local
nexthop for vpnv6")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
14 months agobgpd: factorise ipv6 vpn nexthop encoding
Philippe Guibert [Mon, 13 Feb 2023 11:17:28 +0000 (12:17 +0100)]
bgpd: factorise ipv6 vpn nexthop encoding

Because mp_nexthop_len attribute value stands for the length
to encode in the stream, simplify the way the nexthop is
forged.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
14 months agozebra: Fix other table inactive when ip import-table is on
zyxwvu Shi [Wed, 15 Feb 2023 15:55:00 +0000 (23:55 +0800)]
zebra: Fix other table inactive when ip import-table is on

In `rib_link`, if is_zebra_import_table_enabled returns
true, `rib_queue_add` will not called, resulting in other
table route node never processed. This actually should not
be dependent on whether the route is imported.

In `rib_delnode`, if is_zebra_import_table_enabled returns
true, it will use `rib_unlink` instead of enqueuing the
route node for process. There is no reason that imported
route nodes should not be reprocessed. Long ago, the
behaviour was dependent on whether the route_entry comes
from a table other than main.

Signed-off-by: zyxwvu Shi <i@shiyc.cn>
14 months agoMerge pull request #12802 from sri-mohan1/sri-bable
Donald Sharp [Wed, 15 Feb 2023 12:24:35 +0000 (07:24 -0500)]
Merge pull request #12802 from sri-mohan1/sri-bable

babeld: changes for code maintainability

14 months agoMerge pull request #12494 from louis-6wind/ext_admin_group
Olivier Dugeon [Wed, 15 Feb 2023 08:42:03 +0000 (09:42 +0100)]
Merge pull request #12494 from louis-6wind/ext_admin_group

lib,zebra,isisd: add support for extended admin group RFC7308

14 months agobgpd: Remove unnecessary all_digit() call
Donald Sharp [Tue, 14 Feb 2023 20:26:44 +0000 (15:26 -0500)]
bgpd: Remove unnecessary all_digit() call

The call for all_digit is unnecessary as that the local preference
must be entered as a digit.  In other words you cannot get to this
point without the string being all digits.  This check is unnecessary.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agoMerge pull request #12728 from opensourcerouting/feature/bgp_neighbor_path-attribute_...
Russ White [Tue, 14 Feb 2023 16:22:16 +0000 (11:22 -0500)]
Merge pull request #12728 from opensourcerouting/feature/bgp_neighbor_path-attribute_treat_as_withdraw

bgpd: Add neighbor path-attribute treat-as-withdraw command

14 months agoMerge pull request #12789 from donaldsharp/version_cleanup
David Lamparter [Tue, 14 Feb 2023 16:19:07 +0000 (17:19 +0100)]
Merge pull request #12789 from donaldsharp/version_cleanup

14 months agoMerge pull request #12796 from donaldsharp/routemap_debugging
Russ White [Tue, 14 Feb 2023 14:35:06 +0000 (09:35 -0500)]
Merge pull request #12796 from donaldsharp/routemap_debugging

Routemap debugging

14 months agoMerge pull request #12790 from donaldsharp/vrrp_crash
Russ White [Tue, 14 Feb 2023 14:29:42 +0000 (09:29 -0500)]
Merge pull request #12790 from donaldsharp/vrrp_crash

vrrpd: give null when using null ifp to lookup vr

14 months agoMerge pull request #12364 from sworleys/SVD-DVNI-PR
Russ White [Tue, 14 Feb 2023 14:16:41 +0000 (09:16 -0500)]
Merge pull request #12364 from sworleys/SVD-DVNI-PR

Single Vxlan Device/Multiple Vlan Aware Bridges/Downstream VNI

14 months agobabeld: changes for code maintainability
sri-mohan1 [Tue, 14 Feb 2023 10:29:29 +0000 (15:59 +0530)]
babeld: changes for code maintainability

These changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
14 months agodoc: correct the pid path for daemons
anlan_cs [Mon, 13 Feb 2023 06:35:34 +0000 (14:35 +0800)]
doc: correct the pid path for daemons

Adjust doc:
1. Correct the pid path for daemons
2. Add empty line before `kill` command
3. Remove one useless line in "ripd.rst"

Signed-off-by: anlan_cs <vic.lan@pica8.com>
14 months agotests: add iproute2 API guard to svd test
Stephen Worley [Mon, 13 Feb 2023 23:09:54 +0000 (18:09 -0500)]
tests: add iproute2 API guard to svd test

Add a iproute2 API guard to the SVD test using `bridge fdb get`.

While it SHOULD be present on most systems based on their kernel
version it may not be present due to kernel/iproute2 version mismatch
weirdness.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agotests: fix SVD topotest, new evpn vni json output
Stephen Worley [Thu, 9 Feb 2023 21:45:46 +0000 (16:45 -0500)]
tests: fix SVD topotest, new evpn vni json output

The output of `show evpn vni [VNI] json` changed,
so updated the test with the new keys/output.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agodoc: remove "new way" for SVD docs
Stephen Worley [Thu, 9 Feb 2023 20:34:38 +0000 (15:34 -0500)]
doc: remove "new way" for SVD docs

remove "new way" for SVD docs as this could become
stale and become the "old way" at some point.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agotests: add topotest to cover SVD flood entry
Stephen Worley [Thu, 9 Feb 2023 20:30:32 +0000 (15:30 -0500)]
tests: add topotest to cover SVD flood entry

Add a topotest to cover making sure SVD flood entries
are installed with SVD.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: add VNI info to flood entry
Stephen Worley [Thu, 9 Feb 2023 19:57:31 +0000 (14:57 -0500)]
zebra: add VNI info to flood entry

When we are installing the flood entry for a vtep in SVD,
ensure VNI is set on the ctx object so that it gets
sent to the kernel and set appropriately with src_vni.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: Fix for mcast-group update and delete per vni for svd
sharathr [Tue, 19 Oct 2021 11:01:50 +0000 (04:01 -0700)]
zebra: Fix for mcast-group update and delete per vni for svd

Ticket: 2698649
Testing Done: precommit and evpn-min

Problem:
When the mcast-group is updated, the changes were being read from the netlink
and populated by zebra, but when kernel sends the delete of fdb delete for the
group, we are deleting the mcast-group that we newly updated. This is because,
currently we blindly reset the mcast-group during fdb delete without checking
for mcast-group associated to the vni.

Fix is to separate add/update and delete mcast-group functions and to check
for mcast-group before resetting during delete.

Signed-off-by: sramamurthy <sramamurthy@nvidia.com>
14 months agozebra: fix for unexpected fdb entry showing up during ifdown/ifup events
sharathr [Fri, 8 Oct 2021 14:27:50 +0000 (07:27 -0700)]
zebra: fix for unexpected fdb entry showing up during ifdown/ifup events

Ticket: 2674793
Testing Done:  precommit, evpn-min and evpn-smoke

The problem in this case is whenever we are triggering ifdown
followed by ifup of bridge, we see that remote mac entries
are programmed with vlan-1 in the fdb from zebra and never cleaned up.
bridge has vlan_default_pvid 1 which means any port that gets added
will initially have vlan 1 which then gets deleted by ifupdown2 and
the proper vlan gets added.

The problem lies in zebra where we are not cleaning up the remote
macs during vlan change.

Fix is to uninstall the remote macs and then install them
during vlan change.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: Clean remote FDB entries upon VNI removal
vivek [Mon, 26 Apr 2021 05:37:48 +0000 (22:37 -0700)]
zebra: Clean remote FDB entries upon VNI removal

When the VLAN-VNI mapping is configured via a map and not using
individual VXLAN interfaces, upon removal of a VNI ensure that the
remote FDB entries are uninstalled correctly.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
Ticket: #2613048
Reviewed By:
Testing Done:
1. Manual verification - logs in the ticket
2. Precommit (user job #171) and evpn-min (user job #170)

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: svd and mvab bug fixes
sharathr [Thu, 23 Sep 2021 07:17:57 +0000 (00:17 -0700)]
zebra: svd and mvab bug fixes

Ticket: 27303282724075
Reviewed By: CCR-11741, CCR-11746
Testing Done: Unit Test

2730328: At high bridge-vids count, VNI devices are not added in FRR if
FRR restarts after loading e/n/i
The issue is the wrt buffer overflow for netlink_recv_msg.
We have defined the kernel recv message buffer in stack which is of size 32768 (32K).

When the configuration is applied without FRR restart things work fine
because the recv message from kernel is well within the limit of 32K.
However with this configuration, when the FRR was restarted I could see that
some recv messages were crossing the 32K limit and hence weren't processed.
Below error logs were seen when frr was restarted with the confuguration.
2021/08/09 05:59:55 ZEBRA: [EC 4043309092] netlink-cmd (NS 0) error: data remnant size 32768
Fix is to increase the buffer size by another 2K

2724075: evpn mh/SVD - some of the remote neighs/macs aren't installed
in kernel post ifdown/ifup bridge

The issue was specific to SVD. During ifdown/ifup of the bridge,
I could see that the access-bd was not associated with the vni and hence
the remote neighs were not getting programmed in the kernel.
Fix is to reference (or associate) vxlan vni to the access-bd when
the vni is reported up. With this fix, I was able to see the remote
neighs getting programmed to the kernel.

Signed-off-by: Sharath Ramamurthy <sramamurthy@nvidia.com>
14 months agolib: make htonll/ntohll compile time and readable
Stephen Worley [Sat, 10 Dec 2022 00:27:20 +0000 (19:27 -0500)]
lib: make htonll/ntohll compile time and readable

Make the htonll/ntohll functions compile time determined
since we have MACROS to determine endianess and bonus
points it makes it more readable.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agolib: remove unneeded parans on labl2str return
Stephen Worley [Sat, 10 Dec 2022 00:02:03 +0000 (19:02 -0500)]
lib: remove unneeded parans on labl2str return

Remove unneeded parans on labl2str return.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: clang-format style fixes
Stephen Worley [Fri, 9 Dec 2022 23:51:22 +0000 (18:51 -0500)]
zebra: clang-format style fixes

clang-format style fixes

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agosharpd: clang-format style fix
Stephen Worley [Fri, 9 Dec 2022 23:49:54 +0000 (18:49 -0500)]
sharpd: clang-format style fix

clang-format style fix

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: ignore GETVLAN errors at startup
Stephen Worley [Fri, 9 Dec 2022 23:40:37 +0000 (18:40 -0500)]
zebra: ignore GETVLAN errors at startup

ignore GETVLAN errors at startup like we are doing
for nexthop groups. Older platforms don't support the API.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agolib: add asserts to appease the SA
Stephen Worley [Fri, 9 Dec 2022 22:42:56 +0000 (17:42 -0500)]
lib: add asserts to appease the SA

I don't believe label can be NULL in any calling path
but SA thinks so so let's just assert here to be safe
anyway and make it happy.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agobgpd: SA set labels/num_labels to NULL/0
Stephen Worley [Fri, 9 Dec 2022 22:23:32 +0000 (17:23 -0500)]
bgpd: SA set labels/num_labels to NULL/0

Static Analysis caught a bug where we could be reading
garbage values for labels/num_lables. Fix that by
ensuring it's set to NULL/0 per loop of the mpath.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: state value never used SA fix
Stephen Worley [Fri, 9 Dec 2022 22:19:33 +0000 (17:19 -0500)]
zebra: state value never used SA fix

SA caught a value that wasn't being used after set. Remove it.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: log if RTNLGRP_BRVLAN register fails
Stephen Worley [Fri, 9 Dec 2022 21:59:34 +0000 (16:59 -0500)]
zebra: log if RTNLGRP_BRVLAN register fails

Log a notice if the RTNLGRP_BRVLAN netlink membership registration
fails.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: ignore zero_mac without VNI deletes
Stephen Worley [Tue, 22 Nov 2022 21:41:54 +0000 (16:41 -0500)]
zebra: ignore zero_mac without VNI deletes

Ignore zebra_mac updates if they do not contain a VNI for vxlan
interface. We don't have anything we can do with them.

'''
==443593== Process terminating with default action of signal 6 (SIGABRT): dumping core
==443593==    at 0x4E1156C: __pthread_kill_implementation (in /usr/lib64/libc.so.6)
==443593==    by 0x4DC4D15: raise (in /usr/lib64/libc.so.6)
==443593==    by 0x49823C7: core_handler (sigevent.c:261)
==443593==    by 0x4DC4DBF: ??? (in /usr/lib64/libc.so.6)
==443593==    by 0x4E1156B: __pthread_kill_implementation (in /usr/lib64/libc.so.6)
==443593==    by 0x4DC4D15: raise (in /usr/lib64/libc.so.6)
==443593==    by 0x4D987F2: abort (in /usr/lib64/libc.so.6)
==443593==    by 0x49C3064: _zlog_assert_failed (zlog.c:700)
==443593==    by 0x4F5E6D: zebra_vxlan_if_vni_find (zebra_vxlan_if.c:661)
==443593==    by 0x4EEAC3: zebra_vxlan_check_readd_vtep (zebra_vxlan.c:4244)
==443593==    by 0x450967: netlink_macfdb_change (rt_netlink.c:3722)
==443593==    by 0x450011: netlink_neigh_change (rt_netlink.c:4458)
'''

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agotests: fix mpls_label2str() in make check
Stephen Worley [Mon, 21 Nov 2022 23:43:26 +0000 (18:43 -0500)]
tests: fix mpls_label2str() in make check

Fix ospfd unit tests in make check that had not been
updated to the new lib function.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agodoc: add docs for `show evpn access-vlan`
Stephen Worley [Mon, 21 Nov 2022 22:58:48 +0000 (17:58 -0500)]
doc: add docs for `show evpn access-vlan`

Add docs for `show evpn access-vlan`

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agotests: skip SVD/DVNI tests for < 5.7 kernel
Stephen Worley [Mon, 21 Nov 2022 22:15:31 +0000 (17:15 -0500)]
tests: skip SVD/DVNI tests for < 5.7 kernel

Skip the SVD/DVNI topotests if the kernel version is
not at least 5.7.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agotests: add first dvni topotests
Stephen Worley [Mon, 21 Nov 2022 22:03:07 +0000 (17:03 -0500)]
tests: add first dvni topotests

Add first of dvni topotests. Covers just basic usage of importing
wildcard VNI and installing it via lwt encap.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: encode dvni with nexthop groups
Stephen Worley [Mon, 21 Nov 2022 16:23:18 +0000 (11:23 -0500)]
zebra: encode dvni with nexthop groups

Move dvni encoding to common code and add support
for encoding it using nexthop groups.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: account for non-evpn ecmp
Stephen Worley [Wed, 16 Nov 2022 18:15:32 +0000 (13:15 -0500)]
zebra: account for non-evpn ecmp

Account for non-evpn nexthops in ecmp groups when
doing the DVNI check.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: use new vni_info->access_vlan structs
Stephen Worley [Wed, 31 Aug 2022 16:35:57 +0000 (12:35 -0400)]
zebra: use new vni_info->access_vlan structs

Use new vni_info->access_vlan struct accessors
for network mac add code.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: handle ipv6-mapped-ipv4 with DVNI
Stephen Worley [Tue, 15 Jun 2021 03:43:05 +0000 (23:43 -0400)]
zebra: handle ipv6-mapped-ipv4 with DVNI

Properly handle ipv6-mapped-ipv4 with DVNI by converting
the address to ipv4 and setting that as the DST field for
the encap.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: make next-hop svd command hidden for now
Stephen Worley [Fri, 11 Jun 2021 19:31:20 +0000 (15:31 -0400)]
zebra: make next-hop svd command hidden for now

The `show evpn next-hop svd *` command doesn't provide much
for users right now. Make it hidden so we can still debug
the tables with it.

Also remove SVD output from `show evpn next-hop vni all`.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
14 months agozebra: dont install implicit NULL labels non-vni
Stephen Worley [Fri, 4 Jun 2021 15:50:40 +0000 (11:50 -0400)]
zebra: dont install implicit NULL labels non-vni

Don't install implict NULL labels with non-vni label'd
routes.

This returns behavior to how it was before adding the DVNI code.

Ticket: #2677036
Testing Done: precommit, manual
Signed-off-by: Stephen Worley <sworley@nvidia.com>