]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
13 months agoMerge pull request #13389 from anlancs/fix/pimd-wrong-mrt-sockopt
Donald Sharp [Tue, 2 May 2023 13:21:24 +0000 (09:21 -0400)]
Merge pull request #13389 from anlancs/fix/pimd-wrong-mrt-sockopt

pimd: Fix wrong setsockopt() call

13 months agoMerge pull request #13393 from opensourcerouting/fix/topotest_bgp_bfd_down_cease_noti...
Donald Sharp [Tue, 2 May 2023 12:42:43 +0000 (08:42 -0400)]
Merge pull request #13393 from opensourcerouting/fix/topotest_bgp_bfd_down_cease_notification

tests: Do not try establishing a connection from r1 to r2

13 months agoMerge pull request #13395 from LabNConsulting/chopps/mgmtd-debug-flags
Donald Sharp [Tue, 2 May 2023 12:17:17 +0000 (08:17 -0400)]
Merge pull request #13395 from LabNConsulting/chopps/mgmtd-debug-flags

mgmtd: fully implement debug flags for mgmtd and clients

13 months agoMerge pull request #13405 from dmytroshytyi-6WIND/srv6_bgp_no_sid_export_auto
Donatas Abraitis [Mon, 1 May 2023 19:07:03 +0000 (22:07 +0300)]
Merge pull request #13405 from dmytroshytyi-6WIND/srv6_bgp_no_sid_export_auto

bgpd, tests: srv6 "no sid vpn export auto" per AF in vtysh

13 months agoMerge pull request #13408 from pguibert6WIND/flowspec_sanity
Donatas Abraitis [Mon, 1 May 2023 18:58:53 +0000 (21:58 +0300)]
Merge pull request #13408 from pguibert6WIND/flowspec_sanity

bgpd: add some flowspec sanity returns

13 months agoMerge pull request #13409 from chiragshah6/fdev1
Donatas Abraitis [Mon, 1 May 2023 18:55:38 +0000 (21:55 +0300)]
Merge pull request #13409 from chiragshah6/fdev1

zebra:add df flag into evpn esi json output

13 months agomgmtd: fully implement debug flags for mgmtd and clients
Christian Hopps [Wed, 26 Apr 2023 21:50:46 +0000 (17:50 -0400)]
mgmtd: fully implement debug flags for mgmtd and clients

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agoMerge pull request #13406 from LabNConsulting/chopps/log-timestamp-buildopt
Donald Sharp [Mon, 1 May 2023 13:51:46 +0000 (09:51 -0400)]
Merge pull request #13406 from LabNConsulting/chopps/log-timestamp-buildopt

startup log timestamp precision build option

13 months agotests: change topotest log timestamp precision to 6.
Christian Hopps [Fri, 28 Apr 2023 15:11:41 +0000 (11:11 -0400)]
tests: change topotest log timestamp precision to 6.

- Often millisecond precision is not good enough to differentiate things that
occur directly one after another, and things that have some pause in between,
increase to microsecond precision (reporting)

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agolib: add build option to set startup log timestemp precision
Christian Hopps [Fri, 28 Apr 2023 15:10:56 +0000 (11:10 -0400)]
lib: add build option to set startup log timestemp precision

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agozebra:add df flag into evpn esi json output
Sindhu Parvathi Gopinathan [Fri, 28 Apr 2023 12:28:58 +0000 (05:28 -0700)]
zebra:add df flag into evpn esi json output

FRR "show evpn es 'esi-id' json" output dont have the 'df' flag.

Modified the code to add the 'df' flag into json output.

Before Fix:

```
torm-11# show evpn es 03:44:38:39:ff:ff:01:00:00:01 json
{
  "esi":"03:44:38:39:ff:ff:01:00:00:01",
  "accessPort":"hostbond1",
  "flags":[
    "local",
    "remote",
    "readyForBgp",
    "bridgePort",
    "operUp",
    "nexthopGroupActive"
 ====================> df is missing
  ],
  "vniCount":10,
  "macCount":13,
  "dfPreference":50000,
  "nexthopGroup":536870913,
  "vteps":[
    {
      "vtep":"27.0.0.16",
      "dfAlgorithm":"preference",
      "dfPreference":32767,
      "nexthopId":268435460
    },
    {
      "vtep":"27.0.0.17",
      "dfAlgorithm":"preference",
      "dfPreference":32767,
      "nexthopId":268435461
    }
  ]
}
torm-11#
```

After Fix:-

```
torm-11# show evpn es 03:44:38:39:ff:ff:01:00:00:01 json
{
  "esi":"03:44:38:39:ff:ff:01:00:00:01",
  "accessPort":"hostbond1",
  "flags":[
    "local",
    "remote",
    "readyForBgp",
    "bridgePort",
    "operUp",
    "nexthopGroupActive",
    "df" ========================> designated-forward flag added
  ],
  "vniCount":10,
  "macCount":13,
  "dfPreference":50000,
  "nexthopGroup":536870913,
  "vteps":[
    {
      "vtep":"27.0.0.16",
      "dfAlgorithm":"preference",
      "dfPreference":32767,
      "nexthopId":268435460
    },
    {
      "vtep":"27.0.0.17",
      "dfAlgorithm":"preference",
      "dfPreference":32767,
      "nexthopId":268435461
    }
  ]
}
torm-11#

```

Ticket:# 3447935

Issue: 3447935

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
13 months agotests: validate sid export per-vrf and per-af
Dmytro Shytyi [Fri, 21 Apr 2023 12:24:33 +0000 (14:24 +0200)]
tests: validate sid export per-vrf and per-af

