Commit Graph

33688 Commits

Author SHA1 Message Date
Donatas Abraitis
77b57b4e51 lib: Suppress HOB/STARVATION warnings when running in vtysh
Running ping/traceroute/etc. (any kind of commands that use execute_command()
suffer with this kind of warnings.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 3ff671b830)
2023-10-11 14:30:16 +00:00
Rodrigo Nardi
813d3eb40b ospfd: Fixing infinite loop when listing OSPF interfaces
The problem was happening because the ospf->oiflist has this behaviour, each interface was removed and added at the end of the list in each ospf_network_run_subnet call, generation an infinite loop.
As a solution, a copy of the list was generated and we interacted with a fixed list.

Signed-off-by: Rodrigo Nardi <rnardi@netdef.org>
(cherry picked from commit e0dbeff5bc)
2023-10-11 14:28:56 +00:00
Volodymyr Huti
2e41393e5e eigrp: use correct memory pool on interface deletion
Trying to delete an interface during the test test_eigrp_topo1.py triggers a crash.
```
EIGRP: abort+0x12b
EIGRP: _zlog_assert_failed+0x18c
EIGRP: mt_count_free+0x56
EIGRP: qfree+0x2e
EIGRP: eigrp_if_delete_hook+0x8c
EIGRP: hook_call_if_del+0x5f
EIGRP: if_delete_retain+0x1c
EIGRP: if_delete+0xfb
EIGRP: if_destroy_via_zapi+0x69
EIGRP: zclient_interface_delete+0x57
EIGRP: zclient_read+0x3d0
EIGRP: event_call+0xd8
EIGRP: frr_run+0x271
EIGRP: main+0x14b
EIGRP: __libc_start_main+0xf3
EIGRP: _start+0x2e
EIGRP: in thread zclient_read scheduled from lib/zclient.c:4514 zclient_event()
```

