Commit Graph

31756 Commits

Author SHA1 Message Date
Russ White
c12a40fee3
Merge pull request #13354 from zmw12306/parse_request_subtlv
babeld: add parse_request_subtlv into parse_packet
2023-05-02 10:28:20 -04:00
Russ White
ccf08bda1a
Merge pull request #13377 from donaldsharp/ospf_dead_interval
tests: Increase the dead interval to be longer for neighbor testing
2023-05-02 10:25:46 -04:00
Donald Sharp
cdfc536f76
Merge pull request #13389 from anlancs/fix/pimd-wrong-mrt-sockopt
pimd: Fix wrong setsockopt() call
2023-05-02 09:21:24 -04:00
Donald Sharp
fa8d4970d2
Merge pull request #13393 from opensourcerouting/fix/topotest_bgp_bfd_down_cease_notification
tests: Do not try establishing a connection from r1 to r2
2023-05-02 08:42:43 -04:00
Donald Sharp
0313343d0a
Merge pull request #13395 from LabNConsulting/chopps/mgmtd-debug-flags
mgmtd: fully implement debug flags for mgmtd and clients
2023-05-02 08:17:17 -04:00
Donatas Abraitis
bec4eeedc4
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
2023-05-01 22:07:03 +03:00
Donatas Abraitis
997aad2af7
Merge pull request #13408 from pguibert6WIND/flowspec_sanity
bgpd: add some flowspec sanity returns
2023-05-01 21:58:53 +03:00
Donatas Abraitis
cf37803455
Merge pull request #13409 from chiragshah6/fdev1
zebra:add df flag into evpn esi json output
2023-05-01 21:55:38 +03:00
Christian Hopps
cfa0facbf9 mgmtd: fully implement debug flags for mgmtd and clients
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-01 13:47:12 -04:00
Donald Sharp
4c5f1eeb60
Merge pull request #13406 from LabNConsulting/chopps/log-timestamp-buildopt
startup log timestamp precision build option
2023-05-01 09:51:46 -04:00
Christian Hopps
3e09791861 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>
2023-04-29 02:36:17 -04:00
Christian Hopps
6b7481aa8d lib: add build option to set startup log timestemp precision
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-29 02:36:06 -04:00
Sindhu Parvathi Gopinathan
2223b4d543 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>
2023-04-28 16:04:25 -07:00
Dmytro Shytyi
4eef588ac3 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>
2023-04-28 22:51:12 +02:00
Dmytro Shytyi
d7967830ea 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>
2023-04-28 22:51:12 +02:00
Philippe Guibert
9ba97a35a6 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>
2023-04-28 22:28:16 +02:00
Donald Sharp
0c13c0bab8
Merge pull request #13407 from cscarpitta/fix/fix-srv6l3vpn-topotest
tests: Fix `bgp_srv6l3vpn_to_bgp_vrf3` topotest
2023-04-28 13:49:06 -04:00
Carmine Scarpitta
778d75a6f2 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 2007e2dbd0.

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>
2023-04-28 17:37:03 +02:00
Donatas Abraitis
8bc79f3855
Merge pull request #13335 from pguibert6WIND/bgp_lu_explicit_per_afi
bgpd: configure explicit-null for local paths per address family
2023-04-28 16:27:20 +03:00
Donatas Abraitis
0c41d0ffad
Merge pull request #13379 from pguibert6WIND/bgp_nht_must_equal_zebra_nht
bgpd: keep interface index on bgp nexthop tracking
2023-04-28 09:32:24 +03:00
Philippe Guibert
cf1c7e309e 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>
2023-04-27 17:05:35 +02:00
Philippe Guibert
20d072d3ec 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>
2023-04-27 17:04:20 +02:00
anlan_cs
ad855cdf34 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>
2023-04-27 09:15:00 +08:00
Donatas Abraitis
47074a99e4 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>
2023-04-26 21:51:33 +03:00
Donatas Abraitis
34a8441fe8
Merge pull request #13386 from donaldsharp/bgp_received_routes
bgpd: Fix `received-routes detail`
2023-04-26 11:07:00 +03:00
Donatas Abraitis
13c426150f
Merge pull request #13368 from Keelan10/nhrpd-memory-leak
nhrpd: Fix nhrpd memory leak
2023-04-26 08:57:52 +03:00
Donald Sharp
24dede9b30 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>
2023-04-25 15:37:02 -04:00
Mark Stapp
b38aed324d
Merge pull request #13374 from opensourcerouting/build-fix-rmap-yang
build: fix frr-if-rmap.yang model embedding
2023-04-25 15:26:19 -04:00
Russ White
257fddaeb6
Merge pull request #13246 from opensourcerouting/rip-bfd
ripd: support BFD integration
2023-04-25 11:54:32 -04:00
Russ White
0ed5c87cfe
Merge pull request #13326 from opensourcerouting/feature/rip_topotest_distribute_list
ripd: Create non default passive interface if defined so
2023-04-25 11:07:31 -04:00
Russ White
4855ca5e56
Merge pull request #13310 from opensourcerouting/feature/bgpd_node_target_extended_community
bgpd: Add Node Target Extended Communities support
2023-04-25 11:06:23 -04:00
Donald Sharp
7a59014e7d tests: Run black on test_ospf_lan.py
frrbot unhappy.
Let's bring a smile to it's life.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-25 07:54:07 -04:00
Donald Sharp
a602765471 tests: Increase the dead interval to be longer for neighbor testing
the ospf_basic_functionality/test_ospf_lan.py script is setting
up a lan env that will have 4 ospf routers on it and shutting/no
shutting interfaces with various priorities to see that ospf
is properly choosing roles.  I am consistently seeing the
ospf_basic_functionality/test_ospf_lan.py script failing
where it is saying a neighbor is not in the correct state.