Verify activation and desactivation of per-vrf and per-af
sid export. Modify the configuration of r2 and verify that
changes are reflected in r1 and on connectivity between ce1 and c2.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
13 months agobgpd: implement "no sid vpn export auto" per AF in vtysh
Dmytro Shytyi [Fri, 21 Apr 2023 12:00:48 +0000 (14:00 +0200)]
bgpd: implement "no sid vpn export auto" per AF in vtysh

An example of implemented command for IPv4 AF is presented below.

dev-vm(config-router-af)# do show bgp segment-routing srv6
locator_name: Locator1
locator_chunks:
- 2001:db8:2:5::/64
  block-length: 40
  node-length: 24
  func-length: 16
  arg-length: 0
functions:
bgps:
- name: default
  vpn_policy[AFI_IP].tovpn_sid: (null)
  vpn_policy[AFI_IP6].tovpn_sid: (null)
  per-vrf tovpn_sid: (null)
- name: red
  vpn_policy[AFI_IP].tovpn_sid: (null)
  vpn_policy[AFI_IP6].tovpn_sid: (null)
  per-vrf tovpn_sid: (null)
dev-vm(config-router-af)# sid vpn export auto
^^^<<<<<<<<<<<<<<<<<<<<<< 1. configure sid per af
dev-vm(config-router-af)# do show bgp segment-routing srv6
locator_name: Locator1
locator_chunks:
- 2001:db8:2:5::/64
  block-length: 40
  node-length: 24
  func-length: 16
  arg-length: 0
functions:
- sid: 2001:db8:2:5:1::
  locator: Locator1
bgps:
- name: default
  vpn_policy[AFI_IP].tovpn_sid: (null)
  vpn_policy[AFI_IP6].tovpn_sid: (null)
  per-vrf tovpn_sid: (null)
- name: red
  vpn_policy[AFI_IP].tovpn_sid: 2001:db8:2:5:1::
^^^<<<<<<<<<<<<<<<<<<<<< 2. sid is configured
  vpn_policy[AFI_IP6].tovpn_sid: (null)
  per-vrf tovpn_sid: (null)
dev-vm(config-router-af)# no sid vpn export auto
^^^<<<<<<<<<<<<<<<<<<<< 3. deconfigure sid per af
dev-vm(config-router-af)# do show bgp segment-routing srv6
locator_name: Locator1
locator_chunks:
- 2001:db8:2:5::/64
  block-length: 40
  node-length: 24
  func-length: 16
  arg-length: 0
functions:
bgps:
- name: default
  vpn_policy[AFI_IP].tovpn_sid: (null)
  vpn_policy[AFI_IP6].tovpn_sid: (null)
  per-vrf tovpn_sid: (null)
- name: red
  vpn_policy[AFI_IP].tovpn_sid: (null)
^^^<<<<<<<<<<<<<<<<<<< 4. sid is deconfigured
  vpn_policy[AFI_IP6].tovpn_sid: (null)
  per-vrf tovpn_sid: (null)

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
13 months agobgpd: add some flowspec sanity returns
Philippe Guibert [Fri, 28 Apr 2023 19:56:19 +0000 (21:56 +0200)]
bgpd: add some flowspec sanity returns

If an error is detected in an NLRI, immediately return
an error, when there is a risk of buffer overflow.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
13 months agoMerge pull request #13407 from cscarpitta/fix/fix-srv6l3vpn-topotest
Donald Sharp [Fri, 28 Apr 2023 17:49:06 +0000 (13:49 -0400)]
Merge pull request #13407 from cscarpitta/fix/fix-srv6l3vpn-topotest

tests: Fix `bgp_srv6l3vpn_to_bgp_vrf3` topotest

13 months agotests: Fix `bgp_srv6l3vpn_to_bgp_vrf3` topotest
Carmine Scarpitta [Fri, 28 Apr 2023 15:11:32 +0000 (17:11 +0200)]
tests: Fix `bgp_srv6l3vpn_to_bgp_vrf3` topotest

The `bgp_srv6l3vpn_to_bgp_vrf3` topotest tests the SRv6 L3VPN
functionality. It applies the appropriate configuration in `bgpd` and
`zebra`, and then checks that the RIB is updated correctly.

The topotest expects to find the AS-Path in the RIB, which is only
present if the `bgp send-extra-data zebra` option is enabled in the
`bgpd` configuration.

The `bgp send-extra-data zebra` option has been accidentally commented
out in commit https://github.com/FRRouting/frr/commit/2007e2dbd0d5c42d9fe6cbe92b34be10654834ef.

This commit fixes the `bgp_srv6l3vpn_to_bgp_vrf3` topotest by re-adding
the missing `bgp send-extra-data zebra` option.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
13 months agoMerge pull request #13335 from pguibert6WIND/bgp_lu_explicit_per_afi
Donatas Abraitis [Fri, 28 Apr 2023 13:27:20 +0000 (16:27 +0300)]
Merge pull request #13335 from pguibert6WIND/bgp_lu_explicit_per_afi

bgpd: configure explicit-null for local paths per address family

13 months agoMerge pull request #13379 from pguibert6WIND/bgp_nht_must_equal_zebra_nht
Donatas Abraitis [Fri, 28 Apr 2023 06:32:24 +0000 (09:32 +0300)]
Merge pull request #13379 from pguibert6WIND/bgp_nht_must_equal_zebra_nht

bgpd: keep interface index on bgp nexthop tracking

13 months agobgpd: configure explicit-null for local paths per address family
Philippe Guibert [Wed, 19 Apr 2023 14:40:50 +0000 (16:40 +0200)]
bgpd: configure explicit-null for local paths per address family

Until now, the bgp local paths were using the default null label
defined. It was not possible to select the null label for the ipv4
or the ipv6 address families.

