Commit Graph

35929 Commits

Author SHA1 Message Date
Donald Sharp
b494f1a314 zebra: Fix snmp walk of zebra rib
The snmp walk of the zebra rib was skipping entries
because in_addr_cmp was replaced with a prefix_cmp
which worked slightly differently causing parts
of the zebra rib tree to be skipped.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit ecd9d441b0)
2024-09-25 18:51:29 +00:00
Russ White
e45891fca9
Merge pull request #16893 from FRRouting/mergify/bp/stable/10.1/pr-16886
ospfd: Interface 'ip ospf neighbor-filter' startup config not applied. (backport #16886)
2024-09-24 12:33:27 -04:00
Russ White
8543237034
Merge pull request #16897 from FRRouting/mergify/bp/stable/10.1/pr-16630
Babel metric (backport #16630)
2024-09-24 10:56:41 -04:00
Donald Sharp
1cff00a181 babeld: Do not remove route when replacing
When sending down a babel route do not remove then
add it back.  Just send down the change.  This
change will not cause packets to be dropped now.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 63e2c092a3)
2024-09-23 11:41:31 +00:00
Donald Sharp
679b4f07e8 babeld: Send the route's metric down to zebra.
Babel was thinking it was talking to the kernel for
route installation instead of zebra.  Pass down the
metric instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit b4c88abe9f)
2024-09-23 11:41:30 +00:00
Acee Lindem
0c8ef89d2f ospfd: Interface 'ip ospf neighbor-filter' startup config not applied.
When 'ip ospf neighbor-filter <filter-name>' is configured in the startup
configuration, it is in the running configuration but not applied on the
interface.