Signed-off-by: Volodymyr Huti <v.huti@vyos.io>
(cherry picked from commit 8ddf6a713f)
2023-10-11 14:19:23 +00:00
Donatas Abraitis
964c166f4b
Merge pull request #14562 from FRRouting/mergify/bp/dev/9.1/pr-14560
Linkstate reversal (backport #14560)
2023-10-11 13:29:30 +03:00
Donald Sharp
0c91f45d96 Revert "lib: register bgp link-state afi/safi"
This reverts commit 1642a68d60.

(cherry picked from commit 0dc12c9003)
2023-10-11 05:02:54 +00:00
Donald Sharp
0877b37683 Revert "yang: add bgp link-state"
This reverts commit 3cf5ff2715.

(cherry picked from commit 9c44816398)
2023-10-11 05:02:53 +00:00
Donald Sharp
9b3be70d9e Revert "bgpd: add bgp link-state address-family configuration context"
This reverts commit ae2f3bb5b4.

(cherry picked from commit ddd96b51b0)
2023-10-11 05:02:53 +00:00
Donald Sharp
f98f17d83a Revert "bgpd: accept bgp link-state capability"
This reverts commit 67fe40676e.

(cherry picked from commit a4fcdc4e48)
2023-10-11 05:02:53 +00:00
Donald Sharp
dc0da8df7e Revert "lib: add link-state prefixes"
This reverts commit c8172af682.

(cherry picked from commit bbe3163a1b)
2023-10-11 05:02:52 +00:00
Donald Sharp
9b9d1809cc Revert "bgpd: store bgp link-state prefixes"
This reverts commit 39a8d354c1.

(cherry picked from commit 59c3a49166)
2023-10-11 05:02:52 +00:00
Donald Sharp
f5132b151d Revert "bgpd: send bgp link-state prefixes"
This reverts commit 0c94fb9cc8.

(cherry picked from commit f75d9050fc)
2023-10-11 05:02:52 +00:00
Donald Sharp
d636ba86c0 Revert "bgpd, lib: extend the size of the prefix string buffer"
This reverts commit bdb3fa3b92.

(cherry picked from commit 8b3e765d19)
2023-10-11 05:02:52 +00:00
Donald Sharp
5bb55d29f5 Revert "bgpd: do not display vty output headers for link-state prefixes"
This reverts commit 3098772467.

(cherry picked from commit 85a63731dc)
2023-10-11 05:02:52 +00:00
Donald Sharp
35b55e6fc2 Revert "bgpd: display link-state prefixes detail"
This reverts commit 7e0d9ff8ba.

(cherry picked from commit 8a6b65f7fd)
2023-10-11 05:02:51 +00:00
Donald Sharp
22f952a7f5 Revert "bgpd: do not announce link-state routes to zebra"
This reverts commit 39fb34275f.

(cherry picked from commit 4ab7fa86b0)
2023-10-11 05:02:51 +00:00
Donald Sharp
cb7df45e6a Revert "bgpd: add bgp default link-state command"
This reverts commit 38a7e20fc9.

(cherry picked from commit 7679d6056b)
2023-10-11 05:02:51 +00:00
Donald Sharp
8e063b9c05 Revert "bgpd: add show bgp link-state link-state commands"
This reverts commit f11f67033f.

(cherry picked from commit d3261fd83f)
2023-10-11 05:02:50 +00:00
Donald Sharp
ca8af99dbb Revert "bgpd: add linkstate debug"
This reverts commit de38eada9c.

(cherry picked from commit 68bae36376)
2023-10-11 05:02:50 +00:00
Donald Sharp
880183419a Revert "tests: add bgp_linkstate_topo1"
This reverts commit a0e6cd4c8f.

(cherry picked from commit c4edb3a453)
2023-10-11 05:02:50 +00:00
Donald Sharp
492d542ba0 Revert "doc: move bgp references at the right place"
This reverts commit 709fe971fd.

(cherry picked from commit c274093587)
2023-10-11 05:02:50 +00:00
Donald Sharp
8a1f5422e2 Revert "doc: add the bgp link-state user documentation"
This reverts commit 115f4f1ddd.

(cherry picked from commit da622a28e6)
2023-10-11 05:02:50 +00:00
Donald Sharp
e3f8e7d798 Revert "bgpd: store and send bgp link-state attributes"
This reverts commit 8b531b1107.

(cherry picked from commit 166e52d6a3)
2023-10-11 05:02:49 +00:00
Donald Sharp
89bf992b84 Revert "tests: add link-state attribute display in bgp_linkstate_topo1"
This reverts commit 5727195cbf.

(cherry picked from commit 547a0d02aa)
2023-10-11 05:02:49 +00:00
Donald Sharp
5dab3bb097 Revert "doc: add information to display bgp-ls attributes"
This reverts commit 8074d6f438.

(cherry picked from commit 63d2016da8)
2023-10-11 05:02:49 +00:00
Donald Sharp
a6f5a7aeef Revert "bgpd: do not check attr in bgp_packet_attribute"
This reverts commit eb9e286511.

(cherry picked from commit e7c0191e82)
2023-10-11 05:02:49 +00:00
Donald Sharp
609ee2bd4b Revert "bgpd: fix illegal memory access in bgp_ls_tlv_check_size()"
This reverts commit dae5791c44.

(cherry picked from commit 73a4891ab3)
2023-10-11 05:02:49 +00:00
Donald Sharp
0f02b85a18 Revert "bgpd: fix link_state_hash_cmp()"
This reverts commit 25408c8dbf.

(cherry picked from commit 2263d11630)
2023-10-11 05:02:48 +00:00
Donald Sharp
8ed3bbd19d Revert "bgpd: fix insecure data write with ip addresses"
This reverts commit 54222f9213.

(cherry picked from commit 298d534013)
2023-10-11 05:02:48 +00:00
Donald Sharp
83d4391f7b Revert "bgpd: fix insecure data write with area addresses"
This reverts commit 57d0dc565f.

(cherry picked from commit c0d3acb0a0)
2023-10-11 05:02:48 +00:00
Donald Sharp
82a5f9ee3f Revert "bgpd: fix printing link state ospf opaque data"
This reverts commit e1333d12e0.

(cherry picked from commit 28dab73877)
2023-10-11 05:02:47 +00:00
mobash-rasool
9b6f41bfbe
Merge pull request #13617 from anlancs/fix/pimd-remove-pimreg-vrf
pimd: Fix missing pimreg interface
2023-10-10 22:10:24 +05:30
Russ White
03d1b44c9b
Merge pull request #14535 from opensourcerouting/fix/bgp_aggregate_stuff
bgpd: Drop redundant assignment for aspath segment type and length
2023-10-10 11:36:34 -04:00
Chirag Shah
0ddda5cd96
Merge pull request #14515 from mjstapp/fix_nhg_intf_uninstall
zebra: be more careful removing 'installed' flag from nhgs
2023-10-10 08:30:55 -07:00
Russ White
cc63e16a52
Merge pull request #14548 from raja-rajasekar/frr_dev1
zebra: Prevent leaking ctx memory in err condition
2023-10-10 11:05:11 -04:00
Donald Sharp
078bef324c
Merge pull request #14550 from Keelan10/fix-nexthop_group-leak
zebra: Free nexthop_group
2023-10-10 10:11:48 -04:00
Keelan10
92598cb2b9 zebra: Free nexthop_group
`ng` was not properly freed, leading to a memory leak.
The commit calls `nexthop_group_delete` to free memory associated with `ng`.

The ASan leak log for reference:

```
***********************************************************************************
Address Sanitizer Error detected in isis_topo1.test_isis_topo1/r5.asan.zebra.24308

=================================================================
==24308==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7f4f47b43d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f4f4753c0a8 in qcalloc lib/memory.c:105
    #2 0x7f4f47559526 in nexthop_group_new lib/nexthop_group.c:270
    #3 0x562ded6a39d4 in zebra_add_import_table_entry zebra/redistribute.c:681
    #4 0x562ded787c35 in rib_link zebra/zebra_rib.c:3972
    #5 0x562ded787c35 in rib_addnode zebra/zebra_rib.c:3993
    #6 0x562ded787c35 in process_subq_early_route_add zebra/zebra_rib.c:2860
    #7 0x562ded787c35 in process_subq_early_route zebra/zebra_rib.c:3138
    #8 0x562ded787c35 in process_subq zebra/zebra_rib.c:3178
    #9 0x562ded787c35 in meta_queue_process zebra/zebra_rib.c:3228
    #10 0x7f4f475f7118 in work_queue_run lib/workqueue.c:266
    #11 0x7f4f475dc7f2 in event_call lib/event.c:1969
    #12 0x7f4f4751f347 in frr_run lib/libfrr.c:1213
    #13 0x562ded69e818 in main zebra/main.c:486
    #14 0x7f4f468ffc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 152 byte(s) in 1 object(s) allocated from:
    #0 0x7f4f47b43d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f4f4753c0a8 in qcalloc lib/memory.c:105
    #2 0x7f4f475510ad in nexthop_new lib/nexthop.c:376
    #3 0x7f4f475539c5 in nexthop_dup lib/nexthop.c:914
    #4 0x7f4f4755b27a in copy_nexthops lib/nexthop_group.c:444
    #5 0x562ded6a3a1c in zebra_add_import_table_entry zebra/redistribute.c:682
    #6 0x562ded787c35 in rib_link zebra/zebra_rib.c:3972
    #7 0x562ded787c35 in rib_addnode zebra/zebra_rib.c:3993
    #8 0x562ded787c35 in process_subq_early_route_add zebra/zebra_rib.c:2860
    #9 0x562ded787c35 in process_subq_early_route zebra/zebra_rib.c:3138
    #10 0x562ded787c35 in process_subq zebra/zebra_rib.c:3178
    #11 0x562ded787c35 in meta_queue_process zebra/zebra_rib.c:3228
    #12 0x7f4f475f7118 in work_queue_run lib/workqueue.c:266
    #13 0x7f4f475dc7f2 in event_call lib/event.c:1969
    #14 0x7f4f4751f347 in frr_run lib/libfrr.c:1213
    #15 0x562ded69e818 in main zebra/main.c:486
    #16 0x7f4f468ffc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 184 byte(s) leaked in 2 allocation(s).
***********************************************************************************
```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
2023-10-10 13:13:09 +04:00
Donatas Abraitis
69a0d59990
Merge pull request #14451 from m-varasteh/ospf-coverity-issues
ospfd: a possible fix for TAINTED_SCALAR coverity issues
2023-10-10 09:01:03 +03:00
Donald Sharp
556fdaa69d
Merge pull request #14533 from mjstapp/fix_rule_notify_vrf
lib,*: add vrf id to pbr rule results zapi message
2023-10-09 14:07:12 -04:00
Rajasekar Raja
11b987ed2f zebra: Prevent leaking ctx memory in err condition
When netlink_link_change() errors out for a new link for
interface without MTU set, the allocated ctx is not freed..
Adding code for correctness

Ticket# 3628313

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2023-10-09 17:09:57 +00:00
Donald Sharp
b966802362
Merge pull request #14543 from mjstapp/fix_pbr_rule_unique
zebra: add zclient to iprules key
2023-10-09 10:36:00 -04:00
Rafael Zalamena
4a60045688
Merge pull request #10733 from anlancs/zebra-remove-update
zebra: remove ZEBRA_INTERFACE_VRF_UPDATE
2023-10-08 10:52:54 -03:00
Rafael Zalamena
5c0a5aa616
Merge pull request #14541 from idryzhov/isis-fix-cb-destroy
isisd: remove redundant northbound destroy callbacks
2023-10-08 10:49:03 -03:00
anlan_cs
56f141e64b doc: replace commands list with header file
Signed-off-by: anlan_cs <anlan_cs@tom.com>
2023-10-07 10:06:59 +08:00
anlan_cs
b580c52698 *: remove ZEBRA_INTERFACE_VRF_UPDATE
Currently when one interface changes its VRF, zebra will send these messages to
all daemons in *order*:
    1) `ZEBRA_INTERFACE_DELETE` ( notify them delete from old VRF )
    2) `ZEBRA_INTERFACE_VRF_UPDATE` ( notify them move from old to new VRF )
    3) `ZEBRA_INTERFACE_ADD` ( notify them added into new VRF )