This commit addresses this issues by adding two extra-parameters
to the BGP labeled-unicast command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
13 months agobgpd: keep interface index on bgp nexthop tracking
Philippe Guibert [Mon, 24 Apr 2023 20:33:15 +0000 (22:33 +0200)]
bgpd: keep interface index on bgp nexthop tracking

The following BGP configuration does not show that the
resolved next-hop to 192.0.2.1 has a defined interface.

> router bgp 65500
>  bgp router-id 192.0.2.2
>  neighbor 192.0.2.1 remote-as 65500
>  neighbor 192.0.2.1 update-source loop1
>  neighbor 192.168.0.1 remote-as 65500
>  !
>  address-family ipv4 unicast
>   network 192.0.2.2/32
>   no neighbor 192.168.0.1 activate
>  exit-address-family
>  !
>  address-family ipv4 labeled-unicast
>   neighbor 192.168.0.1 activate
>  exit-address-family
>  !
>  address-family ipv4 vpn
>   neighbor 192.0.2.1 activate
>  exit-address-family

The 'show bgp nexthop' dump does not output the interface
whereas the zebra rnh has the information.

> dut-vm# show bgp nexthop
> [..]
> Current BGP nexthop cache:
>  192.0.2.1 valid [IGP metric 0], #paths 1, peer 192.0.2.1
>   gate 192.168.0.1
>   Last update: Mon Apr 24 22:10:07 2023
>
> dut-vm# show ip nht
> 192.0.2.1
>  resolved via bgp
>  via 192.168.0.1, r2-eth0
>  Client list: bgp(fd 33)

Modify the display of BGP nexthop tracking to also dump
the interface used:

> dut-vm# show bgp nexthop
> [..]
> Current BGP nexthop cache:
>  192.0.2.1 valid [IGP metric 0], #paths 1, peer 192.0.2.1
>   gate 192.168.0.1, r2-eth0
>   Last update: Mon Apr 24 22:10:07 2023

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
13 months agopimd: Fix wrong setsockopt() call
anlan_cs [Wed, 26 Apr 2023 09:59:58 +0000 (17:59 +0800)]
pimd: Fix wrong setsockopt() call

`setsockopt()` should be only called once with `MRT_TABLE`
in "enable" case, otherwise it will fail.  In current code,
`mroute_socket` of "pim instance" with VRF can't be correctly
closed.

Skip it in the "disable" case to let `mroute_socket` safely
closed.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
13 months agotests: Do not try establishing a connection from r1 to r2
Donatas Abraitis [Wed, 26 Apr 2023 18:51:33 +0000 (21:51 +0300)]
tests: Do not try establishing a connection from r1 to r2

If r1 becomes the "server" (= local port 179), then it initiates the connection
after sending BGP Notification (BFD Down) and r2 resets the last error code.

Telling r1 do not connect to r2, fixes the issue.

Tested with `pytest -s -n 48` at least 20 times - no failures.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agoMerge pull request #13386 from donaldsharp/bgp_received_routes
Donatas Abraitis [Wed, 26 Apr 2023 08:07:00 +0000 (11:07 +0300)]
Merge pull request #13386 from donaldsharp/bgp_received_routes

bgpd: Fix `received-routes detail`

13 months agoMerge pull request #13368 from Keelan10/nhrpd-memory-leak
Donatas Abraitis [Wed, 26 Apr 2023 05:57:52 +0000 (08:57 +0300)]
Merge pull request #13368 from Keelan10/nhrpd-memory-leak

nhrpd: Fix nhrpd memory leak

13 months agobgpd: Fix `received-routes detail`
Donald Sharp [Tue, 25 Apr 2023 19:35:19 +0000 (15:35 -0400)]
bgpd: Fix `received-routes detail`

The command `show bgp ipv4 uni neigh A.B.C.D received-routes detail`
was not displaying anything.

Fix the code to display the received routes from the ones that
have been filtered.  In this case we need to fudge up a bgp_dest
and a bgp_path_info to make it work.

Old output:

janelle.pinkbelly.org# show bgp ipv4 uni neighbors 192.168.119.224 received-routes detail
BGP table version is 1711405, local router ID is 192.168.44.1, vrf id 0
Default local pref 100, local AS 64539

Total number of prefixes 3 (3 filtered)
janelle.pinkbelly.org#

New output:

janelle.pinkbelly.org# show bgp ipv4 uni neighbors 192.168.119.224 received-routes detail
BGP table version is 0, local router ID is 192.168.44.1, vrf id 0
Default local pref 100, local AS 64539
BGP routing table entry for 1.2.3.0/24, version 0
Paths: (1 available, no best path)
  Not advertised to any peer
  3291, (aggregated by 3291 192.168.122.1)
    192.168.119.224 (inaccessible, import-check enabled) from 192.168.119.224 (192.168.122.1)
      Origin IGP, metric 0, invalid, external, atomic-aggregate, rpki validation-state: not found
      Community: 55:66
      Last update: Fri Apr 14 08:46:48 2023
BGP routing table entry for 1.2.3.4/32, version 0
Paths: (1 available, no best path)
  Not advertised to any peer
  3291
    192.168.119.224 (inaccessible, import-check enabled) from 192.168.119.224 (192.168.122.1)
      Origin IGP, metric 0, invalid, external, rpki validation-state: not found
      Community: 33:44
      Last update: Fri Apr 14 08:46:48 2023
BGP routing table entry for 1.2.3.5/32, version 0
Paths: (1 available, no best path)
  Not advertised to any peer
  3291
    192.168.119.224 (inaccessible, import-check enabled) from 192.168.119.224 (192.168.122.1)
      Origin IGP, metric 0, invalid, external, rpki validation-state: not found
      Community: 33:44
      Last update: Fri Apr 14 08:46:48 2023

