summaryrefslogtreecommitdiff
path: root/bgpd
AgeCommit message (Collapse)Author
2025-02-27bgpd: fix leaving hidden stateLouis Scalbert
Upon configuration of a VRF instance that references an absent default VRF with "import vrf default", the default instance is created in hidden state. However, the default instance is not properly un-hidden when configured. Restore the behavior prior to commit below. Fixes: 9f7177af13 ("bgpd: fix duplicate BGP instance created with unified config") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> (cherry picked from commit 70e07678bfe554dd5be30a605ddf6c0fe3a8a39b) Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-27bgpd: update AS value of a hidden bgp instanceAlexander Skorichenko
'import vrf VRF' could define a hidden bgp instance with the default AS_UNSPECIFIED (i.e. = 1) value. When a router bgp AS vrf VRF gets configured later on, replace this AS_UNSPECIFIED setting with a requested value. Fixes: 9680831518 ("bgpd: fix as_pretty mem leaks when un-hiding") Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> (cherry picked from commit 1515a59202280933936b41c4cb2cb11c7889b279) Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-27Revert "bgpd: fix bgp vrf instance creation from implicit"Louis Scalbert
This reverts commit 2ff08af78e315c69795417d150cd23649f68c655. The fix is obviously wrong. Link: 2ff08af78e315c69795417d150cd23649f68c655 Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> (cherry picked from commit 339206341fa08c57316559eb3733d216236dfe9d) Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-27bgpd: fix process_queue when un-hidingLouis Scalbert
bgp_process_queue_init() is not called in bgp_create() when leaving the BGP instance hidden state because of the following goto: > if (hidden) { > bgp = bgp_old; > goto peer_init; > } Upon reconfiguration of the default instance, the prefixes are never set into a meta queue by mq_add_handler(). They are never processed for zebra RIB installation and announcements of update/withdraw. Do not delete the BGP process_queue when hiding. Fixes: 4d0e7a49cf ("bgpd: VRF-Lite fix default bgp delete") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> (cherry picked from commit 71a3756f2dda272e69727fa416bca12c016d9567) Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-27bgpd: fix default instance name when un-hidingLouis Scalbert
When unconfiguring a default BGP instance with VPN SAFI configurations, the default BGP structure remains but enters a hidden state. Upon reconfiguration, the instance name incorrectly appears as "VIEW ?" instead of "VRF default". And the name_pretty pointer The name_pretty pointer is replaced by another one with the incorrect name. This also leads to a memory leak as the previous pointer is not properly freed. Do not rewrite the instance name. Fixes: 4d0e7a49cf ("bgpd: VRF-Lite fix default bgp delete") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> (cherry picked from commit d2ff7e8a2117ad4bc38cec0e48c6b3c11dc49c91) Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-26Merge pull request #18255 from Jafaral/no-bgp-hiddenDonald Sharp
Revert "bgpd: fix default instance when leaving the hidden state (backport 10.3)" #18162
2025-02-25Revert "bgpd: fix default instance name when un-hiding"Jafar Al-Gharaibeh
This reverts commit 20664936afc7f952a51a19ab26daece5105bbee5. Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-02-25Revert "bgpd: fix process_queue when un-hiding"Jafar Al-Gharaibeh
This reverts commit a2c1956efa399c6770605712d0b53e5f24979acc. Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-02-25Reapply "bgpd: fix bgp vrf instance creation from implicit"Jafar Al-Gharaibeh
This reverts commit d9d74d33bca0e23a2cd4723fbc4709dc83fd1332. Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-02-25Revert "bgpd: update AS value of a hidden bgp instance"Jafar Al-Gharaibeh
This reverts commit 8e04277fff9597412198da123250e1951bfc580d. Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-02-21bgpd: remove dmed check not required in bestpath selectionDonald Sharp
As part of the upstream master commit (f3575f61c7 bgpd: Sort the bgp_path_inf) the snippet of the code for dmed check condition left out, which leads to an issue of selecting incorrect bestpath. As an example: During the bestpath selection local route looses to another path due to dmed condition being hit. The snippet of the logs: 2025/02/20 03:06:20.131441 BGP: [JW7VP-K1YVV] [2]:[0]:[48]:[00:92:00:00:00:10](VRF default): Comparing path 27.0.0.7 flags Valid with path Static announcement flags Selected Valid Attr Changed Unsorted 2025/02/20 03:06:20.131445 BGP: [SYTDR-QV6X9] [2]:[0]:[48]:[00:92:00:00:00:10]: path 27.0.0.7 loses to path Static announcement as ES 03:44:38:39:ff:ff:02:00:00:01 is same and local 2025/02/20 03:06:20.131452 BGP: [JW7VP-K1YVV] [2]:[0]:[48]:[00:92:00:00:00:10](VRF default): Comparing path 27.0.0.8 flags Valid with path Static announcement flags Selected Valid Attr Changed Unsorted 2025/02/20 03:06:20.131456 BGP: [SYTDR-QV6X9] [2]:[0]:[48]:[00:92:00:00:00:10]: path 27.0.0.8 loses to path Static announcement as ES 03:44:38:39:ff:ff:02:00:00:01 is same and local 2025/02/20 03:06:20.131458 BGP: [WEWEC-8SE72] [2]:[0]:[48]:[00:92:00:00:00:10](VRF default): path Static announcement is the bestpath from AS 0 <<<< static is best 2025/02/20 03:06:20.131463 BGP: [Z3A78-GM3G5] bgp_best_selection: [2]:[0]:[48]:[00:92:00:00:00:10](VRF default) pi 27.0.0.7 dmed 2025/02/20 03:06:20.131467 BGP: [Z3A78-GM3G5] bgp_best_selection: [2]:[0]:[48]:[00:92:00:00:00:10](VRF default) pi 27.0.0.8 dmed 2025/02/20 03:06:20.131471 BGP: [N6CTF-2RSKS] [2]:[0]:[48]:[00:92:00:00:00:10](VRF default): After path selection, newbest is path 27.0.0.7 oldbest was Static announce Signed-off-by: Donald Sharp <sharpd@nvidia.com> (cherry picked from commit 83ad94694bc061e1ff5f43db42cba46320e0df73)
2025-02-19Merge pull request #18162 from louis-6wind/bgp-hidden-10.3Donald Sharp
bgpd: fix default instance when leaving the hidden state (backport 10.3)
2025-02-17Merge pull request #18143 from FRRouting/mergify/bp/dev/10.3/pr-18079Jafar Al-Gharaibeh
bgpd: Fix crash in bgp_labelpool (backport #18079)
2025-02-16Merge pull request #18166 from FRRouting/mergify/bp/dev/10.3/pr-18160Donald Sharp
bgpd: When removing the prefix list drop the pointer (backport #18160)
2025-02-15bgpd: fix vty output of evpn route-target AS4Mark Stapp
evpn route-targets are decoded in ... multiple places; at least two have a bug where the AS4 form doesn't have its AS decoded. Signed-off-by: Mark Stapp <mjs@cisco.com> (cherry picked from commit 9943a08720ccbed87cd6938791066a0de94a92c6)
2025-02-14bgpd: When removing the prefix list drop the pointerDonald Sharp
We are very very rarely seeing this crash: 0 0x7f36ba48e389 in prefix_list_apply_ext lib/plist.c:789 1 0x55eff3fa4126 in subgroup_announce_check bgpd/bgp_route.c:2334 2 0x55eff3fa858e in subgroup_process_announce_selected bgpd/bgp_route.c:3440 3 0x55eff4016488 in subgroup_announce_table bgpd/bgp_updgrp_adv.c:808 4 0x55eff401664e in subgroup_announce_route bgpd/bgp_updgrp_adv.c:861 5 0x55eff40111df in peer_af_announce_route bgpd/bgp_updgrp.c:2223 6 0x55eff3f884cb in bgp_announce_route_timer_expired bgpd/bgp_route.c:5892 7 0x7f36ba4ec239 in event_call lib/event.c:2019 8 0x7f36ba41a22a in frr_run lib/libfrr.c:1295 9 0x55eff3e668b7 in main bgpd/bgp_main.c:557 10 0x7f36b9e2d249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 11 0x7f36b9e2d304 in __libc_start_main_impl ../csu/libc-start.c:360 12 0x55eff3e64a30 in _start (/home/ci/cibuild.1407/frr-source/bgpd/.libs/bgpd+0x2fda30) 0x608000037038 is located 24 bytes inside of 88-byte region [0x608000037020,0x608000037078) freed by thread T0 here: 0 0x7f36ba8b76a8 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:52 1 0x7f36ba439bd7 in qfree lib/memory.c:131 2 0x7f36ba48d3a3 in prefix_list_free lib/plist.c:156 3 0x7f36ba48d3a3 in prefix_list_delete lib/plist.c:247 4 0x7f36ba48fbef in prefix_bgp_orf_remove_all lib/plist.c:1516 5 0x55eff3f679c4 in bgp_route_refresh_receive bgpd/bgp_packet.c:2841 6 0x55eff3f70bab in bgp_process_packet bgpd/bgp_packet.c:4069 7 0x7f36ba4ec239 in event_call lib/event.c:2019 8 0x7f36ba41a22a in frr_run lib/libfrr.c:1295 9 0x55eff3e668b7 in main bgpd/bgp_main.c:557 10 0x7f36b9e2d249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 previously allocated by thread T0 here: 0 0x7f36ba8b83b7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77 1 0x7f36ba4392e4 in qcalloc lib/memory.c:106 2 0x7f36ba48d0de in prefix_list_new lib/plist.c:150 3 0x7f36ba48d0de in prefix_list_insert lib/plist.c:186 4 0x7f36ba48d0de in prefix_list_get lib/plist.c:204 5 0x7f36ba48f9df in prefix_bgp_orf_set lib/plist.c:1479 6 0x55eff3f67ba6 in bgp_route_refresh_receive bgpd/bgp_packet.c:2920 7 0x55eff3f70bab in bgp_process_packet bgpd/bgp_packet.c:4069 8 0x7f36ba4ec239 in event_call lib/event.c:2019 9 0x7f36ba41a22a in frr_run lib/libfrr.c:1295 10 0x55eff3e668b7 in main bgpd/bgp_main.c:557 11 0x7f36b9e2d249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 Let's just stop trying to save the pointer around in the peer->orf_plist data structure. There are other design problems but at least lets stop the crash from possibly happening. Fixes: #18138 Signed-off-by: Donald Sharp <sharpd@nvidia.com> (cherry picked from commit 3d43d7b78971520854903c11b6aec23754fdca34)
2025-02-14bgpd: update AS value of a hidden bgp instanceAlexander Skorichenko
'import vrf VRF' could define a hidden bgp instance with the default AS_UNSPECIFIED (i.e. = 1) value. When a router bgp AS vrf VRF gets configured later on, replace this AS_UNSPECIFIED setting with a requested value. Fixes: 9680831518 ("bgpd: fix as_pretty mem leaks when un-hiding") Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com> Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-14Revert "bgpd: fix bgp vrf instance creation from implicit"Louis Scalbert
This reverts commit 2ff08af78e315c69795417d150cd23649f68c655. The fix is obviously wrong. Link: 2ff08af78e315c69795417d150cd23649f68c655 Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-14bgpd: fix process_queue when un-hidingLouis Scalbert
bgp_process_queue_init() is not called in bgp_create() when leaving the BGP instance hidden state because of the following goto: > if (hidden) { > bgp = bgp_old; > goto peer_init; > } Upon reconfiguration of the default instance, the prefixes are never set into a meta queue by mq_add_handler(). They are never processed for zebra RIB installation and announcements of update/withdraw. Do not delete the BGP process_queue when hiding. Fixes: 4d0e7a49cf ("bgpd: VRF-Lite fix default bgp delete") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-14bgpd: fix default instance name when un-hidingLouis Scalbert
When unconfiguring a default BGP instance with VPN SAFI configurations, the default BGP structure remains but enters a hidden state. Upon reconfiguration, the instance name incorrectly appears as "VIEW ?" instead of "VRF default". And the name_pretty pointer The name_pretty pointer is replaced by another one with the incorrect name. This also leads to a memory leak as the previous pointer is not properly freed. Do not rewrite the instance name. Fixes: 4d0e7a49cf ("bgpd: VRF-Lite fix default bgp delete") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-13bgpd: release manual vpn label on instance deletionLouis Scalbert
When a BGP instance with a manually assigned VPN label is deleted, the label is not released from the Zebra label registry. As a result, reapplying a configuration with the same manual label leads to VPN prefix export failures. For example, with the following configuration: > router bgp 65000 vrf BLUE > address-family ipv4 unicast > label vpn export <int> Release zebra label registry on unconfiguration. Fixes: d162d5f6f5 ("bgpd: fix hardset l3vpn label available in mpls pool") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> (cherry picked from commit d6363625c35a99933bf60c9cf0b79627b468c9f7)
2025-02-13bgpd: Fix crash in bgp_labelpoolDonald Sharp
The bgp labelpool code is grabbing the vpn policy data structure. This vpn_policy has a pointer to the bgp data structure. If a item placed on the bgp label pool workqueue happens to sit there for the microsecond or so and the operator issues a `no router bgp...` command that corresponds to the vpn_policy bgp pointer, when the workqueue is run it will crash because the bgp pointer is now freed and something else owns it. Modify the labelpool code to store the vrf id associated with the request on the workqueue. When you wake up if the vrf id still has a bgp pointer allow the request to continue, else drop it. Signed-off-by: Donald Sharp <sharpd@nvidia.com> (cherry picked from commit 14eac319e8ae9314f5270f871106a70c4986c60c)
2025-02-12Merge pull request #18132 from ↵Jafar Al-Gharaibeh
opensourcerouting/fix/backport_82d28f137aed2e60380807a302e2b312408eff6e_10.3 Cid 1636504 (backport)
2025-02-12bgpd: fix incorrect json in bgp_show_table_rdLouis Scalbert
In bgp_show_table_rd(), the is_last argument is determined using the expression "next == NULL" to check if the RD table is the last one. This helps ensure proper JSON formatting. However, if next is not NULL but is no longer associated with a BGP table, the JSON output becomes malformed. Updates the condition to also verify the existence of the next bgp_dest table. Fixes: 1ae44dfcba ("bgpd: unify 'show bgp' with RD with normal unicast bgp show") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> (cherry picked from commit cf0269649cdd09b8d3f2dd8815caf6ecf9cdeef9)
2025-02-12bgpd: fix bgp label evpn CID 1636504Philippe Guibert
The following static analysis can be seen : > *** CID 1636504: (ARRAY_VS_SINGLETON) > /bgpd/bgp_evpn_mh.c: 1241 in bgp_evpn_type1_route_process() > 1235 build_evpn_type1_prefix(&p, eth_tag, &esi, vtep_ip); > 1236 /* Process the route. */ > 1237 if (attr) { > 1238 bgp_update(peer, (struct prefix *)&p, addpath_id, attr, afi, safi, ZEBRA_ROUTE_BGP, > 1239 BGP_ROUTE_NORMAL, &prd, &label, num_labels, 0, NULL); > 1240 } else { > >>> CID 1636504: (ARRAY_VS_SINGLETON) > >>> Passing "&label" to function "bgp_withdraw" which uses it as an array. This might corrupt or misinterpret adjacent memory locations. > 1241 bgp_withdraw(peer, (struct prefix *)&p, addpath_id, afi, safi, ZEBRA_ROUTE_BGP, > 1242 BGP_ROUTE_NORMAL, &prd, &label, num_labels); > 1243 } > 1244 return 0; > 1245 } > 1246 > /bgpd/bgp_evpn_mh.c: 1238 in bgp_evpn_type1_route_process() > 1232 * table > 1233 */ > 1234 vtep_ip.s_addr = INADDR_ANY; > 1235 build_evpn_type1_prefix(&p, eth_tag, &esi, vtep_ip); > 1236 /* Process the route. */ > 1237 if (attr) { > >>> CID 1636504: (ARRAY_VS_SINGLETON) > >>> Passing "&label" to function "bgp_update" which uses it as an array. This might corrupt or misinterpret adjacent memory locations. > 1238 bgp_update(peer, (struct prefix *)&p, addpath_id, attr, afi, safi, ZEBRA_ROUTE_BGP, > 1239 BGP_ROUTE_NORMAL, &prd, &label, num_labels, 0, NULL); > 1240 } else { > 1241 bgp_withdraw(peer, (struct prefix *)&p, addpath_id, afi, safi, ZEBRA_ROUTE_BGP, > 1242 BGP_ROUTE_NORMAL, &prd, &label, num_labels); > 1243 } Fix this by declaring a label array instead of a single array. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2025-02-12bgpd: simplify bgp_evpn_process_rt1 with labelPhilippe Guibert
Remove the num_labels variable, the received bgp_update() and bgp_withdraw() function will read the message as including one label or vni value. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2025-02-12Merge pull request #18083 from FRRouting/mergify/bp/dev/10.3/pr-17901Donald Sharp
lib: actually hash all 16 bytes of IPv6 addresses, not just 4 (backport #17901)
2025-02-12bgpd: Request SRv6 locator after zebra connectionCarmine Scarpitta
When SRv6 is enabled and an SRv6 locator is specified in the BGP configuration, BGP may attempt to request SRv6 locator information from zebra before the connection is fully established. If this occurs, the request fails with the following error: ``` 2025/02/06 16:37:32 BGP: [HR66R-TWQYD][EC 100663302] srv6_manager_get_locator: invalid zclient socket ```` As a result, BGP is unable to obtain the locator information, preventing SRv6 VPN from working. This commit fixes the issue by ensuring BGP requests SRv6 locator information once the connection with zebra is successfully established. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com> (cherry picked from commit 16640b615dfabfd8e18dd091b1d4a63dfa7bf9fe)
2025-02-11bgpd: fix bgp vrf instance creation from implicitChirag Shah
In bgp route leak, when import vrf x is executed, it creates bgp instance as hidden with asn value as unspecified. When router bgp x is configured ensure the correct as, asnotation is applied otherwise running config shows asn value as 0. This can lead to frr-reload failure when any FRR config change. Fix: Move asn and asnotiation, as_pretty value in common done section, so when bgp_create gets existing instance but before returning update asn and required fields in common section. In bgp_create(): when returning for hidden at least update asn and required when bgp instance created implicitly due to vrf leak. if (hidden) { bgp = bgp_old; goto peer_init; <<< } Before fix: show running: router bgp 0 vrf purple bgp router-id 10.10.3.11 ! address-family ipv4 unicast redistribute static import vrf blue exit-address-family ! address-family ipv6 unicast import vrf blue exit-address-family ! address-family l2vpn evpn advertise ipv4 unicast advertise ipv6 unicast exit-address-family exit Testing: 1) following snippet config: router bgp 63420 vrf blue import vrf purple router bgp 63420 vrf purple import vrf blue 2) restart frr leads to the running config with 0 asn value. Signed-off-by: Chirag Shah <chirag@nvidia.com> (cherry picked from commit 2ff08af78e315c69795417d150cd23649f68c655)
2025-02-11bgpd: don't reuse nexthop variable in loop/switchDavid Lamparter
While the loop is currently exited in all cases after using nexthop, it is a footgun to have "nh" around to be reused in another iteration of the loop. This would leave nexthop with partial data from the previous use. Make it local where needed instead. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit ce7f5b21221f0b3557d1f4a40793230d8bc4cf02)
2025-02-06bgpd: Ensure ibuf count is protected by mutexDonald Sharp
Grab the count of streams in ibuf when it is protected by a mutex. Since this data is written to it in another pthread. Signed-off-by: Donald Sharp <sharpd@nvidia.com> (cherry picked from commit f94ad538cf93d2b18fa4181e8508f08f94f0a2cc)
2025-02-05bgpd: Fix up memory leak in processing eoiu markerDonald Sharp
Memory is being leaked when processing the eoiu marker. BGP is creating a dummy dest to contain the data but it was never freed. As well as the eoiu info was not being freed either. Signed-off-by: Donald Sharp <sharpd@nvidia.com> (cherry picked from commit c6b7a993fb2961e04d069f1779498342aa7932fd)
2025-02-04bgpd: Do not start BGP session if BGP identifier is not setDonatas Abraitis
If we have IPv6-only network and no IPv4 addresses at all, then by default 0.0.0.0 is created which is treated as malformed according to RFC 6286. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit 739f2b566a8217acce84d4c21aaf033314f535bb)
2025-02-04Merge pull request #17992 from chiragshah6/fdev5Russ White
bgpd: fix route-distinguisher in vrf leak json cmd
2025-02-04Merge pull request #17990 from enkechen-panw/aigp-cfg-defaultDonatas Abraitis
bgpd: add config default for "bgp bestpath aigp"
2025-02-03bgpd: fix route-distinguisher in vrf leak json cmdChirag Shah
For auto configured value RD value comes as NULL, switching back to original change will ensure to cover for both auto and user configured RD value in JSON. tor-11# show bgp vrf blue ipv4 unicast route-leak json { "vrf":"blue", "afiSafi":"ipv4Unicast", "importFromVrfs":[ "purple" ], "importRts":"10.10.3.11:6", "exportToVrfs":[ "purple" ], "routeDistinguisher":"(null)", <<<<< "exportRts":"10.10.3.11:10" } Signed-off-by: Chirag Shah <chirag@nvidia.com>
2025-02-03Merge pull request #17913 from Sokolmish/bgp-sid-releaseCarmine Scarpitta
bgpd: Release SID on router deletion
2025-02-02bgpd: add config default for "bgp bestpath aigp"Enke Chen
Just to make it simpler for compiling with a different default value. No change to its default value. Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2025-02-02Merge pull request #17947 from opensourcerouting/fix/bgp_disable_vrfRuss White
bgpd: Do not ignore auto generated VRF instances when deleting
2025-02-02Merge pull request #17972 from enkechen-panw/rr-policyDonatas Abraitis
bgpd: add config default for "route-reflector allow-outbound-policy"
2025-02-01bgpd: add config default for "route-reflector allow-outbound-policy"Enke Chen
Just to make it simpler for compiling with a different default value. No change to its default value. Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2025-01-31bgpd: With suppress-fib-pending ensure withdrawal is sentDonald Sharp
When you have suppress-fib-pending turned on it is possible to end up in a situation where the prefix is not withdrawn from downstream peers. Here is the timing that I believe is happening: a) have 2 paths to a peer. b) receive a withdrawal from 1 path, set BGP_NODE_FIB_INSTALL_PENDING and send the route install to zebra. c) receive a withdrawal from the other path. d) At this point we have a dest->flags set BGP_NODE_FIB_INSTALL_PENDING old_select the path_info going away, new_select is NULL e) A bit further down we call group_announce_route() which calls the code to see if we should advertise the path. It sees the BGP_NODE_FIB_INSTALL_PENDING flag and says, nope. f) the route is sent to zebra to withdraw, which unsets the BGP_NODE_FIB_INSTALL_PENDING. g) This function winds up and deletes the path_info. Dest now has no path infos. h) BGP receives the route install(from step b) and unsets the BGP_NODE_FIB_INSTALL_PENDING flag i) BGP receives the route removed from zebra (from step f) and unsets the flag again. We know if there is no new_select, let's go ahead and just unset the PENDING flag to allow the withdrawal to go out at the time when the second withdrawal is received. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-01-30bgpd: Release SID on router deletionMikhail Sokolovskiy
Signed-off-by: Mikhail Sokolovskiy <sokolmish@gmail.com>
2025-01-28Merge pull request #17802 from askorichenko/test-fix-table-mapRuss White
bgpd: fix table-map option
2025-01-28Merge pull request #17924 from donaldsharp/evaluate_paths_optimizationRuss White
bgpd: Optimize evaluate paths for a peer going down
2025-01-28Merge pull request #17881 from opensourcerouting/fix/last_reset_reasonRuss White
bgpd: last reset SNAFU
2025-01-28Merge pull request #17863 from opensourcerouting/fix/bgp_coverity_1617727Russ White
bgpd: Check if the peer really exists before sending dynamic capability
2025-01-28Merge pull request #17736 from opensourcerouting/table-directRuss White
bgpd,lib,zebra: permit table-direct on VRFs
2025-01-28bgpd: Do not ignore auto generated VRF instances when deletingDonatas Abraitis
When VRF instance is going to be deleted inside bgp_vrf_disable(), it uses a helper method that skips auto created VRF instances and that leads to STALE issue. When creating a VNI for a particular VRF vrfX with e.g. `advertise-all-vni`, auto VRF instance is created, and then we do `router bgp ASN vrf vrfX`. But when we do a reload bgp_vrf_disable() is called, and we miss previously created auto instance. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-28bgpd: fix table-map optionAlexander Skorichenko
Schedule zebra to withdraw routes filtered out by a table-map. Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>