summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-04-11Merge pull request #18639 from FRRouting/mergify/bp/stable/9.1/pr-15716stable/9.1Donald Sharp
isisd: Fix memory leaks when the transition of neighbor state from non-UP to DOWN (backport #15716)
2025-04-10isisd: Fix memory leaks when the transition of neighbor state from non-UP to ↵zhou-run
DOWN When receiving a hello packet, if the neighbor state transitions directly from a non-ISIS_ADJ_UP state (such as ISIS_ADJ_INITIALIZING) to ISIS_ADJ_DOWN state, the neighbor entry cannot be deleted. If the neighbor is removed or the neighbor's System ID changes, it may result in memory leakage in the neighbor entry. Test Scenario: LAN link between Router A and Router B is established. Router A does not configure neighbor authentication, while Router B is configured with neighbor authentication. When the neighbor entry on Router B ages out, the neighbor state on Router A transitions to INIT. If Router B is then removed, the neighbor state on Router A transitions to DOWN and persists. Signed-off-by: zhou-run <166502045+zhou-run@users.noreply.github.com> fix frrbot styling issues found. fix frrbot styling issues found. Signed-off-by: zhou-run <166502045+zhou-run@users.noreply.github.com> (cherry picked from commit 5009f7539ad6bf496158499917dcf3f7ab760753)
2025-02-15Merge pull request #18170 from FRRouting/mergify/bp/stable/9.1/pr-18160Donald Sharp
bgpd: When removing the prefix list drop the pointer (backport #18160)
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-12Merge pull request #18092 from FRRouting/mergify/bp/stable/9.1/pr-17935Donald Sharp
zebra: include resolving nexthops in nhg hash (backport #17935)
2025-02-11Merge pull request #18105 from FRRouting/mergify/bp/stable/9.1/pr-18060Jafar Al-Gharaibeh
lib: crash handlers must be allowed on threads (backport #18060)
2025-02-11Merge pull request #18087 from FRRouting/mergify/bp/stable/9.1/pr-17901Jafar Al-Gharaibeh
lib: actually hash all 16 bytes of IPv6 addresses, not just 4 (backport #17901)
2025-02-11lib: crash handlers must be allowed on threadsDavid Lamparter
Blocking all signals on non-main threads is not the way to go, at least the handlers for SIGSEGV, SIGBUS, SIGILL, SIGABRT and SIGFPE need to run so we get backtraces. Otherwise the process just exits. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit 13a6ac5b4ca8fc08b348f64de64a787982f24250)
2025-02-11lib: clean up nexthop hashing messDavid Lamparter
We were hashing 4 bytes of the address. Even for IPv6 addresses. Oops. The reason this was done was to try to make it faster, but made a complex maze out of everything. Time for a refactor. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit 001fcfa1dd9f7dc2639b4f5c7a52ab59cc425452)
2025-02-11lib: guard against padding garbage in ZAPI readDavid Lamparter
When reading in a nexthop from ZAPI, only set the fields that actually have meaning. While it shouldn't happen to begin with, we can otherwise carry padding garbage into the unused leftover union bytes. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit 4a0e1419a69d07496c7adfb744beecd00e1efef2)
2025-02-11zebra: guard against junk in nexthop->rmap_srcDavid Lamparter
rmap_src wasn't initialized, so for IPv4 the unused 12 bytes would contain whatever junk is on the stack on function entry. Also move the IPv4 parse before the IPv6 parse so if it's successful we can be sure the other bytes haven't been touched. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit b666ee510eb480da50476b1bbc84bdf8365df95c)
2025-02-11pbrd: initialize structs used in hash_lookupDavid Lamparter
Doesn't seem to break anything but really poor style to pass potentially uninitialized data to hash_lookup. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit c88589f5e9351654c04322eb395003297656989d)
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-11tests: Add a test that shows the v6 recursive nexthop problemDonald Sharp
Currently FRR does not handle v6 recurisive resolution properly when the route being recursed through changes and the most significant bits of the route are not changed. Signed-off-by: Donald Sharp <sharpd@nvidia.com> (cherry picked from commit 73ab6a46c51db91df297774221053ab8fc4d12ae)
2025-02-11zebra: include resolving nexthops in nhg hashMark Stapp
Ensure that the nhg hash comparison function includes all nexthops, including recursive-resolving nexthops. Signed-off-by: Mark Stapp <mjs@cisco.com> (cherry picked from commit cb7cf73992847cfd4af796085bf14f2fdc4fa8db)
2025-01-10Merge pull request #17818 from FRRouting/mergify/bp/stable/9.1/pr-17807Donatas Abraitis
bgpd: fix crash in displaying json orf prefix-list (backport #17807)
2025-01-09bgpd: fix crash in displaying json orf prefix-listLouis Scalbert
bgpd crashes when there is several entries in the prefix-list. No backtrace is provided because the issue was catched from a code review. Fixes: 856ca177c4 ("Added json formating support to show-...-neighbors-... bgp commands.") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> (cherry picked from commit 8ccf60921b85893d301186a0f8156fb702da379f)
2025-01-09bgpd: fix bgp orf prefix-list json prefixLouis Scalbert
0x<address>FX was displayed instead of the prefix. Fixes: b219dda129 ("lib: Convert usage of strings to %pFX and %pRN") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> (cherry picked from commit b7e843d7e8afe57d3815dbb44e30307654e73711)
2025-01-07Merge pull request #17791 from FRRouting/mergify/bp/stable/9.1/pr-17725Donald Sharp
isisd: Allow full `no` form for `domain-password` and `area-password` (backport #17725)
2025-01-07isisd: Allow full `no` form for `domain-password` and `area-password`Donatas Abraitis
Before: ``` LR1.wue3(config)# router isis VyOS LR1.wue3(config-router)# no area-password clear % Unknown command: no area-password clear LR1.wue3(config-router)# no area-password clear foo % Unknown command: no area-password clear foo LR1.wue3(config-router)# ``` Closes https://github.com/FRRouting/frr/issues/17722 Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit a696547d6c78d4140649f96d6bef9a335fe5dfa5)
2025-01-04Merge pull request #17758 from FRRouting/mergify/bp/stable/9.1/pr-17732Donatas Abraitis
isisd: Show correct level information for `show isis interface detail json` (backport #17732)
2025-01-03isisd: Show correct level information for `show isis interface detail json`Donatas Abraitis
Having this configuration: ``` ! interface r1-eth0 ip address 10.0.0.1/30 ip router isis 1 isis priority 44 level-1 isis priority 88 level-2 isis csnp-interval 90 level-1 isis csnp-interval 99 level-2 isis psnp-interval 70 level-1 isis psnp-interval 50 level-2 isis hello-interval level-1 120 isis hello-interval level-2 150 ! interface r1-eth1 ip address 10.0.0.10/30 ip router isis 1 ! interface lo ip address 192.0.2.1/32 ip router isis 1 isis passive ! router isis 1 net 49.0000.0000.0000.0001.00 metric-style wide ``` Produces: ``` { "areas":[ { "area":"1", "circuits":[ { "circuit":2, "interface":{ "name":"r1-eth0", "state":"Up", "is-passive":"active", "circuit-id":"0x2", "type":"lan", "level":"L1L2", "snpa":"6e28.9c92.da5e", "levels":[ { "level":"L1", "metric":10, "active-neighbors":1, "hello-interval":120, "holddown":{ "count":10, "pad":"yes" }, "cnsp-interval":90, "psnp-interval":70, "lan":{ "priority":44, "is-dis":"no" } }, { "level":"L2", "metric":10, "active-neighbors":1, "hello-interval":120, <<<<<<<<<<<<<<<<<< "holddown":{ "count":10, "pad":"yes" }, "cnsp-interval":90, <<<<<<<<<<<<<<<<<< "psnp-interval":70, <<<<<<<<<<<<<<<<<< "lan":{ "priority":44, <<<<<<<<<<<<<<<<<< "is-dis":"no" } } ], ... ``` Fixes: 9fee4d4c6038ef6b14e9f509d6b04d189660c4cd ("isisd: Add json to show isis interface command.") Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit 360a0d6f4ca68fda0eb5d64a8633018a3b5a4a1d)
2025-01-02Merge pull request #16864 from FRRouting/mergify/bp/stable/9.1/pr-16860Donatas Abraitis
ospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV (backport #16860)
2024-12-27FRR Release 9.1.3frr-9.1.3docker/9.1.3rc/9.1.3Donatas Abraitis
- bfdd - Add no variants to interval configurations - bgpd - Actually make ` --v6-with-v4-nexthops` it work - Add `bgp ipv6-auto-ra` command - Allow value 0 in aigp-metric setting - Clear all paths including addpath once GR expires - Compare aigp after local route check in bgp_path_info_cmp() - EVPN fix per rd specific type-2 json output - Fix addressing information of non established outgoing sessions - Fix bgp core with a possible Intf delete - Fix blank line in running-config with bmp listener cmd - Fix crash when polling bgp4v2PathAttrTable - Fix display of local label in show bgp - Fix for match source-protocol in route-map for redistribute cmd - Fix memory leak when creating BMP connection with a source interface - Fix printfrr_bp for non initialized peers - Fix route selection with AIGP - Fix several issues in sourcing AIGP attribute - Fix unconfigure asdot neighbor - Include structure when installing End.DT4/6 SID - Include structure when installing End.DT46 SID - Include structure when removing End.DT4/6 SID - Include structure when removing End.DT46 SID - Move some non BGP-specific route-map functions to lib - Remove useless control checks about TCP connection - Set LLGR stale routes for all the paths including addpath - Treat numbered community-list only if it's in a range 1-500 - Validate both nexthop information (NEXTHOP and NLRI) - isisd - Fix rcap tlv double-free crash - lib - Include SID structure in seg6local nexthop - Take ge/le into consideration when checking the prefix with the prefix-list - Keep `zebra on-rib-process script` in frr.conf - nhrpd - Fixes duplicate auth extension - ospfd - Fix missing '[no]ip ospf graceful-restart hello-delay <N>' commands - pimd - Allow resolving bsr via directly connected secondary address - Fix access-list memory leak in pimd - vrrpd - Iterate over all ancillary messages - zebra - Add missing new line for help string - Add missing proto translations - Correctly report metrics - Fix crash during reconnect - Fix snmp walk of zebra rib - Let's use memset instead of walking bytes and setting to 0 - Separate zebra ZAPI server open and accept - Unlock node only after operation in zebra_free_rnh() Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-20Merge pull request #17681 from FRRouting/mergify/bp/stable/9.1/pr-17675Donatas Abraitis
bgpd: Fix memory leak when creating BMP connection with a source interface (backport #17675)
2024-12-19bgpd: Fix memory leak when creating BMP connection with a source interfaceDonatas Abraitis
Testing done with: ``` for x in $(seq 1 100000); do vtysh -c 'conf' -c 'router bgp' -c 'bmp targets test' -c 'bmp connect localhost port 123 min-retry 100 max-retry 100 source-interface lo'; done ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit 7d19cb59cf5b129f61f3c568899343b3f031f9b4)
2024-12-17Merge pull request #17659 from FRRouting/mergify/bp/stable/9.1/pr-17615Jafar Al-Gharaibeh
lib: Take ge/le into consideration when checking the prefix with the prefix-list (backport #17615)
2024-12-17lib: Take ge/le into consideration when checking the prefix with the prefix-listDonatas Abraitis
Without the fix: ``` show ip prefix-list test_1 10.20.30.96/27 first-match <no result> show ip prefix-list test_2 192.168.1.2/32 first-match <no result> ``` With the fix: ``` ip prefix-list test_1 seq 10 permit 10.20.30.64/26 le 27 ! end donatas# show ip prefix-list test_1 10.20.30.96/27 seq 10 permit 10.20.30.64/26 le 27 (hit count: 1, refcount: 0) donatas# show ip prefix-list test_1 10.20.30.64/27 seq 10 permit 10.20.30.64/26 le 27 (hit count: 2, refcount: 0) donatas# show ip prefix-list test_1 10.20.30.64/28 donatas# show ip prefix-list test_1 10.20.30.126/26 seq 10 permit 10.20.30.64/26 le 27 (hit count: 3, refcount: 0) donatas# show ip prefix-list test_1 10.20.30.126/30 donatas# ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit dd4c2acc2e871283256f6cea16ede6d2d7f72dfe)
2024-12-11Merge pull request #17633 from ↵Donald Sharp
opensourcerouting/fix/backport_9b0b9282d317a9aeab36d9a8b08a35fe9a172c4b_9.1 bgpd: Fix bgp core with a possible Intf delete (backport)
2024-12-11bgpd: Fix bgp core with a possible Intf deleteRajasekar Raja
Although trigger unknown, based on the backtrace in one of the internal testing, we do see some delete in the Intf where we can have the peer ifp pointer null and we try to dereference it while trying to install the route leading to a crash Skip updating the ifindex in such cases and since the nexthop is not properly updated, BGP skips sending it to zebra. BackTrace: 0 0x00007faef05e7ebc in ?? () from /lib/x86_64-linux-gnu/libc.so.6 1 0x00007faef0598fb2 in raise () from /lib/x86_64-linux-gnu/libc.so.6 2 0x00007faef09900dc in core_handler (signo=11, siginfo=0x7ffdde8cb4b0, context=<optimized out>) at lib/sigevent.c:274 3 <signal handler called> 4 0x00005560aad4b7d8 in update_ipv6nh_for_route_install (api_nh=0x7ffdde8cbe94, is_evpn=false, best_pi=0x5560b21187d0, pi=0x5560b21187d0, ifindex=0, nexthop=0x5560b03cb0dc, nh_bgp=0x5560ace04df0, nh_othervrf=0) at bgpd/bgp_zebra.c:1273 5 bgp_zebra_announce_actual (dest=dest@entry=0x5560afcfa950, info=0x5560b21187d0, bgp=0x5560ace04df0) at bgpd/bgp_zebra.c:1521 6 0x00005560aad4bc85 in bgp_handle_route_announcements_to_zebra (e=<optimized out>) at bgpd/bgp_zebra.c:1896 7 0x00007faef09a1c0d in thread_call (thread=thread@entry=0x7ffdde8d7580) at lib/thread.c:2008 8 0x00007faef095a598 in frr_run (master=0x5560ac7e5190) at lib/libfrr.c:1223 9 0x00005560aac65db6 in main (argc=<optimized out>, argv=<optimized out>) at bgpd/bgp_main.c:557 (gdb) f 4 4 0x00005560aad4b7d8 in update_ipv6nh_for_route_install (api_nh=0x7ffdde8cbe94, is_evpn=false, best_pi=0x5560b21187d0, pi=0x5560b21187d0, ifindex=0, nexthop=0x5560b03cb0dc, nh_bgp=0x5560ace04df0, nh_othervrf=0) at bgpd/bgp_zebra.c:1273 1273 in bgpd/bgp_zebra.c (gdb) p pi->peer->ifp $26 = (struct interface *) 0x0 Ticket :#4203904 Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2024-12-05Merge pull request #17597 from ↵Jafar Al-Gharaibeh
opensourcerouting/fix/backport_12a9ca4de6c781b061cccdf3e793346e23558901_9.1 bgpd: fix unconfigure asdot neighbor (backport)
2024-12-05bgpd: fix unconfigure asdot neighborPhilippe Guibert
The below command is not successfull on an existing as dot peer > no neighbor 10.0.0.2 remote-as 1.1 > % Create the peer-group or interface first Handle the case where the remote-as argument can be an ASNUM. Fixes: 8079a4138d61 ("lib, bgp: add initial support for asdot format") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-04Merge pull request #17561 from FRRouting/mergify/bp/stable/9.1/pr-17313Mark Stapp
zebra: separate zebra ZAPI server open and accept (backport #17313)
2024-12-03Merge pull request #17565 from FRRouting/mergify/bp/stable/9.1/pr-17518Jafar Al-Gharaibeh
pimd: Fix access-list memory leak in pimd (backport #17518)
2024-12-03pimd: Fix access-list memory leak in pimdCorey Siltala
Reset access-lists in pimd on terminate Signed-off-by: Corey Siltala <csiltala@atcorp.com> (cherry picked from commit d21a993f16dc23df6a1f1a7c81e9f562446437a0)
2024-12-03zebra: separate zebra ZAPI server open and acceptMark Stapp
Separate zebra's ZAPI server socket handling into two phases: an early phase that opens the socket, and a later phase that starts listening for client connections. Signed-off-by: Mark Stapp <mjs@cisco.com> (cherry picked from commit 506097a1b96974c261411edd25330ceaf90fa3db)
2024-11-19Merge pull request #17449 from ↵Donald Sharp
opensourcerouting/fix/backport_65a43b57efd60c4fdf80c935750046ba861ec79f_9.1 bgpd: Validate both nexthop information (NEXTHOP and NLRI) (backport)
2024-11-17bgpd: Validate both nexthop information (NEXTHOP and NLRI)Donatas Abraitis
If we receive an IPv6 prefix e.g.: 2001:db8:100::/64 with nextop: 0.0.0.0, and mp_nexthop: fc00::2, we should not treat this with an invalid nexthop because of 0.0.0.0. We MUST check for MP_REACH attribute also and decide later if we have at least one a valid nexthop. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit a0d2734e879f78fbef5f1815429de331b9940c73)
2024-11-12Merge pull request #17418 from FRRouting/mergify/bp/stable/9.1/pr-17402Jafar Al-Gharaibeh
bgpd: Fix for match source-protocol in route-map for redistribute cmd (backport) (backport #17402)
2024-11-12bgpd: Fix for match source-protocol in route-map for redistribute cmdRajasekar Raja
A redistribute cmd can have a route-map attached to it and adding the match source-protocol to that route-map means BGP to filter which protocol routes to accept among the bunch of routes zebra is sending. Fixing this since this wasnt implemented earlier. Ticket :#4119692 Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com> (cherry picked from commit 68358c0f928eafe50c9e73b0cb6a443c03f2a33f) Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit f93e5aa1663d9b375e0673f4eed367f9a009fa88)
2024-11-12Merge pull request #17406 from FRRouting/mergify/bp/stable/9.1/pr-15686Russ White
BGP TCP non established : get port and ip (backport #15686)
2024-11-11bgpd: fix addressing information of non established outgoing sessionsPhilippe Guibert
When trying to connect to a BGP peer that does not respons, the 'show bgp neighbors' command does not give any indication on the local and remote addresses used: > # show bgp neighbors > BGP neighbor is 192.0.2.150, remote AS 65500, local AS 65500, internal link > Local Role: undefined > Remote Role: undefined > BGP version 4, remote router ID 0.0.0.0, local router ID 192.0.2.1 > BGP state = Connect > [..] > Connections established 0; dropped 0 > Last reset 00:00:04, Waiting for peer OPEN (n/a) > Internal BGP neighbor may be up to 255 hops away. > BGP Connect Retry Timer in Seconds: 120 > Next connect timer due in 117 seconds > Read thread: off Write thread: off FD used: 27 The addressing information (address and port) are only available when TCP session is established, whereas this information is present at the system level: > root@ubuntu2204:~# netstat -pan | grep 192.0.2.1 > tcp 0 0 192.0.2.1:179 192.0.2.150:38060 SYN_RECV - > tcp 0 1 192.0.2.1:46526 192.0.2.150:179 SYN_SENT 488310/bgpd Add the display for outgoing BGP session, as the information in the getsockname() API provides information for connected streams. When getpeername() API does not give any information, use the peer configuration (destination port is encoded in peer->port). > # show bgp neighbors > BGP neighbor is 192.0.2.150, remote AS 65500, local AS 65500, internal link > Local Role: undefined > Remote Role: undefined > BGP version 4, remote router ID 0.0.0.0, local router ID 192.0.2.1 > BGP state = Connect > [..] > Connections established 0; dropped 0 > Last reset 00:00:16, Waiting for peer OPEN (n/a) > Local host: 192.0.2.1, Local port: 46084 > Foreign host: 192.0.2.150, Foreign port: 179 Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> (cherry picked from commit 78ce63952a99e572ccd7b56fac9a211c2641ca91)
2024-11-11bgpd: remove useless control checks about TCP connectionPhilippe Guibert
When attempting to get the src and destination addresses of a given connection, the API may return the NULL pointer, but further code in bgp_zebra_nexthop_set() already does a check about the given pointer. Relaxing the error code for all the returned adressing. Fixes: 1ff9a340588a ("bgpd: bgpd-fsm-fix.patch") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com> (cherry picked from commit ba7130309954fbe8d58854339ca43259149e603a)
2024-11-08Merge pull request #17394 from opensourcerouting/fix/backport_17376_9.1Donald Sharp
bgpd: Clear stale routes with multiple paths (backport)
2024-11-08bgpd: Set LLGR stale routes for all the paths including addpathDonatas Abraitis
Without this patch we set only the first path for the route (if multiple exist) as LLGR stale and stop doing that for the rest of the paths, which is wrong. Fixes: 1479ed2fb35f4a5ae1017201a7ee37ba2727163a ("bgpd: Implement LLGR helper mode") Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-11-08bgpd: Clear all paths including addpath once GR expiresDonatas Abraitis
We iterated over all bgp_path_info's, but once we remove the path, we didn't check for other paths under the same bgp_dest. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-11-05Merge pull request #17350 from FRRouting/mergify/bp/stable/9.1/pr-17305Donald Sharp
bgpd: Treat numbered community-list only if it's in a range 1-500 (backport #17305)
2024-11-05bgpd: Treat numbered community-list only if it's in a range 1-500Donatas Abraitis
Before this patch, if we set something like: ``` bgp extcommunity-list expanded 1234 permit admin ``` In running config we have: ``` bgp extcommunity-list 1234 seq 5 permit admin ``` That leads to incorrect rendering, even more the line can't be deleted. With this fix we treat numbered community-list only if it's inside the range 1-500, otherwise it's a non-numbered clist. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit 4c1ee29116aff081f63b1fc7dad18cbfe1b8007f)
2024-10-31Merge pull request #17324 from FRRouting/mergify/bp/stable/9.1/pr-17318Jafar Al-Gharaibeh
zebra: Add missing new line for help string (backport #17318)
2024-10-31zebra: Add missing new line for help stringDonatas Abraitis
``` -A, --asic-offload FRR is interacting with an asic underneath the linux kernel --v6-with-v4-nexthops Underlying dataplane supports v6 routes with v4 nexthops -s, --nl-bufsize Set netlink receive buffer size ``` Fixes: 1f5611c06d1c243b42279748788f0627793ead9c ("zebra: Allow zebra cli to accept v6 routes with v4 nexthops") Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org> (cherry picked from commit 25ae643996d338b8230fb15a9064843fe85de224)