Total number of prefixes 3 (3 filtered)
janelle.pinkbelly.org# show bgp ipv4 uni
No BGP prefixes displayed, 0 exist
janelle.pinkbelly.org#

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agoMerge pull request #13374 from opensourcerouting/build-fix-rmap-yang
Mark Stapp [Tue, 25 Apr 2023 19:26:19 +0000 (15:26 -0400)]
Merge pull request #13374 from opensourcerouting/build-fix-rmap-yang

build: fix frr-if-rmap.yang model embedding

13 months agoMerge pull request #13246 from opensourcerouting/rip-bfd
Russ White [Tue, 25 Apr 2023 15:54:32 +0000 (11:54 -0400)]
Merge pull request #13246 from opensourcerouting/rip-bfd

ripd: support BFD integration

13 months agoMerge pull request #13326 from opensourcerouting/feature/rip_topotest_distribute_list
Russ White [Tue, 25 Apr 2023 15:07:31 +0000 (11:07 -0400)]
Merge pull request #13326 from opensourcerouting/feature/rip_topotest_distribute_list

ripd: Create non default passive interface if defined so

13 months agoMerge pull request #13310 from opensourcerouting/feature/bgpd_node_target_extended_co...
Russ White [Tue, 25 Apr 2023 15:06:23 +0000 (11:06 -0400)]
Merge pull request #13310 from opensourcerouting/feature/bgpd_node_target_extended_community

bgpd: Add Node Target Extended Communities support

13 months agoMerge pull request #13375 from LabNConsulting/chopps/fix-style-issues
Donald Sharp [Tue, 25 Apr 2023 11:28:46 +0000 (07:28 -0400)]
Merge pull request #13375 from LabNConsulting/chopps/fix-style-issues

lib: fix style warns and get rid of "!" for success

13 months agoMerge pull request #13373 from LabNConsulting/chopps/fix-pytestconfig
Donald Sharp [Mon, 24 Apr 2023 22:02:49 +0000 (18:02 -0400)]
Merge pull request #13373 from LabNConsulting/chopps/fix-pytestconfig

fix missed passing pytestconfig arg.

13 months agolib: fix style warns and get rid of "!" for success
Christian Hopps [Mon, 24 Apr 2023 15:20:48 +0000 (11:20 -0400)]
lib: fix style warns and get rid of "!" for success

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agobuild: fix frr-if-rmap.yang model embedding
David Lamparter [Mon, 24 Apr 2023 15:00:55 +0000 (17:00 +0200)]
build: fix frr-if-rmap.yang model embedding

This was missed somewhere along the line, causing ripd to not start.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
13 months agoMerge pull request #13149 from pushpasis/mgmt_cleanup_zlog
Christian Hopps [Mon, 24 Apr 2023 15:00:08 +0000 (11:00 -0400)]
Merge pull request #13149 from pushpasis/mgmt_cleanup_zlog

mgmtd, lib: Cleanup zlog_err()

13 months agoMerge pull request #13330 from chiragshah6/fdev1
Donatas Abraitis [Mon, 24 Apr 2023 13:51:10 +0000 (16:51 +0300)]
Merge pull request #13330 from chiragshah6/fdev1

zebra: EVPN handle duplicate detected local mac delete event

13 months agotests: fix missed passing pytestconfig arg
Christian Hopps [Mon, 24 Apr 2023 13:22:42 +0000 (09:22 -0400)]
tests: fix missed passing pytestconfig arg

Remove the local ConfigOptionProxy and actually use the munet one.

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agotests: import munet 0.13.2
Christian Hopps [Mon, 24 Apr 2023 13:47:23 +0000 (09:47 -0400)]
tests: import munet 0.13.2

fixed ConfigOptionsProxy bug

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agoMerge pull request #13365 from LabNConsulting/chopps/add-perf-option
Donald Sharp [Mon, 24 Apr 2023 11:38:45 +0000 (07:38 -0400)]
Merge pull request #13365 from LabNConsulting/chopps/add-perf-option

Add ability to profile daemons in topotest with --perf

13 months agoMerge pull request #13361 from LabNConsulting/chopps/munet-cfgopt-and-native
Donatas Abraitis [Mon, 24 Apr 2023 10:50:36 +0000 (13:50 +0300)]
Merge pull request #13361 from LabNConsulting/chopps/munet-cfgopt-and-native

cfgopt in munet and native config support and example

13 months agonhrpd: Fix nhrpd memory leak
Keelan10 [Mon, 24 Apr 2023 07:00:20 +0000 (11:00 +0400)]
nhrpd: Fix nhrpd memory leak

Free NHRP peers associated with an interface when NHS is deleted on shutdown

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
13 months agodoc: document --perf and --perf-options, and a bit of cleanup
Christian Hopps [Mon, 24 Apr 2023 01:56:38 +0000 (21:56 -0400)]
doc: document --perf and --perf-options, and a bit of cleanup

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agotests: add --perf and --perf-options for profiling daemons
Christian Hopps [Mon, 24 Apr 2023 01:53:44 +0000 (21:53 -0400)]
tests: add --perf and --perf-options for profiling daemons

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agoMerge pull request #13350 from opensourcerouting/typesafe-fixes-20230421
Donald Sharp [Sun, 23 Apr 2023 19:06:59 +0000 (15:06 -0400)]
Merge pull request #13350 from opensourcerouting/typesafe-fixes-20230421

lib: typesafe shenanigans

13 months agotests: add an example of using munet native config
Christian Hopps [Sun, 23 Apr 2023 12:26:41 +0000 (08:26 -0400)]
tests: add an example of using munet native config

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agotests: enable using munet native configs
Christian Hopps [Sun, 23 Apr 2023 12:25:51 +0000 (08:25 -0400)]
tests: enable using munet native configs

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agotests: munet now supports cfgopt directly
Christian Hopps [Sun, 23 Apr 2023 13:17:35 +0000 (09:17 -0400)]
tests: munet now supports cfgopt directly

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agotests: import munet version 0.13.1
Christian Hopps [Sun, 23 Apr 2023 05:29:49 +0000 (01:29 -0400)]
tests: import munet version 0.13.1