Upon examination of the logs we are seeing this:

2023/04/24 09:16:42 OSPF: [M7Q4P-46WDR] vty[7]@(config)# interface r0-s1-eth0  <----- This is where we no shut the interface
2023/04/24 09:16:47 OSPF: [M7Q4P-46WDR] vty[7]@> enable
2023/04/24 09:16:47 OSPF: [M7Q4P-46WDR] vty[7]@# show ip ospf neighbor all json
2023/04/24 09:16:53 OSPF: [QH9AB-Y4XMZ][EC 100663314] STARVATION: task ospf_ism_event (556af08a5b4c) ran for 6038ms (cpu time 0ms)
2023/04/24 09:16:53 OSPF: [HKQ2F-8D0MY][EC 100663315] Thread Starvation: {(thread *)0x556af19da020 arg=0x556af19c0dd0 timer  r=-5.086     ospf_ase_calculate_timer() &ospf->t_ase_calc from ospfd/ospf_ase.c:635} was scheduled to pop greater than 4s ago
2023/04/24 09:16:53 OSPF: [M7Q4P-46WDR] vty[18]@> enable
2023/04/24 09:16:53 OSPF: [M7Q4P-46WDR] vty[18]@# show ip ospf neighbor all
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@> enable
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@# show ip ospf neighbor all json
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@> enable

This test is setting the dead interval to 4 seconds, seeing a 6 second delay where the os has gone to town
(probably because of the high load on the system ) and not choosing the correct neighbor as the DR.

OSPF when coming up and after seeing the first neighbor, goes into a waiting period before
the DR is elected.  If the neighbor does send it's hello packets but they are not processed
before the wait timer pops because of the starvation event, then the wrong neighbor
will be elected DR.  Let's give this test a bit more time to decide who the
DR is in case everything goes a bit south.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-04-25 07:52:31 -04:00
Donald Sharp
3ba6373eef
Merge pull request #13375 from LabNConsulting/chopps/fix-style-issues
lib: fix style warns and get rid of "!" for success
2023-04-25 07:28:46 -04:00
Donald Sharp
6ff098088b
Merge pull request #13373 from LabNConsulting/chopps/fix-pytestconfig
fix missed passing pytestconfig arg.
2023-04-24 18:02:49 -04:00
Christian Hopps
7f6b20074f lib: fix style warns and get rid of "!" for success
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-24 11:20:48 -04:00
David Lamparter
edaee5461d 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>
2023-04-24 17:02:34 +02:00
Christian Hopps
9b96394d05
Merge pull request #13149 from pushpasis/mgmt_cleanup_zlog
mgmtd, lib: Cleanup zlog_err()
2023-04-24 11:00:08 -04:00
Donatas Abraitis
76cd90fb4e
Merge pull request #13330 from chiragshah6/fdev1
zebra: EVPN handle duplicate detected local mac delete event
2023-04-24 16:51:10 +03:00
Christian Hopps
1a68b13867 tests: fix missed passing pytestconfig arg
Remove the local ConfigOptionProxy and actually use the munet one.

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-24 09:48:26 -04:00
Christian Hopps
7d12017bd8 tests: import munet 0.13.2
fixed ConfigOptionsProxy bug

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-24 09:48:26 -04:00
Donald Sharp
ea4163ce49
Merge pull request #13365 from LabNConsulting/chopps/add-perf-option
Add ability to profile daemons in topotest with --perf
2023-04-24 07:38:45 -04:00
Donatas Abraitis
766fcb6056
Merge pull request #13361 from LabNConsulting/chopps/munet-cfgopt-and-native
cfgopt in munet and native config support and example
2023-04-24 13:50:36 +03:00
Keelan10
e15ca73e5a 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>
2023-04-24 11:18:39 +04:00
Christian Hopps
a3e8e1aacb doc: document --perf and --perf-options, and a bit of cleanup
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 21:56:38 -04:00
Christian Hopps
e6079f4fa4 tests: add --perf and --perf-options for profiling daemons
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 21:53:44 -04:00
Donald Sharp
3eefea9249
Merge pull request #13350 from opensourcerouting/typesafe-fixes-20230421
lib: typesafe shenanigans
2023-04-23 15:06:59 -04:00
Christian Hopps
a929d94ff5 tests: add an example of using munet native config
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 15:02:46 -04:00
Christian Hopps
0def198cd3 tests: enable using munet native configs
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 09:52:39 -04:00
Christian Hopps
d9de3cc48b tests: munet now supports cfgopt directly
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-23 09:52:39 -04:00