Signed-off-by: Acee Lindem <acee@lindem.com>
(cherry picked from commit 77de5eeb80)
2024-09-23 06:20:30 +00:00
Jafar Al-Gharaibeh
a4c96c6a58
Merge pull request #16862 from FRRouting/mergify/bp/stable/10.1/pr-16860
ospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV (backport #16860)
2024-09-19 08:49:56 -05:00
Acee Lindem
9da029884c ospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV
When parsing the SR-Algorithm TLV in the OSPF Router Information Opaque
LSA, assure that not more than the maximum number of supported
algorithms are copied from the TLV.

Signed-off-by: Acee Lindem <acee@lindem.com>
(cherry picked from commit 0dc969185f)
2024-09-18 23:56:49 +00:00
Donald Sharp
a099561cb4
Merge pull request #16842 from FRRouting/mergify/bp/stable/10.1/pr-16809
isisd: fix rcap tlv double-free crash (backport #16809)
2024-09-17 13:39:37 -04:00
Louis Scalbert
33a58e9362 tests: update isisd fuzz test
Since the previous commit, if a router capability subTLV is not
readable, the previously read subTLVs are kept.

Update of the ISIS fuzz test.

> $ wuschl rebuild tests/isisd/test_fuzz_isis_tlv
> $ gzip -9 tests/isisd/test_fuzz_isis_tlv_tests.h

> $ ./test_fuzz_isis_tlv 2>/dev/null | grep failed
> Test 139 failed, output differs.
> Test 150 failed, output differs.
> 2 of 405 tests failed.
>
> $ ./test_fuzz_isis_tlv 139 2>/dev/null
> Test 139 failed, output differs.
> Expected output:
> Unpack log:
> Unpacking 564 bytes of TLVs...
>   Unpacking TLV...
>     Found TLV of type 193 and len 13.
>     Skipping unknown TLV 193 (13 bytes)
>   Unpacking TLV...
>     Found TLV of type 0 and len 0.
>     Skipping unknown TLV 0 (0 bytes)
>   Unpacking TLV...
>     Found TLV of type 0 and len 0.
>     Skipping unknown TLV 0 (0 bytes)
>   Unpacking TLV...
>     Found TLV of type 242 and len 12.
>     Unpacking Router Capability TLV...
>     WARNING: Router Capability subTLV length too large compared to expected size
> Unpacked TLVs:
> Received output:
> Unpack log:
> Unpacking 564 bytes of TLVs...
>   Unpacking TLV...
>     Found TLV of type 193 and len 13.
>     Skipping unknown TLV 193 (13 bytes)
>   Unpacking TLV...
>     Found TLV of type 0 and len 0.
>     Skipping unknown TLV 0 (0 bytes)
>   Unpacking TLV...
>     Found TLV of type 0 and len 0.
>     Skipping unknown TLV 0 (0 bytes)
>   Unpacking TLV...
>     Found TLV of type 242 and len 12.
>     Unpacking Router Capability TLV...
>     WARNING: Router Capability subTLV length too large compared to expected size
> Unpacked TLVs:
> Router Capability: 253.212.128.242 , D:1, S:1
>
> $ ./test_fuzz_isis_tlv 150 2>/dev/null
> Test 150 failed, output differs.
> Expected output:
> Unpack log:
> Unpacking 403 bytes of TLVs...
>   Unpacking TLV...
>     Found TLV of type 129 and len 13.
>     Unpacking Protocols Supported TLV...
>       Protocols Supported: 73, 16, 255, 255, 255, 101, 10, 11, 11, 11, 11, 11, 11
>   Unpacking TLV...
>     Found TLV of type 11 and len 11.
>     Skipping unknown TLV 11 (11 bytes)
>   Unpacking TLV...
>     Found TLV of type 242 and len 12.
>     Unpacking Router Capability TLV...
>     WARNING: Router Capability subTLV length too large compared to expected size
> Unpacked TLVs:
> Protocols Supported: 73, 16, 255, 255, 255, 101, 10, 11, 11, 11, 11, 11, 11
> Received output:
> Unpack log:
> Unpacking 403 bytes of TLVs...
>   Unpacking TLV...
>     Found TLV of type 129 and len 13.
>     Unpacking Protocols Supported TLV...
>       Protocols Supported: 73, 16, 255, 255, 255, 101, 10, 11, 11, 11, 11, 11, 11
>   Unpacking TLV...
>     Found TLV of type 11 and len 11.
>     Skipping unknown TLV 11 (11 bytes)
>   Unpacking TLV...
>     Found TLV of type 242 and len 12.
>     Unpacking Router Capability TLV...
>     WARNING: Router Capability subTLV length too large compared to expected size
> Unpacked TLVs:
> Protocols Supported: 73, 16, 255, 255, 255, 101, 10, 11, 11, 11, 11, 11, 11
> Router Capability: 253.212.128.242 , D:1, S:1

Link: https://pypi.org/project/wuschl/
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit cfd050a0e5)
2024-09-17 12:35:15 +00:00
Louis Scalbert
670c4039ce isisd: fix rcap tlv double-free crash
A double-free crash happens when a subTLV of the "Router Capability"
TLV is not readable and a previous "Router Capability" TLV was read.

rcap was supposed to be freed later by isis_free_tlvs() ->
free_tlv_router_cap(). In 78774bbcd5 ("isisd: add isis flex-algo lsp
advertisement"), this was not the case because rcap was not saved to
tlvs->router_cap when the function returned early because of a subTLV
length issue.

Always set tlvs->router_cap to free the memory.

Note that this patch has the consequence that in case of subTLV error,
the previously read "Router Capability" subTLVs are kept in memory.

Fixes: 49efc80d34 ("isisd: Ensure rcap is freed in error case")
Fixes: 78774bbcd5 ("isisd: add isis flex-algo lsp advertisement")
Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit d61758140d)
2024-09-17 12:35:15 +00:00
Donald Sharp
9ffb74fb2f
Merge pull request #16819 from FRRouting/mergify/bp/stable/10.1/pr-16808
nhrpd: fixes duplicate auth extension (backport #16808)
2024-09-13 19:53:47 -04:00
Donald Sharp
367d7ed583
Merge pull request #16824 from FRRouting/mergify/bp/stable/10.1/pr-16818
ospfd: missing '[no]ip ospf graceful-restart hello-delay <N>' commands (backport #16818)
2024-09-13 19:52:36 -04:00
Dmitrii Turlupov
376fd01129 ospfd: fix missing '[no]ip ospf graceful-restart hello-delay <N>' commands
Signed-off-by: Dmitrii Turlupov <turlupov@bk.ru>
(cherry picked from commit 69e31a547f)
2024-09-13 15:58:52 +00:00
Denys Haryachyy
ebe88a053d nhrpd: fixes duplicate auth extension
When an NHRP peer was forwarding a message, it was copying all
extensions from the originally received packet. The authentication
extension must be regenerated hop by hop per RFC2332.
This fix checks for the auth extension when copying extensions
and omits the original packet auth and instead regenerates a new auth extension.

Fix bug #16507

Signed-off-by: Denys Haryachyy <garyachy@gmail.com>
(cherry picked from commit 8e3c278bbc)
2024-09-13 14:52:33 +00:00
Donald Sharp
2af6e7aa0a
Merge pull request #16806 from opensourcerouting/fix/backport_ABUILD_APK_INDEX_OPTS_10.1
10.1 Backport docker ABUILD_APK_INDEX_OPTS
2024-09-12 08:22:11 -04:00
Donatas Abraitis
dbf8dac1ce FRR Release 10.1.1
- bgpd
-    Fix as-path exclude modify crash
-    Fix labels static-analyser
-    Fix, do not access peer->notify.data when it is null
-    Fix crash at no rpki
-    Fix memory type for static->prd_pretty
-    Revert "topotests: add an ebgp 6vpe test"
-    Revert "topotests: add bgp_nexthop_mp_ipv4_6 test"
-    Revert "bgpd: optimize bgp_interface_address_del"
-    Revert "bgpd: fix removing ipv6 global nexhop"
-    Revert "bgpd: fix "used" json key on link-local nexthop"
-    Revert "tests: ipv6 global removal in bgp_nexthop_mp_ipv4_6"
-    Revert "bgpd: set ipv4-mapped ipv6 for ipv4 with ipv6 nexthop"
-    Revert "bgpd: prefer link-local to a ipv4-mapped ipv6 global"
-    Revert "topotests: update bgp_vrf_leaking_5549_routes"
-    Revert "bgpd: optimize bgp_interface_address_add"
-    Revert "bgpd: reduce bgp_interface_address_add indentation"
-    Revert "bgpd: log new ipv6 global in bgp_interface_address_add"
-    Revert "bgpd: fix sending ipv6 local nexthop if global present"
- isisd
-    Fix crash when reading asla
-    Add missing `exit` statement
-    Fix update link params after circuit is up
-    Fix crash at flex-algo without mpls-te
-    Fix memory handling in isis_adj_process_threeway()
- nhrpd
-    Fix show nhrp shortcut json
-    Fix sending /32 shortcut
- pimd
-    Fix crash in pimd
- mgmtd
-    Don't add implicit state data when reading config from file
- lib
-    Fix distribute-list deletion
-    Fix crash on distribute-list delete
-    Fix LYD_NEW_PATH_OUTPUT issue to support libyang v3.x
- ripd
-    Fix show run output for distribute-list
- zebra
-    Ensure non-equal id's are not same nhg's
-    Mimic GNU basename() API for non-glibc library e.g. musl

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-09-12 10:46:05 +03:00
Donatas Abraitis
fb9c18cd96 docker: Set ABUILD_APK_INDEX_OPTS for frr build
In build() stage of abuild, it does `apk index ...` where frr* packages
are unsigned. We don't sign them here, and thus we need to specify `--allow-untrusted`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-09-12 09:53:00 +03:00
Donatas Abraitis
371f3d3cf1 docker: Set ABUILD_APK_INDEX_OPTS for libyang
In build() stage of abuild, it does `apk index ...` where libyang* packages
are unsigned. We don't sign them here, and thus we need to specify `--allow-untrusted`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-09-12 09:52:59 +03:00
Donald Sharp
884196eed1
Merge pull request #16794 from opensourcerouting/fix/5e1b7f5a69505c76999e610d8773f5abd63fe1a2_10.1
bgpd: fix as-path exclude modify crash
2024-09-11 15:55:09 -04:00
Louis Scalbert
5e3edba385 bgpd: fix as-path exclude modify crash
Fix a crash when modifying a route-map with set as-path exclude without
as-path-access-list:

> router(config)# route-map routemaptest deny 1
> router(config-route-map)# set as-path exclude 33 34 35
> router(config-route-map)# set as-path exclude as-path-access-list test

> #0  raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50
> #1  0x00007fb3959327de in core_handler (signo=11, siginfo=0x7ffd122da530, context=0x7ffd122da400) at lib/sigevent.c:258
> #2  <signal handler called>
> #3  0x000055ab2762a1bd in as_list_list_del (h=0x55ab27897680 <as_exclude_list_orphan>, item=0x55ab28204e20) at ./bgpd/bgp_aspath.h:77
> #4  0x000055ab2762d1a8 in as_exclude_remove_orphan (ase=0x55ab28204e20) at bgpd/bgp_aspath.c:1574
> #5  0x000055ab27550538 in route_aspath_exclude_free (rule=0x55ab28204e20) at bgpd/bgp_routemap.c:2366
> #6  0x00007fb39591f00c in route_map_rule_delete (list=0x55ab28203498, rule=0x55ab28204170) at lib/routemap.c:1357
> #7  0x00007fb39591f87c in route_map_add_set (index=0x55ab28203460, set_name=0x55ab276ad2aa "as-path exclude", set_arg=0x55ab281e4f70 "as-path-access-list test") at lib/routemap.c:1674
> #8  0x00007fb39591d3f3 in generic_set_add (index=0x55ab28203460, command=0x55ab276ad2aa "as-path exclude", arg=0x55ab281e4f70 "as-path-access-list test", errmsg=0x7ffd122db870 "",
>     errmsg_len=8192) at lib/routemap.c:533
> #9  0x000055ab2755e78e in lib_route_map_entry_set_action_rmap_set_action_exclude_as_path_modify (args=0x7ffd122db290) at bgpd/bgp_routemap_nb_config.c:2427
> #10 0x00007fb3958fe417 in nb_callback_modify (context=0x55ab28205aa0, nb_node=0x55ab27cb31e0, event=NB_EV_APPLY, dnode=0x55ab28202690, resource=0x55ab27c32148, errmsg=0x7ffd122db870 "",
>     errmsg_len=8192) at lib/northbound.c:1538
> #11 0x00007fb3958ff0ab in nb_callback_configuration (context=0x55ab28205aa0, event=NB_EV_APPLY, change=0x55ab27c32110, errmsg=0x7ffd122db870 "", errmsg_len=8192) at lib/northbound.c:1888
> #12 0x00007fb3958ff5e4 in nb_transaction_process (event=NB_EV_APPLY, transaction=0x55ab28205aa0, errmsg=0x7ffd122db870 "", errmsg_len=8192) at lib/northbound.c:2016
> #13 0x00007fb3958fddba in nb_candidate_commit_apply (transaction=0x55ab28205aa0, save_transaction=true, transaction_id=0x0, errmsg=0x7ffd122db870 "", errmsg_len=8192)
>     at lib/northbound.c:1356
> #14 0x00007fb3958fdef0 in nb_candidate_commit (context=..., candidate=0x55ab27c2c9a0, save_transaction=true, comment=0x0, transaction_id=0x0, errmsg=0x7ffd122db870 "", errmsg_len=8192)
>     at lib/northbound.c:1389
> #15 0x00007fb3959045ba in nb_cli_classic_commit (vty=0x55ab281f6680) at lib/northbound_cli.c:57
> #16 0x00007fb395904b5a in nb_cli_apply_changes_internal (vty=0x55ab281f6680, xpath_base=0x7ffd122dfd10 "/frr-route-map:lib/route-map[name='routemaptest']/entry[sequence='1']",
>     clear_pending=false) at lib/northbound_cli.c:184
> #17 0x00007fb395904ebf in nb_cli_apply_changes (vty=0x55ab281f6680, xpath_base_fmt=0x0) at lib/northbound_cli.c:240
> --Type <RET> for more, q to quit, c to continue without paging--
> #18 0x000055ab27557d2e in set_aspath_exclude_access_list_magic (self=0x55ab2775c300 <set_aspath_exclude_access_list_cmd>, vty=0x55ab281f6680, argc=5, argv=0x55ab28204c80,
>     as_path_filter_name=0x55ab28202040 "test") at bgpd/bgp_routemap.c:6397
> #19 0x000055ab2754bdea in set_aspath_exclude_access_list (self=0x55ab2775c300 <set_aspath_exclude_access_list_cmd>, vty=0x55ab281f6680, argc=5, argv=0x55ab28204c80)
>     at ./bgpd/bgp_routemap_clippy.c:856
> #20 0x00007fb39589435d in cmd_execute_command_real (vline=0x55ab281e61f0, vty=0x55ab281f6680, cmd=0x0, up_level=0) at lib/command.c:1003
> #21 0x00007fb3958944be in cmd_execute_command (vline=0x55ab281e61f0, vty=0x55ab281f6680, cmd=0x0, vtysh=0) at lib/command.c:1062
> #22 0x00007fb395894a0c in cmd_execute (vty=0x55ab281f6680, cmd=0x55ab28200f20 "set as-path exclude as-path-access-list test", matched=0x0, vtysh=0) at lib/command.c:1228
> #23 0x00007fb39595242c in vty_command (vty=0x55ab281f6680, buf=0x55ab28200f20 "set as-path exclude as-path-access-list test") at lib/vty.c:625
> #24 0x00007fb3959541c5 in vty_execute (vty=0x55ab281f6680) at lib/vty.c:1388
> #25 0x00007fb3959563db in vtysh_read (thread=0x7ffd122e2bb0) at lib/vty.c:2400
> #26 0x00007fb39594b785 in event_call (thread=0x7ffd122e2bb0) at lib/event.c:1996
> #27 0x00007fb3958d1365 in frr_run (master=0x55ab27b56d70) at lib/libfrr.c:1231
> #28 0x000055ab2747f1cc in main (argc=3, argv=0x7ffd122e2e08) at bgpd/bgp_main.c:555