- adds more generic config option handling than pytestconfig
- Change to search order for kinds.yaml

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agoMerge pull request #13358 from zmw12306/ignore_nonzero_flags
Donald Sharp [Sun, 23 Apr 2023 11:25:30 +0000 (07:25 -0400)]
Merge pull request #13358 from zmw12306/ignore_nonzero_flags

13 months agoMerge pull request #13360 from LabNConsulting/chopps/munet-fixes
Donald Sharp [Sun, 23 Apr 2023 11:18:07 +0000 (07:18 -0400)]
Merge pull request #13360 from LabNConsulting/chopps/munet-fixes

13 months agotests: import munet version 0.12.16
Christian Hopps [Sun, 23 Apr 2023 05:29:49 +0000 (01:29 -0400)]
tests: import munet version 0.12.16

Fixes bad fixed path use and rootcmd functionality to run things
in the root namespace (all but pid at least).

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agoMerge pull request #13332 from LabNConsulting/chopps/new-opts
Donald Sharp [Sat, 22 Apr 2023 23:51:05 +0000 (19:51 -0400)]
Merge pull request #13332 from LabNConsulting/chopps/new-opts

13 months agobabeld: ignore nonzero flag bits in Hello TLVs
zmw12306 [Sat, 22 Apr 2023 19:11:13 +0000 (15:11 -0400)]
babeld: ignore nonzero flag bits in Hello TLVs

Ignore all other bits(except U) in Hello TLVs, according to RFC8966
Signed-off-by: zmw12306 <zmw12306@gmail.com>
13 months agodoc: document new pytest options and cli commands
Christian Hopps [Wed, 19 Apr 2023 09:40:54 +0000 (05:40 -0400)]
doc: document new pytest options and cli commands

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agomunet: import 0.12.15
Christian Hopps [Thu, 20 Apr 2023 23:21:59 +0000 (19:21 -0400)]
munet: import 0.12.15

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agotests: fix ASAN file cleanup and --asan-abort option
Christian Hopps [Sat, 22 Apr 2023 16:59:53 +0000 (12:59 -0400)]
tests: fix ASAN file cleanup and --asan-abort option

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agoMerge pull request #13349 from opensourcerouting/pim6-mld-coverity-20230421
Donald Sharp [Sat, 22 Apr 2023 15:02:51 +0000 (11:02 -0400)]
Merge pull request #13349 from opensourcerouting/pim6-mld-coverity-20230421

pimd: address some static analysis complaints

13 months agotests: will need new pid_exists if using pid namespaces
Christian Hopps [Fri, 21 Apr 2023 13:28:50 +0000 (09:28 -0400)]
tests: will need new pid_exists if using pid namespaces

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agotests: restore per-node logging functionality
Christian Hopps [Wed, 19 Apr 2023 11:57:42 +0000 (07:57 -0400)]
tests: restore per-node logging functionality

After the munet switch we weren't passing the logger on to low-level
LinuxNamespace and thus Commander parent classes, so the lowest-level
`cmd_status` logs were missing from more specific log files in the run
directory.

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agotests: fix check for daemon startup, remove sleep hack
Christian Hopps [Sat, 22 Apr 2023 01:59:33 +0000 (21:59 -0400)]
tests: fix check for daemon startup, remove sleep hack

- Remove the .pid and .vty files and then wait for them to show back up.
- Fix broken BGP GR test to not fail now that it's bug is exposed. It
only worked b/c when starting a daemon the pid file still existed and
blocked the bogus second BGP launch from happening.

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agotests: add --logd option
Christian Hopps [Wed, 19 Apr 2023 04:48:11 +0000 (00:48 -0400)]
tests: add --logd option

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agotests: add --pcap and --pause-at-end options
Christian Hopps [Wed, 19 Apr 2023 04:40:48 +0000 (00:40 -0400)]
tests: add --pcap and --pause-at-end options

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agotests: cleanup access to pytest config
Christian Hopps [Wed, 19 Apr 2023 08:55:04 +0000 (04:55 -0400)]
tests: cleanup access to pytest config

Rather than create a new global dict and copy all the config into it, just
expose the pytest config globally and use it directly.

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agotests: blacken re-format
Christian Hopps [Wed, 19 Apr 2023 08:20:45 +0000 (04:20 -0400)]
tests: blacken re-format

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agoMerge pull request #13347 from donaldsharp/bgp_before_light
David Lamparter [Fri, 21 Apr 2023 16:23:17 +0000 (18:23 +0200)]
Merge pull request #13347 from donaldsharp/bgp_before_light

13 months agoMerge pull request #13345 from donaldsharp/pim_after_dark
David Lamparter [Fri, 21 Apr 2023 16:22:39 +0000 (18:22 +0200)]
Merge pull request #13345 from donaldsharp/pim_after_dark

13 months agoMerge pull request #13348 from donaldsharp/dplane_before_after
David Lamparter [Fri, 21 Apr 2023 16:22:22 +0000 (18:22 +0200)]
Merge pull request #13348 from donaldsharp/dplane_before_after

13 months agolib: fix _hash_member() crash w/ empty hash
David Lamparter [Fri, 21 Apr 2023 14:23:39 +0000 (16:23 +0200)]
lib: fix _hash_member() crash w/ empty hash

The typesafe hash _member() didn't check tabshift/count before
proceeding to look at the hash table, leading it to dereference a NULL
pointer when the hash table is in fact empty.

Test case added to tests/lib/test_typelist.