When daemons deal with `VRF_UPDATE`, they use
`zebra_interface_vrf_update_read()->if_lookup_by_name()`
to check the interface exist or not in old VRF. This check will always return
*NULL* because `DELETE` ( deleted from old VRF ) is already done, so can't
find this interface in old VRF.

Send `VRF_UPDATE` is redundant and unuseful. `DELETE` and `ADD` are enough,
they will deal with RB tree, so don't send this `VRF_UPDATE` message when
vrf changes.

Since all daemons have good mechanism to deal with changing vrf, and don't
use this `VRF_UPDATE` mechanism.  So, it is safe to completely remove
all the code with `VRF_UPDATE`.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2023-10-07 10:06:39 +08:00
Mark Stapp
a09cb688a0 zebra: add zclient to iprules key
Include a zclient value in the hash and tree key computations
for iprules in zebra: clients may collide without this.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-10-06 12:26:38 -04:00
Igor Ryzhov
6d8963f3e6 isisd: remove redundant northbound destroy callbacks
Fixes startup warnings:
```
ISIS: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-isisd:isis/instance/segment-routing-srv6/msd/node-msd/max-segs-left'
ISIS: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-isisd:isis/instance/segment-routing-srv6/msd/node-msd/max-end-pop'
ISIS: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-isisd:isis/instance/segment-routing-srv6/msd/node-msd/max-h-encaps'
ISIS: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-isisd:isis/instance/segment-routing-srv6/msd/node-msd/max-end-d'
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-10-06 17:37:41 +03:00
Mark Stapp
4fabe90c7f lib,*: add vrf id to pbr rule results zapi message
The iprule/pbr rule object has a vrf id, and zebra uses
that internally, but the vrf id isn't returned to clients
who install rules and are waiting for results. Include the
vrf_id sent by the client in the zapi result notification
message; update the existing clients so they decode the id.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-10-05 16:22:40 -04:00
Donatas Abraitis
fc9a8da45e bgpd: Drop redundant assignment for aspath segment type and length
They are already initialized via assegment_new().

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-05 22:46:54 +03:00
Donald Sharp
c516447847
Merge pull request #14534 from mjstapp/fix_topo_nhgid
tests: locate nhg id from json output in all_proto_startup
2023-10-05 15:36:27 -04:00
Mark Stapp
22fb94a248 tests: locate nhg id from json output in all_proto_startup
Don't hard-code a sharpd nhg id: those values aren't stable
if the daemons/protos/route-types change. Use json show output
to find the id in the 'resilient' nhg test case in
the all_protocol_startup suite.

Signed-off-by: Mark Stapp <mjs@labn.net>
2023-10-05 13:47:17 -04:00