Fixes: 094dcc3cda ("bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issues")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-09-11 10:24:19 +03:00
Jafar Al-Gharaibeh
6704b38d0d
Merge pull request #16783 from FRRouting/mergify/bp/stable/10.1/pr-16718
isisd: fix crash when reading asla (backport #16718)
2024-09-11 00:03:00 -04:00
Louis Scalbert
ef6d74d6e3 isisd: fix crash when reading asla
isisd is crashing when reading a ASLA sub-TLV with Application
Identifier Bit Mask length greater than 1 octet.

Set a limit of 8 bytes in accordance with RFC9479 and check that the
received value does not exceed the limit.

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Link: https://www.rfc-editor.org/rfc/rfc9479.html#name-application-identifier-bit-
Fixes: 5749ac83a8 ("isisd: add ASLA support")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit f1bc6c5d81)
2024-09-10 14:49:45 +00:00
Donatas Abraitis
b40447ca8c
Merge pull request #16776 from FRRouting/mergify/bp/stable/10.1/pr-16511
Fix LYD_NEW_PATH_OUTPUT issue to support libyang v3.x (backport #16511)
2024-09-10 11:26:21 +03:00
Lu.Mao
b346f80548 lib: Fix LYD_NEW_PATH_OUTPUT issue to support libyang v3.x
Fix the LYD_NEW_PATH_OUTPUT undeclared error to support the latest libyang v3.x version,
and also compatible with old version.

Signed-off-by: Lu Mao <lu.mao@molex.com>
(cherry picked from commit 87c9060f90)
2024-09-09 19:20:34 +00:00
Donald Sharp
c60f439098
Merge pull request #16739 from FRRouting/mergify/bp/stable/10.1/pr-16724
isisd: Add missing `exit` statement to `show running-config` output (backport #16724)
2024-09-04 09:31:23 -04:00
Carmine Scarpitta
a96a77325d isisd: Add missing exit statement
Add missing `exit` statement to `show running-config` output.

```
router isis ISIS_CORE
 is-type level-2-only
 net 49.0001.0000.0000.0004.00
 lsp-mtu 1300
 topology ipv6-unicast
 log-adjacency-changes
 segment-routing srv6
  locator ISIS_LOC
 exit   <<<<<<<<<<<<<<<<<<<<<<<<
exit
```

Fixes https://github.com/FRRouting/frr/issues/16694

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 8be8864ffd)
2024-09-04 05:16:22 +00:00
Donald Sharp
51a9c6de80
Merge pull request #16728 from FRRouting/mergify/bp/stable/10.1/pr-16667
isisd: fix update link params after circuit is up (backport #16667)
2024-09-03 16:22:13 -04:00
Louis Scalbert
e3ff4870b9 isisd: fix update link params after circuit is up
If the link-params are set when the circuit not yet up, the link-params
are never updated.

isis_link_params_update() is called from isis_circuit_up() but returns
immediately because circuit->state != C_STATE_UP. circuit->state is
updated in isis_csm_state_change after isis_circuit_up().

> struct isis_circuit *isis_csm_state_change(enum isis_circuit_event event,
> 					   struct isis_circuit *circuit,
> 					   void *arg)
> {
> [...]
> 			if (isis_circuit_up(circuit) != ISIS_OK) {
> 				isis_circuit_deconfigure(circuit, area);
> 				break;
> 			}
> 			circuit->state = C_STATE_UP;
> 			isis_event_circuit_state_change(circuit, circuit->area,
> 							1);

Do not return isis_link_params_update() if circuit->state != C_STATE_UP.

Fixes: 0fdd8b2b11 ("isisd: update link params after circuit is up")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 6ce6b7a856)
2024-09-03 14:56:40 +00:00
Donatas Abraitis
579731c9d2
Merge pull request #16699 from louis-6wind/fix-nhrp-redundancy-10.1
nhrpd, test: fix nhrp_redundancy topotest (backport #16698)
2024-09-02 14:17:16 +03:00
Jafar Al-Gharaibeh
94d80db8e9
Merge pull request #16708 from FRRouting/mergify/bp/stable/10.1/pr-16673
tests: Fix bgp_default_originate_topo1_3 (backport #16673)
2024-08-31 01:16:47 -04:00
Donald Sharp
8a25bd829a
Merge pull request #16702 from FRRouting/mergify/bp/stable/10.1/pr-16687
tests: increase the timeout for packet padding check (backport #16687)
2024-08-30 19:36:50 -04:00
Donald Sharp
5b3defd939
Merge pull request #16706 from FRRouting/mergify/bp/stable/10.1/pr-16683
tests: ospf_netns_vrf should give more time for coming up (backport #16683)
2024-08-30 19:36:14 -04:00
Donald Sharp
21a8a5f996
Merge pull request #16704 from FRRouting/mergify/bp/stable/10.1/pr-16682
tests: Ensure bgp suppress fib has a chance to transmit data to peer (backport #16682)
2024-08-30 19:35:40 -04:00
Donald Sharp
26e60a0a89 tests: Fix bgp_default_originate_topo1_3
This test was killing bgp on r1 and r2
and then immediately testing that the
default route transitioned.  Unfortunately
the test was written that under load the
system might be in a bad state.  Let's
modify the code to check for a bgp version
change and then that the bgp state has
come back up

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 598d9a1f17)
2024-08-30 20:34:12 +00:00
Donald Sharp
44537095ee tests: ospf_netns_vrf should give more time for coming up
Test fails:

            test_func = partial(
                topotest.router_json_cmp,
                router,
                "show ip ospf vrf {0}-ospf-cust1 json".format(rname),
                expected,
            )
            _, diff = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
            assertmsg = '"{}" JSON output mismatches'.format(rname)
>           assert diff is None, assertmsg
E           AssertionError: "r1" JSON output mismatches
E           assert Generated JSON diff error report:
E
E             > $->r1-ospf-cust1->areas->0.0.0.0->nbrFullAdjacentCounter: output has element with value '1' but in expected it has value '2'

/home/sharpd/frr2/tests/topotests/ospf_netns_vrf/test_ospf_netns_vrf.py:239: AssertionError

Support bundle has this data:
r1# show ip ospf vrf all neighbor
% 2024/08/28 14:55:54.763

VRF Name: r1-ospf-cust1

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
10.0.255.3        1 Full/DR         10.547s           39.456s 10.0.3.1        r1-eth1:10.0.3.2                     0     0     0
10.0.255.2        1 Full/Backup     0.543s            38.378s 10.0.3.3        r1-eth1:10.0.3.2                     1     0     0

So immediately after the test fails this test, the neighbor comes up.
Let's give the test a bit more time for failure to not happen

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit d58c44cebe)
2024-08-30 20:33:09 +00:00
Donald Sharp
e564128fbb tests: Ensure bgp suppress fib has a chance to transmit data to peer
Giving only 5 seconds to pass bgp data to peers on a heavily
loaded system is a recipe for not having fun.  Add more time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 3797454a2a)
2024-08-30 20:32:30 +00:00
Jafar Al-Gharaibeh
8d409b8dae tests: increase the timeout for packet padding check
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
(cherry picked from commit 5752fc86ee)
2024-08-30 20:31:21 +00:00
Louis Scalbert
995f6b8f16 tests: use private addresses in nhrp_redundancy
Use private addresses in nhrp_redundancy.

> cd tests/topotests/nhrp_redundancy
> git grep 176.16  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|176.16|172.16|g' -i
> git grep 5.5.5.  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|5.5.5.|10.5.5.|g' -i
> git grep 4.4.4  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|4.4.4.|10.4.4.|g' -i

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 16:24:58 +02:00
Louis Scalbert
7f587c9c9d tests: check show ip nhrp shorcut in nhrp_redundancy
Check show ip nhrp shorcut in nhrp_redundancy

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 16:24:57 +02:00
Louis Scalbert
7028e39986 nhrpd: fix show nhrp shortcut json
Fix show nhrp shortcut json

Fixes: 87b9e98203 ("nhrpd: add json support to show nhrp vty commands")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 16:24:55 +02:00
Louis Scalbert
b175a3fab3 tests: fix iptables command in nhrp_redundancy
Replace --nflog-range argument by --nflog-range due to:

> 2024-08-30 10:44:54,816 INFO: topo: input: iptables -A FORWARD -i nhs3-gre0 -o nhs3-gre0 -m hashlimit --hashlimit-upto 4/minute --hashlimit-burst 1 --hashlimit-mode srcip,dstip --hashlimit-srcmask 24 --hashlimit-dstmask 24 --hashlimit-name loglimit-0 -j NFLOG --nflog-group 1 --nflog-range 128
> 2024-08-30 10:44:54,819 INFO: topo: output: warn: --nflog-range has never worked and is no longer supported, please use --nflog-size insted

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 16:24:54 +02:00
Louis Scalbert
9aa78070e0 tests: fix nhs1 down check in nhrp_redundancy
Fully check the NHRP convergence after setting nhs1 down. Otherwise the
ping may pass because the previous shortcut is still present.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 16:24:53 +02:00
Louis Scalbert
df630bbc3e tests: fix nhc1 route check after nhs1 down
After setting down nhs1, the test is checking that nhc1 routing table
matches routes in nhc1/nhrp_route.json. It is incorrect because it
checks that the NHRP route to nhs1 is still present but it should have
disappeared.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 16:24:52 +02:00
Louis Scalbert
dbd888cce6 tests: simplify nhrp_redundancy convergence
Simplify nhrp_redundancy convergence code. Cosmetic change.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 16:24:34 +02:00
Louis Scalbert
551c3290ed tests: rename router variables in nhrp_redundancy
Rename router variables in nhrp_redundancy to match the actual name.
Cosmetic change to help debugging.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 16:24:00 +02:00
Louis Scalbert
3f49c5026c tests: rename routers in nhrp_redundancy
Rename routers in nhrp_redundancy to match the diagram. Cosmetic change.

> cd tests/topotests/nhrp_redundancy
> git grep r1  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r1|nhs1|g' -i
> git grep r2  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r2|nhs2|g' -i
> git grep r3  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r3|nhs3|g' -i
> git grep r4  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r4|nhc1|g' -i
> git grep r5  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r5|nhc2|g' -i
> git grep r6  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r6|router|g' -i
> git grep r7  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r7|host|g' -i
>
> git grep R1  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R1|nhs1|g' -i
> git grep R2  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R2|nhs2|g' -i
> git grep R3  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R3|nhs3|g' -i
> git grep R4  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R4|nhc1|g' -i
> git grep R5  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R5|nhc2|g' -i
> git grep R6  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R6|router|g' -i
> git grep R7  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R7|host|g' -i
>
> mv r1 nhs1
> mv r2 nhs2
> mv r3 nhs3
> mv r4 nhc1
> mv r5 nhc2
> mv r6 router
> mv r7 host

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 16:23:58 +02:00
Louis Scalbert
cfb057ae3c tests: fix prefix length in nhrp_redundancy
The expected prefix should be 5.5.5.0/24 otherwise the hosts behind NHRP
client 1 nhc1 (aka. r5) are not reachable via NHRP.

The issue was not seen in the FRR official CI because the tests were
skipped because iptables were missing in CI machines.

It solves the 16690 issue.

Fixes: https://github.com/FRRouting/frr/issues/16690
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-08-30 16:22:57 +02:00
Jafar Al-Gharaibeh
6d7a869d82
Merge pull request #16587 from opensourcerouting/fix/revert_ipv4_mapped_ipv6_stuff_10.1
Revert IPv4 mapped IPv6 stuff for 10.1
2024-08-29 11:42:10 -04:00
Jafar Al-Gharaibeh
0bad64e9dd
Merge pull request #16671 from opensourcerouting/fix/a152692f5ac207b5f55104b18ddc3146089db474_10.1
bgpd: fix labels static-analyser (backport #16655)
2024-08-27 17:49:55 -04:00