Note this function is not currently used anywhere.  Only lib/cspf.c uses
_member(), but it does so on a RB-tree rather than a hash.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
13 months agolib: typesafe hash table breadcrumbs
David Lamparter [Fri, 21 Apr 2023 14:15:11 +0000 (16:15 +0200)]
lib: typesafe hash table breadcrumbs

Looking at the coverity report, it complains that tabshift could be
zero, resulting in a uint32_t shifted by 33 (which is undefined.)

As I was confused by the "+ 1", in addition to the SA assume(), leave
some breadcumbs for next time this comes up.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
13 months agoMerge pull request #13327 from opensourcerouting/fix/rip_status_align
Donald Sharp [Fri, 21 Apr 2023 13:41:00 +0000 (09:41 -0400)]
Merge pull request #13327 from opensourcerouting/fix/rip_status_align

ripd: Align show ip rip status output for sources

13 months agopimd: annotate some pointers as non-null
David Lamparter [Fri, 21 Apr 2023 13:25:25 +0000 (15:25 +0200)]
pimd: annotate some pointers as non-null

... make static analysis happy.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
13 months agopimd: harden MLD code loop boundaries
David Lamparter [Fri, 21 Apr 2023 13:14:43 +0000 (15:14 +0200)]
pimd: harden MLD code loop boundaries

Coverity complains about these being tainted/untrusted loop boundaries.
The way the code works, it's counting up groups/sources, but keeps
checking against remaining data length in the packet - which is
perfectly fine IMHO.  Except Coverity doesn't understand it :(

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
13 months agolib: Make coverity happy about close
Donald Sharp [Fri, 21 Apr 2023 13:12:08 +0000 (09:12 -0400)]
lib: Make coverity happy about close

The error condition handled both failure to open
and a fstat failure.  Just double check that the close
is appropriate to call.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agozebra: ctx has to be non NULL at this point
Donald Sharp [Fri, 21 Apr 2023 12:54:51 +0000 (08:54 -0400)]
zebra: ctx has to be non NULL at this point

Remove the pointer check for ctx.  At this point in the
function it has to be non null since we deref'ed it.
Additionally the alloc function that creates it cannot
fail.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agobgpd: Ensure bgp_vrf is non-null
Donald Sharp [Fri, 21 Apr 2023 12:04:06 +0000 (08:04 -0400)]
bgpd: Ensure bgp_vrf is non-null

If we attempt to get the bgp_vrf and it fails then
ensure that we don't just de-ref and crash.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agobgpd: Coverity mistakenly believes we can fall through
Donald Sharp [Fri, 21 Apr 2023 11:57:19 +0000 (07:57 -0400)]
bgpd: Coverity mistakenly believes we can fall through

Coverity has incorrectly found that a switch statement
can be fallen through.  It is missing the fact that the
previous case statement has a return through every path
it can get too.  Let's just appease coverity

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agobgpd: All paths have already de-refed rd_str
Donald Sharp [Fri, 21 Apr 2023 11:54:00 +0000 (07:54 -0400)]
bgpd: All paths have already de-refed rd_str

Coverity points out that rd_str has already been
deref'ed in all paths leading to this spot.  No
need to keep at it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agopimd: Tell coverity what is really going on
Donald Sharp [Fri, 21 Apr 2023 11:38:11 +0000 (07:38 -0400)]
pimd: Tell coverity what is really going on

Fix a code path that coverity has decided a variable
is NULL when it never can be.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agopimd: Fix possible null of pim instance
Donald Sharp [Fri, 21 Apr 2023 11:08:53 +0000 (07:08 -0400)]
pimd: Fix possible null of pim instance

Coverity shows a path where the pim instance may
be null.  In this code path if we have no pim
vrf there is nothing to do anyway so just return

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agoMerge pull request #13334 from louis-6wind/flexalgo-fixes
Olivier Dugeon [Fri, 21 Apr 2023 06:58:22 +0000 (08:58 +0200)]
Merge pull request #13334 from louis-6wind/flexalgo-fixes

isisd: fixes for Flex-Algo

13 months agoMerge pull request #13341 from donaldsharp/bgp_lcommunity_crash
Jafar Al-Gharaibeh [Fri, 21 Apr 2023 05:54:45 +0000 (00:54 -0500)]
Merge pull request #13341 from donaldsharp/bgp_lcommunity_crash

bgpd: Fix lcom->str string length to correctly cover aliases

13 months agozebra:fix evpn dup detected local mac del event
Chirag Shah [Sat, 22 Oct 2022 23:00:14 +0000 (16:00 -0700)]
zebra:fix evpn dup detected local mac del event

The current local mac delete event send to flag with force
always which breaks the duplicate detected MACs where
it requires to be resynced from bgpd to earlier state.

Ticket:#3233019
Issue:3233019

Signed-off-by: Chirag Shah <chirag@nvidia.com>
13 months agozebra: evpn handle del event for dup detected mac
Chirag Shah [Wed, 1 Dec 2021 04:42:01 +0000 (20:42 -0800)]
zebra: evpn handle del event for dup detected mac

Upon receiving local mobility event for MAC + NEIGH,
both are detected as duplicate upon hitting DAD threshold.

Duplicated detected ( freezed) MAC + NEIGH are not known
to bgpd.

If locally learnt MAC + NEIGH are deleted in kernel,
the MAC is marked as AUTO after sending delete event
to bgpd.

Bgpd only reinstalls best route for MAC_IP route (NEIGH)
but not for MAC event.
This puts a situation where MAC is AUTO state and
associated neigh as remote.

Fix:
DUPLICATE + LOCAL MAC deletion, set MAC delete request
as reinstall from bgpd.

Ticket:#2873307
Reviewed By:
Testing Done:

Freeze MAC + two NEIGHs in local mobility event.
Delete MAC and NEIGH from kerenl.
bgp rsync remote mac route which puts MAC to remote state.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
13 months agobgpd: Fix lcom->str string length to correctly cover aliases
Donald Sharp [Thu, 20 Apr 2023 20:27:20 +0000 (16:27 -0400)]
bgpd: Fix lcom->str string length to correctly cover aliases

If you have a very large number of large communities whose
string length happened to be greater than BUFSIZ FRR's bgpd
would crash.  This is because bgpd would write beyond
the end of the string.

Originally the code auto-calculated the string size appropriately
but commit ed0e57e3f079352714c3a3a8a5b0dddf4aadfe1d modified
the string length to be a hard coded BUFSIZ.  When a route-map
like this is added:

route-map LARGE-OUT permit 10
 set large-community 4635:0:0 4635:1:906 4635:1:2906 4635:1:4515 4635:1:4594 4635:1:4641 4635:1:4760 4635:1:7979 4635:1:9253 4635:1:9293 4635:1:9304 4635:1:9908 4635:1:13335 4635:1:16265 4635:1:17924 4635:1:18013 4635:1:20940 4635:1:22822 4635:1:24429 4635:1:24482 4635:1:32590 4635:1:32934 4635:1:36692 4635:1:38008 4635:1:38819 4635:1:41378 4635:1:45753 4635:1:46489 4635:1:49544 4635:1:51847 4635:1:54574 4635:1:54994 4635:1:55720 4635:1:56059 4635:1:57724 4635:1:65021 4635:1:134823 4635:1:136907 4635:1:146961 24115:0:24115 24115:1:906 24115:1:2906 24115:1:4515 24115:1:4594 24115:1:4641 24115:1:4760 24115:1:7979 24115:1:9253 24115:1:9293 24115:1:9304 24115:1:9908 24115:1:13335 24115:1:16265 24115:1:17924 24115:1:18013 24115:1:20940 24115:1:22822 24115:1:24429 24115:1:24482 24115:1:32590 24115:1:32934 24115:1:36692 24115:1:38008 24115:1:38819 24115:1:41378 24115:1:45753 24115:1:46489 24115:1:49544 24115:1:51847 24115:1:54574 24115:1:54994 24115:1:55720 24115:1:56059 24115:1:57724 24115:1:65021 24115:1:134823 24115:1:136907 24115:1:100000 24115:1:100001 24115:1:100002
exit

BGP would have issues and crash.

Modify the code to correctly determine the string length of the communities
and to also double check if the string has an alias and ensure that the
string is still sufficiently large enough.  If not auto size it again.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agoMerge pull request #12933 from Orange-OpenSource/link_state
Philippe Guibert [Thu, 20 Apr 2023 16:33:21 +0000 (18:33 +0200)]
Merge pull request #12933 from Orange-OpenSource/link_state

lib: Update edge key in link state database

13 months agoisisd: fix add an algorithm argument to show isis route
Louis Scalbert [Tue, 18 Apr 2023 15:35:41 +0000 (17:35 +0200)]
isisd: fix add an algorithm argument to show isis route

"show isis route algorithm ALGO json" display some text output before
printing the JSON one.

Do not print the text output in JSON mode.

Fixes: 0833c25180 ("isisd: add an algorithm argument to show isis route")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
13 months agoisisd: fix potential null pointer in isis_affinity_map_update()
Louis Scalbert [Wed, 19 Apr 2023 13:11:36 +0000 (15:11 +0200)]
isisd: fix potential null pointer in isis_affinity_map_update()

Reported by coverity scanner #1560315

Do not attempt to update the affinity map if the main isis struct is not
yet created.

Fixes: 9a65cf35da ("isisd: add affinity-map configuration hooks")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
13 months agoisisd: fix wrong pointer test in area_resign_level()
Louis Scalbert [Wed, 19 Apr 2023 13:07:46 +0000 (15:07 +0200)]
isisd: fix wrong pointer test in area_resign_level()

Fix a wrong pointer test issue reported by coverity scanner #1560314

Fixes: 860b75b40e ("isisd: calculate flex-algo constraint spf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
13 months agoisisd: fix potential null pointer in isis_affinity_map_check_use()
Louis Scalbert [Wed, 19 Apr 2023 12:59:57 +0000 (14:59 +0200)]
isisd: fix potential null pointer in isis_affinity_map_check_use()

Reported by coverity scanner #1560313

Do not consider the affinity map is in use if the main isis struct is
not yet created.

Fixes: 9a65cf35da ("isisd: add affinity-map configuration hooks")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
13 months agoisisd: fix overrun in isis_flex_algo_constraint_drop()
Louis Scalbert [Wed, 19 Apr 2023 12:49:58 +0000 (14:49 +0200)]
isisd: fix overrun in isis_flex_algo_constraint_drop()

Coverity scanner reported the overrun issue #1560312 because
reach->id length is 7 bytes and we are trying to copy 8 bytes
(ie. ISIS_SYS_ID_LEN + 2).

Fix the issue by using the %pPN to display directly the 7 bytes
system-id.

Fixes: 860b75b40e ("isisd: calculate flex-algo constraint spf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
13 months agotests: Align `show ip rip status` output in tests
Donatas Abraitis [Wed, 19 Apr 2023 19:08:03 +0000 (22:08 +0300)]
tests: Align `show ip rip status` output in tests

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agoMerge pull request #13329 from Pdoijode/pdoijode/bgp-attr-crash-fix
Donatas Abraitis [Wed, 19 Apr 2023 18:48:34 +0000 (21:48 +0300)]
Merge pull request #13329 from Pdoijode/pdoijode/bgp-attr-crash-fix

bgpd: Fix for ain->attr corruption during path update

13 months agoMerge pull request #13166 from Jafaral/ospf-external-metric
Donatas Abraitis [Wed, 19 Apr 2023 18:11:25 +0000 (21:11 +0300)]
Merge pull request #13166 from Jafaral/ospf-external-metric

ospfd: use rib metric as the base for set metric +/-

13 months agodoc: RIP BFD integration documentation
Rafael Zalamena [Tue, 28 Mar 2023 18:41:56 +0000 (15:41 -0300)]
doc: RIP BFD integration documentation

Let users know about the RIP BFD integration commands and increment the
used RFCs reference.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
13 months agotopotests: RIP BFD integration topology test
Rafael Zalamena [Mon, 27 Mar 2023 21:12:39 +0000 (18:12 -0300)]
topotests: RIP BFD integration topology test

Add new RIP topology to test the BFD integration and RIP ECMP:
shutdown a link and expect the RIP route change immediately instead of
regular RIP timer.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
13 months agoripd: support BFD integration
Renato Westphal [Thu, 14 Oct 2021 15:12:37 +0000 (12:12 -0300)]
ripd: support BFD integration

Implement RIP peer monitoring with BFD.

RFC 5882 Generic Application of Bidirectional Forwarding Detection
(BFD), Section 10.3 Interactions with RIP.

Co-authored-by: Renato Westphal <renato@opensourcerouting.org>
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
13 months agobgpd: Fix for ain->attr corruption during path update
Pooja Jagadeesh Doijode [Wed, 19 Apr 2023 01:40:06 +0000 (18:40 -0700)]
bgpd: Fix for ain->attr corruption during path update

1. Consider a established L2VPN EVPN BGP peer with soft-reconfiguartion
   inbound configured

2. When the interface of this directly connected BGP peer is shutdown,
   bgp_soft_reconfig_table_update() is called, which memsets the evpn buffer
   and calls bgp_update() with received attributes stored in ain table(ain->attr).
   In bgp_update(), evpn_overlay attribute in ain->attr (which is an interned
   attr) was modified by doing a memcpy

3. Above action causes 2 attributes in the attrhash (which were previously different)
   to match!

4. Later during fsm change event of the peer, bgp_adj_in_remove() is called
   to clean up the ain->attr. But, because 2 attrs in attrhash match, it causes
   BGP to assert in bgp_attr_unintern()

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
13 months agoripd: Align show ip rip status output for sources
Donatas Abraitis [Tue, 18 Apr 2023 19:50:11 +0000 (22:50 +0300)]
ripd: Align show ip rip status output for sources

Before:
```
Routing Protocol is "rip"
  Sending updates every 5 seconds with +/-50%, next due in 0 seconds
  Timeout after 15 seconds, garbage collect after 10 seconds
  Outgoing update filter list for all interface is not set
  Incoming update filter list for all interface is not set
  Default redistribution metric is 1
  Redistributing:
  Default version control: send version 2, receive any version
    Interface        Send  Recv   Key-chain
    r1-eth0          2     1 2
  Routing for Networks:
    192.168.1.0/24
  Routing Information Sources:
    Gateway          BadPackets BadRoutes  Distance Last Update
    192.168.1.2              0         0       120   00:00:05
    192.168.1.3              0         0       120   00:00:04
  Distance: (default is 120)
```

After:
```
Routing Protocol is "rip"
  Sending updates every 5 seconds with +/-50%, next due in 4 seconds
  Timeout after 15 seconds, garbage collect after 10 seconds
  Outgoing update filter list for all interface is not set
  Incoming update filter list for all interface is not set
  Default redistribution metric is 1
  Redistributing:
  Default version control: send version 2, receive any version
    Interface        Send  Recv   Key-chain
    r1-eth0          2     1 2
  Routing for Networks:
    192.168.1.0/24
  Routing Information Sources:
    Gateway          BadPackets BadRoutes  Distance Last Update
    192.168.1.2               0         0       120    00:00:00
    192.168.1.3               0         0       120    00:00:04
  Distance: (default is 120)
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agotests: Check if RIPd passive-interface works as expected
Donatas Abraitis [Tue, 18 Apr 2023 19:37:53 +0000 (22:37 +0300)]
tests: Check if RIPd passive-interface works as expected

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agoripd: Create non default passive interface if defined so
Donatas Abraitis [Tue, 18 Apr 2023 18:19:34 +0000 (21:19 +0300)]
ripd: Create non default passive interface if defined so

Without this patch, it's never get non-passive and even listed under status:

Configuration:

```
router rip
 network 192.168.1.0/24
 network 10.10.10.1/32
 passive-interface default
 no passive-interface r2-eth0
 timers basic 5 15 10
exit
```

```
r2# do sh ip rip status
Routing Protocol is "rip"
  Sending updates every 5 seconds with +/-50%, next due in 4 seconds
  Timeout after 15 seconds, garbage collect after 10 seconds
  Outgoing update filter list for all interface is not set
  Incoming update filter list for all interface is not set
  Default redistribution metric is 1
  Redistributing:
  Default version control: send version 2, receive any version
    Interface        Send  Recv   Key-chain
    lo               2     1 2
    r2-eth0          2     1 2
  Routing for Networks:
    10.10.10.1/32
    192.168.1.0/24
  Passive Interface(s):
    lo
    r2-eth0
  Routing Information Sources:
    Gateway          BadPackets BadRoutes  Distance Last Update
    192.168.1.3              0         0       120   00:00:04
  Distance: (default is 120)
r2#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agoMerge pull request #13323 from LabNConsulting/style-update
Mark Stapp [Tue, 18 Apr 2023 17:13:35 +0000 (13:13 -0400)]
Merge pull request #13323 from LabNConsulting/style-update

style: add format checker config and remove .dir-locals.el