]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
2 months agobgpd: fix vty output of evpn route-target AS4 18183/head
Mark Stapp [Tue, 11 Feb 2025 19:35:28 +0000 (14:35 -0500)]
bgpd: fix vty output of evpn route-target AS4

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)

2 months agoMerge pull request #18146 from FRRouting/mergify/bp/dev/10.3/pr-18023
Jafar Al-Gharaibeh [Fri, 14 Feb 2025 01:04:18 +0000 (19:04 -0600)]
Merge pull request #18146 from FRRouting/mergify/bp/dev/10.3/pr-18023

lib: fix false context information for SRv6 route (backport #18023)

2 months agoMerge pull request #18151 from FRRouting/mergify/bp/dev/10.3/pr-18064
Jafar Al-Gharaibeh [Fri, 14 Feb 2025 01:03:50 +0000 (19:03 -0600)]
Merge pull request #18151 from FRRouting/mergify/bp/dev/10.3/pr-18064

staticd: Fix SRv6 SID installation and deletion (backport #18064)

2 months agoMerge pull request #18154 from FRRouting/mergify/bp/dev/10.3/pr-18121
Donald Sharp [Thu, 13 Feb 2025 22:44:20 +0000 (17:44 -0500)]
Merge pull request #18154 from FRRouting/mergify/bp/dev/10.3/pr-18121

bgpd: release manual vpn label on instance deletion (backport #18121)

2 months agobgpd: release manual vpn label on instance deletion 18154/head
Louis Scalbert [Wed, 12 Feb 2025 12:49:50 +0000 (13:49 +0100)]
bgpd: release manual vpn label on instance deletion

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)

2 months agotests: Extend SRv6 static SIDs topotest to verify SID structure 18151/head
Carmine Scarpitta [Sat, 8 Feb 2025 21:26:13 +0000 (22:26 +0100)]
tests: Extend SRv6 static SIDs topotest to verify SID structure

The `static_srv6_sids` topotest verifies that staticd correctly
programs the SIDs in the zebra RIB. Currently, the topotest only
validates the programmed behavior and SID attributes.

This commit extends the topotest to also validate the SID structure.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit a6d02fe2fb38b8e0c2e1c25fd863f6f96c2c40a6)

2 months agolib: Add sidStructure in SRv6 SIDs JSON output
Carmine Scarpitta [Sat, 8 Feb 2025 21:17:09 +0000 (22:17 +0100)]
lib: Add sidStructure in SRv6 SIDs JSON output

The `show ipv6 route json` command displays the IPv6 routing table in
JSON format, including SRv6 SIDs. For each SRv6 SID, it provides
behavior and SID attributes. However, it does not include the SID
structure.

This commit adds the SID structure to the SRv6 SID JSON output.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 312f7b3f8c7382afef6993aa2110326db2327c35)

2 months agostaticd: Fix SRv6 SID installation and deletion
Carmine Scarpitta [Fri, 7 Feb 2025 16:47:45 +0000 (17:47 +0100)]
staticd: Fix SRv6 SID installation and deletion

The SRv6 support in staticd (PR #16894) does not set the correct SID
parameters (block length, node length, function length).

This commit fixes the issue and computes the correct parameters.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit e1654ba5548625981d2b9ff580b2fb6e2ae9d5dc)

2 months agolib: fix false context information for SRv6 route 18146/head
Philippe Guibert [Wed, 5 Feb 2025 08:52:59 +0000 (09:52 +0100)]
lib: fix false context information for SRv6 route

The seg6local route dumped by 'show ipv6 route' makes think that the USP
flavor is supported, whereas it is not the case. This information is a
context information, and for End, the context information should be
empty.

> # show ipv6 route
> [..]
> I>* fc00:0:4::/128 [115/0] is directly connected, sr0, seg6local End USP, weight 1, 00:49:01

Fix this by suppressing the USP information from the output.

Fixes: e496b4203055 ("bgpd: prefix-sid srv6 l3vpn service tlv")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 658bf0281d99461849453628ddc792ec424d0bd4)

2 months agoMerge pull request #18129 from FRRouting/mergify/bp/dev/10.3/pr-18026
Donald Sharp [Thu, 13 Feb 2025 16:19:28 +0000 (11:19 -0500)]
Merge pull request #18129 from FRRouting/mergify/bp/dev/10.3/pr-18026

Bfd fixups (backport #18026)

2 months agoMerge pull request #18132 from opensourcerouting/fix/backport_82d28f137aed2e60380807a...
Jafar Al-Gharaibeh [Thu, 13 Feb 2025 04:26:21 +0000 (22:26 -0600)]
Merge pull request #18132 from opensourcerouting/fix/backport_82d28f137aed2e60380807a302e2b312408eff6e_10.3

Cid 1636504 (backport)

2 months agoMerge pull request #18133 from FRRouting/mergify/bp/dev/10.3/pr-18120
Jafar Al-Gharaibeh [Thu, 13 Feb 2025 04:25:55 +0000 (22:25 -0600)]
Merge pull request #18133 from FRRouting/mergify/bp/dev/10.3/pr-18120

bgpd: fix incorrect JSON in bgp_show_table_rd (backport #18120)

2 months agobgpd: fix incorrect json in bgp_show_table_rd 18133/head
Louis Scalbert [Wed, 12 Feb 2025 11:50:42 +0000 (12:50 +0100)]
bgpd: fix incorrect json in bgp_show_table_rd

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)

2 months agobgpd: fix bgp label evpn CID 1636504 18132/head
Philippe Guibert [Fri, 7 Feb 2025 14:49:10 +0000 (15:49 +0100)]
bgpd: fix bgp label evpn CID 1636504

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>
2 months agobgpd: simplify bgp_evpn_process_rt1 with label
Philippe Guibert [Fri, 7 Feb 2025 14:40:29 +0000 (15:40 +0100)]
bgpd: simplify bgp_evpn_process_rt1 with label

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>
2 months agobfdd: Use pass by reference for bfd_key_delete 18129/head
Donald Sharp [Wed, 5 Feb 2025 13:47:31 +0000 (08:47 -0500)]
bfdd: Use pass by reference for bfd_key_delete

Coverity is pointing out that bfd_key_delete is
passing by value instead of reference for a very
large structure.  Double plus not good.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 8119e167b0ae95927618696ba11d7252d9d5637c)

2 months agobfdd: Use pass by reference instead of pass by value for a struct
Donald Sharp [Wed, 5 Feb 2025 13:42:00 +0000 (08:42 -0500)]
bfdd: Use pass by reference instead of pass by value for a struct

The function bfd_key_lookup is currently sending by value for
a now very large structure.  Let's convert this over to pass
by reference.  This is noticed by coverity.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 6d80d0c595fd073c56f4fc5b3cd5568ef8a9d5ae)

2 months agoMerge pull request #18056 from FRRouting/mergify/bp/dev/10.3/pr-18048
Donald Sharp [Wed, 12 Feb 2025 17:39:27 +0000 (12:39 -0500)]
Merge pull request #18056 from FRRouting/mergify/bp/dev/10.3/pr-18048

pimd: fix DR election race on startup (backport #18048)

2 months agoMerge pull request #18083 from FRRouting/mergify/bp/dev/10.3/pr-17901
Donald Sharp [Wed, 12 Feb 2025 14:30:11 +0000 (09:30 -0500)]
Merge pull request #18083 from FRRouting/mergify/bp/dev/10.3/pr-17901

lib: actually hash all 16 bytes of IPv6 addresses, not just 4 (backport #17901)

2 months agoMerge pull request #18101 from FRRouting/mergify/bp/dev/10.3/pr-18060
Donald Sharp [Wed, 12 Feb 2025 13:18:58 +0000 (08:18 -0500)]
Merge pull request #18101 from FRRouting/mergify/bp/dev/10.3/pr-18060

lib: crash handlers must be allowed on threads (backport #18060)

2 months agoMerge pull request #18112 from FRRouting/mergify/bp/dev/10.3/pr-18078
Donald Sharp [Wed, 12 Feb 2025 13:17:12 +0000 (08:17 -0500)]
Merge pull request #18112 from FRRouting/mergify/bp/dev/10.3/pr-18078

nhrpd: fix dont consider incomplete L2 entry (backport #18078)

2 months agoMerge pull request #18115 from FRRouting/mergify/bp/dev/10.3/pr-18069
Donald Sharp [Wed, 12 Feb 2025 13:15:05 +0000 (08:15 -0500)]
Merge pull request #18115 from FRRouting/mergify/bp/dev/10.3/pr-18069

bgpd: Request SRv6 locator after zebra connection (backport #18069)

2 months agobgpd: Request SRv6 locator after zebra connection 18115/head
Carmine Scarpitta [Sat, 8 Feb 2025 23:44:01 +0000 (00:44 +0100)]
bgpd: Request SRv6 locator after zebra connection

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)

2 months agonhrpd: fix dont consider incomplete L2 entry 18112/head
Philippe Guibert [Mon, 10 Feb 2025 15:15:44 +0000 (16:15 +0100)]
nhrpd: fix dont consider incomplete L2 entry

Sometimes, NHRP receives L2 information on a cache entry with the
0.0.0.0 IP address. NHRP considers it as valid and updates the binding
with the new IP address.

> Feb 09 20:09:54 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: new-neigh 10.2.114.238 dev dmvpn1 lladdr 162.251.180.10 nud 0x2 cache used 0 type 4
> Feb 09 20:10:35 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: new-neigh 10.2.114.238 dev dmvpn1 lladdr 162.251.180.10 nud 0x4 cache used 1 type 4
> Feb 09 20:10:48 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: del-neigh 10.2.114.238 dev dmvpn1 lladdr 162.251.180.10 nud 0x4 cache used 1 type 4
> Feb 09 20:10:49 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: who-has 10.2.114.238 dev dmvpn1 lladdr (unspec) nud 0x1 cache used 1 type 4
> Feb 09 20:10:49 aws-sin-vpn01 nhrpd[2695]: [QVXNM-NVHEQ] Netlink: update binding for 10.2.114.238 dev dmvpn1 from c 162.251.180.10 peer.vc.nbma 162.251.180.10 to lladdr (unspec)
> Feb 09 20:10:49 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: new-neigh 10.2.114.238 dev dmvpn1 lladdr 0.0.0.0 nud 0x2 cache used 1 type 4
> Feb 09 20:11:30 aws-sin-vpn01 nhrpd[2695]: [QQ0NK-1H449] Netlink: new-neigh 10.2.114.238 dev dmvpn1 lladdr 0.0.0.0 nud 0x4 cache used 1 type 4

Actually, the 0.0.0.0 IP addressed mentiones in the 'who-has' message is
wrong because the nud state value means that value is incomplete and
should not be handled as a valid entry. Instead of considering it, fix
this by by invalidating the current binding. This step is necessary in
order to permit NHRP to trigger resolution requests again.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 3202323052485d8138a3440e9c9907594ad99c57)

2 months agoMerge pull request #18099 from FRRouting/mergify/bp/dev/10.3/pr-18081
Russ White [Tue, 11 Feb 2025 17:28:57 +0000 (12:28 -0500)]
Merge pull request #18099 from FRRouting/mergify/bp/dev/10.3/pr-18081

bgpd: fix bgp vrf instance creation from implicit (backport #18081)

2 months agolib: crash handlers must be allowed on threads 18101/head
David Lamparter [Fri, 7 Feb 2025 12:22:25 +0000 (13:22 +0100)]
lib: crash handlers must be allowed on threads

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)

2 months agobgpd: fix bgp vrf instance creation from implicit 18099/head
Chirag Shah [Tue, 11 Feb 2025 02:56:15 +0000 (18:56 -0800)]
bgpd: fix bgp vrf instance creation from implicit

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)

2 months agolib: clean up nexthop hashing mess 18083/head
David Lamparter [Wed, 22 Jan 2025 10:23:31 +0000 (11:23 +0100)]
lib: clean up nexthop hashing mess

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)

2 months agolib: guard against padding garbage in ZAPI read
David Lamparter [Wed, 22 Jan 2025 10:19:04 +0000 (11:19 +0100)]
lib: guard against padding garbage in ZAPI read

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)

2 months agozebra: guard against junk in nexthop->rmap_src
David Lamparter [Wed, 22 Jan 2025 10:17:21 +0000 (11:17 +0100)]
zebra: guard against junk in nexthop->rmap_src

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)

2 months agopbrd: initialize structs used in hash_lookup
David Lamparter [Wed, 22 Jan 2025 10:16:10 +0000 (11:16 +0100)]
pbrd: initialize structs used in hash_lookup

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)

2 months agofpm: guard against garbage in unused address bytes
David Lamparter [Wed, 22 Jan 2025 10:15:17 +0000 (11:15 +0100)]
fpm: guard against garbage in unused address bytes

Zero out the 12 unused bytes (for the IPv6 address) when reading in an
IPv4 address.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 95cf0b227980999e2af22a2c171e5237e5ffca8e)

2 months agobgpd: don't reuse nexthop variable in loop/switch
David Lamparter [Wed, 22 Jan 2025 10:13:21 +0000 (11:13 +0100)]
bgpd: don't reuse nexthop variable in loop/switch

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)

2 months agoMerge pull request #18053 from FRRouting/mergify/bp/dev/10.3/pr-14105 mergify/bp/dev/10.3/pr-17935
Donatas Abraitis [Fri, 7 Feb 2025 14:10:46 +0000 (16:10 +0200)]
Merge pull request #18053 from FRRouting/mergify/bp/dev/10.3/pr-14105

pimd: Fix for FHR mroute taking longer to age out (backport #14105)

2 months agopimd: fix DR election race on startup 18056/head
Rafael Zalamena [Thu, 6 Feb 2025 22:28:50 +0000 (19:28 -0300)]
pimd: fix DR election race on startup

In case interface address is learnt during configuration, make sure to
run DR election when configuring PIM/PIM passive on interface.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 86445246062583197d4a6dff7b8c74003cd8049d)

2 months agopimd: Fix for FHR mroute taking longer to age out 18053/head
Rajesh Varatharaj [Thu, 27 Jul 2023 06:57:04 +0000 (23:57 -0700)]
pimd: Fix for FHR mroute taking longer to age out

Issue:
When there is no traffic for a group, the LHR and RP take the default KAT+Join timer expiry of
a maximum of 480 seconds to clear the S,G . However, in the FHR, we update the state from JOINED
to NOT Joined, downstream state from PPto NOINFO.  This restarts the ET timer, causing S,G on FHR to
take more than 10 minutes to age out.

In other words,
Consider a case where (S,G) is in Join state. When the traffic stops and the KAT (210) expires,
 the Join expiry timer restarts. At this time, if we receive a prune, the expectation is to set
 PPT to 0 (RFC 4601 sec 4.5.2).
 When the PPT expires, we move to the noinfo state and restart the expiry timer one more time. We remove the
 (S,G) entry only after ~10 minutes when there is no active traffic.

Summary:
KAT Join ET 210 + PP ET 210 + NOINFO ET 210.

Solution:
Delete the ifchannel when in noinfo state, and KAT is not running.

Ticket: #13703

Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
(cherry picked from commit afed39ea2be25bf30d50ac49b4edf424deadcb17)

2 months agoMerge pull request #18042 from FRRouting/mergify/bp/dev/10.3/pr-17865
Jafar Al-Gharaibeh [Thu, 6 Feb 2025 23:20:22 +0000 (17:20 -0600)]
Merge pull request #18042 from FRRouting/mergify/bp/dev/10.3/pr-17865

Coverity 2024 new hotness (backport #17865)

2 months agoMerge pull request #18043 from FRRouting/mergify/bp/dev/10.3/pr-18038
Jafar Al-Gharaibeh [Thu, 6 Feb 2025 23:20:03 +0000 (17:20 -0600)]
Merge pull request #18043 from FRRouting/mergify/bp/dev/10.3/pr-18038

pimd: fix memory leak and assign allocation type (backport #18038)

2 months agopimd: fix memory leak and assign allocation type 18043/head
Rafael Zalamena [Thu, 6 Feb 2025 13:14:55 +0000 (10:14 -0300)]
pimd: fix memory leak and assign allocation type

Use a memory allocation specific type for filter names (to help detect memory
leaks) and fix a memory leak when releasing peer memory.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit d1440dadffe90dc743c5b83126b021d7a4a08766)

2 months agozebra: Ensure that changes to dg_update_list are protected by mutex 18042/head
Donald Sharp [Thu, 16 Jan 2025 16:17:11 +0000 (11:17 -0500)]
zebra: Ensure that changes to dg_update_list are protected by mutex

The dg_update_list access is controlled by the dg_mutex in all
other locations.  Let's just add a mutex usage around the initialization
of the dg_update_list even if it's part of the startup, just to keep
things consistent.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 19af3f3d7af0f8904794dae3c36f60ed1d5a3cc8)

2 months agobgpd: Ensure ibuf count is protected by mutex
Donald Sharp [Wed, 15 Jan 2025 18:26:58 +0000 (13:26 -0500)]
bgpd: Ensure ibuf count is protected by mutex

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)

2 months agozebra: Add some documentation on when zserv_open should be used
Donald Sharp [Wed, 15 Jan 2025 18:03:52 +0000 (13:03 -0500)]
zebra: Add some documentation on when zserv_open should be used

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 4b967527376db4f08c50f9c32cc77556700d0eec)

2 months agoospfd: Fix Coverity SA #1617470, 76 and 78
Donald Sharp [Wed, 15 Jan 2025 16:16:10 +0000 (11:16 -0500)]
ospfd: Fix Coverity SA #1617470, 76 and 78

msg_new takes a uint16_t, the length passed
down variable is a unsigned int, thus 32 bit.
It's possible, but highly unlikely, that the
msglen could be greater than 16 bit.
Let's just add some checks to ensure that
this could not happen.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 283cc511781f9e076baf8564dae234de52cb290a)

2 months agoMerge pull request #18019 from FRRouting/mergify/bp/dev/10.3/pr-18000
Donald Sharp [Wed, 5 Feb 2025 13:17:07 +0000 (08:17 -0500)]
Merge pull request #18019 from FRRouting/mergify/bp/dev/10.3/pr-18000

bgpd: Fix up memory leak in processing eoiu marker (backport #18000)

2 months agobgpd: Fix up memory leak in processing eoiu marker 18019/head
Donald Sharp [Tue, 4 Feb 2025 15:56:59 +0000 (10:56 -0500)]
bgpd: Fix up memory leak in processing eoiu marker

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)

2 months agoMerge pull request #18006 from FRRouting/mergify/bp/dev/10.3/pr-17959
Russ White [Tue, 4 Feb 2025 16:46:15 +0000 (11:46 -0500)]
Merge pull request #18006 from FRRouting/mergify/bp/dev/10.3/pr-17959

bgpd: Do not start BGP session if BGP identifier is not set (backport #17959)

2 months agotests: Check if the peer stays Idle if router-id is not set 18006/head
Donatas Abraitis [Wed, 29 Jan 2025 21:11:35 +0000 (23:11 +0200)]
tests: Check if the peer stays Idle if router-id is not set

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 48560b5c9b8084e903ebf0ef5987b4e581459608)

2 months agobgpd: Do not start BGP session if BGP identifier is not set
Donatas Abraitis [Wed, 29 Jan 2025 21:03:06 +0000 (23:03 +0200)]
bgpd: Do not start BGP session if BGP identifier is not set

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)

2 months agodoc: Say that 0.0.0.0 (0) BGP identifier is invalid
Donatas Abraitis [Wed, 29 Jan 2025 20:24:39 +0000 (22:24 +0200)]
doc: Say that 0.0.0.0 (0) BGP identifier is invalid

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit c9a29289548028163a8d1edd55dbf03f27d53484)

2 months agoMerge pull request #17969 from donaldsharp/fpm_lost_sends base_10.3
Mark Stapp [Tue, 4 Feb 2025 16:18:07 +0000 (11:18 -0500)]
Merge pull request #17969 from donaldsharp/fpm_lost_sends

zebra: Ensure dplane does not send work back to master at wrong time

2 months agoMerge pull request #17992 from chiragshah6/fdev5
Russ White [Tue, 4 Feb 2025 12:40:36 +0000 (07:40 -0500)]
Merge pull request #17992 from chiragshah6/fdev5

bgpd: fix route-distinguisher in vrf leak json cmd

2 months agoMerge pull request #17991 from chiragshah6/bgp_dev4
Donatas Abraitis [Tue, 4 Feb 2025 12:34:21 +0000 (14:34 +0200)]
Merge pull request #17991 from chiragshah6/bgp_dev4

zebra: fix evpn svd hash avoid double free

2 months agoMerge pull request #17943 from opensourcerouting/clear-event-cpu-uaf
Russ White [Tue, 4 Feb 2025 11:57:52 +0000 (06:57 -0500)]
Merge pull request #17943 from opensourcerouting/clear-event-cpu-uaf

lib: fix use after free in `clear event cpu`

2 months agoMerge pull request #17336 from forrestchu/sbfd
Russ White [Tue, 4 Feb 2025 11:36:43 +0000 (06:36 -0500)]
Merge pull request #17336 from forrestchu/sbfd

implement SBFD

2 months agoMerge pull request #17990 from enkechen-panw/aigp-cfg-default
Donatas Abraitis [Tue, 4 Feb 2025 08:51:52 +0000 (10:51 +0200)]
Merge pull request #17990 from enkechen-panw/aigp-cfg-default

bgpd: add config default for "bgp bestpath aigp"

2 months agoMerge pull request #17989 from cscarpitta/fix/fix_staticd_no_sid
Donatas Abraitis [Tue, 4 Feb 2025 08:47:20 +0000 (10:47 +0200)]
Merge pull request #17989 from cscarpitta/fix/fix_staticd_no_sid

staticd: Fix wrong xpath in `no sid X:X::X:X/M`

2 months agobgpd: fix route-distinguisher in vrf leak json cmd 17992/head
Chirag Shah [Mon, 3 Feb 2025 20:00:41 +0000 (12:00 -0800)]
bgpd: fix route-distinguisher in vrf leak json cmd

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>
2 months agozebra: evpn svd hash avoid double free 17991/head
Chirag Shah [Fri, 31 Jan 2025 01:26:46 +0000 (17:26 -0800)]
zebra: evpn svd hash avoid double free

Upon zebra shutdown hash_clean_and_free is called
where user free function is passed,
The free function should not call hash_release
which lead to double free of hash bucket.

Fix:
The fix is to avoid calling hash_release from
free function if its called from hash_clean_and_free
path.

10 0x00007f0422b7df1f in free () from /lib/x86_64-linux-gnu/libc.so.6
11 0x00007f0422edd779 in qfree (mt=0x7f0423047ca0 <MTYPE_HASH_BUCKET>,
    ptr=0x55fc8bc81980) at ../lib/memory.c:130
12 0x00007f0422eb97e2 in hash_clean (hash=0x55fc8b979a60,
    free_func=0x55fc8a529478 <svd_nh_del_terminate>) at
    ../lib/hash.c:290
13 0x00007f0422eb98a1 in hash_clean_and_free (hash=0x55fc8a675920
    <svd_nh_table>, free_func=0x55fc8a529478 <svd_nh_del_terminate>) at
    ../lib/hash.c:305
14 0x000055fc8a5323a5 in zebra_vxlan_terminate () at
    ../zebra/zebra_vxlan.c:6099
15 0x000055fc8a4c9227 in zebra_router_terminate () at
    ../zebra/zebra_router.c:276
16 0x000055fc8a4413b3 in zebra_finalize (dummy=0x7fffb881c1d0) at
    ../zebra/main.c:269
17 0x00007f0422f44387 in event_call (thread=0x7fffb881c1d0) at
    ../lib/event.c:2011
18 0x00007f0422ecb6fa in frr_run (master=0x55fc8b733cb0) at
    ../lib/libfrr.c:1243
19 0x000055fc8a441987 in main (argc=14, argv=0x7fffb881c4a8) at
    ../zebra/main.c:584

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2 months agotests: Add test case to verify SID re-add 17989/head
Carmine Scarpitta [Mon, 3 Feb 2025 11:56:51 +0000 (12:56 +0100)]
tests: Add test case to verify SID re-add

Add a new test case that re-add the deleted SIDs and verifies that all
SIDs are added back to the RIB.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agotests: Add test case to verify SID delete
Carmine Scarpitta [Mon, 3 Feb 2025 11:56:41 +0000 (12:56 +0100)]
tests: Add test case to verify SID delete

Add a new test case that deletes a SID and verifies that only this
SID has been removed from the RIB.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agostaticd: Fix wrong xpath in `no sid X:X::X:X/M`
Carmine Scarpitta [Mon, 3 Feb 2025 11:56:02 +0000 (12:56 +0100)]
staticd: Fix wrong xpath in `no sid X:X::X:X/M`

When a user wants to delete a specific SRv6 SID, he executes the
`no sid X:X::X:X/M` command.
However, by mistake, in addition to deleting the SID requested by the
user, this command also removes all other SIDs.

This happens because `no sid X:X::X:X/M` triggers a destroy operation
on the wrong xpath `frr-staticd:staticd/segment-routing/srv6`.

This commit fixes the issue by replacing the wrong xpath
`frr-staticd:staticd/segment-routing/srv6` with the correct xpath
`frr-staticd:staticd/segment-routing/srv6/static-sids/sid[sid='%s']`.

This ensures that the `no sid X:X::X:X/M` command only deletes the SID
that was requested by the user.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agoMerge pull request #17970 from mjstapp/fix_privs_no_caps
Donald Sharp [Mon, 3 Feb 2025 17:57:44 +0000 (12:57 -0500)]
Merge pull request #17970 from mjstapp/fix_privs_no_caps

libs: return from change_caps if no caps

2 months agoMerge pull request #17913 from Sokolmish/bgp-sid-release
Carmine Scarpitta [Mon, 3 Feb 2025 13:52:00 +0000 (14:52 +0100)]
Merge pull request #17913 from Sokolmish/bgp-sid-release

bgpd: Release SID on router deletion

2 months agobgpd: add config default for "bgp bestpath aigp" 17990/head
Enke Chen [Mon, 3 Feb 2025 04:35:44 +0000 (20:35 -0800)]
bgpd: add config default for "bgp bestpath aigp"

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>
2 months agoMerge pull request #17979 from cscarpitta/fix/fix_staticd_sid_notify
Donatas Abraitis [Sun, 2 Feb 2025 19:17:33 +0000 (21:17 +0200)]
Merge pull request #17979 from cscarpitta/fix/fix_staticd_sid_notify

staticd: Fix NULL pointer dereference when receiving `ZAPI_SRV6_SID_RELEASED` notification

2 months agoMerge pull request #17947 from opensourcerouting/fix/bgp_disable_vrf
Russ White [Sun, 2 Feb 2025 17:41:12 +0000 (12:41 -0500)]
Merge pull request #17947 from opensourcerouting/fix/bgp_disable_vrf

bgpd: Do not ignore auto generated VRF instances when deleting

2 months agoMerge pull request #17964 from cscarpitta/fix/fix-srv6-sid-manager
Donatas Abraitis [Sun, 2 Feb 2025 11:32:36 +0000 (13:32 +0200)]
Merge pull request #17964 from cscarpitta/fix/fix-srv6-sid-manager

Fix SRv6 SID Manager

2 months agostaticd: Fix NULL pointer dereference 17979/head
Carmine Scarpitta [Sun, 2 Feb 2025 09:06:22 +0000 (10:06 +0100)]
staticd: Fix NULL pointer dereference

When staticd receives a `ZAPI_SRV6_SID_RELEASED` notification from SRv6
SID Manager, it tries to unset the validity flag of `sid`. But since
the `sid` variable is NULL, we get a NULL pointer dereference.

```
=================================================================
==13815==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000060 (pc 0xc14b813d9eac bp 0xffffcb135a40 sp 0xffffcb135a40 T0)
==13815==The signal is caused by a READ memory access.
==13815==Hint: address points to the zero page.
    #0 0xc14b813d9eac in static_zebra_srv6_sid_notify staticd/static_zebra.c:1172
    #1 0xe44e7aa2c194 in zclient_read lib/zclient.c:4746
    #2 0xe44e7a9b69d8 in event_call lib/event.c:1984
    #3 0xe44e7a85ac28 in frr_run lib/libfrr.c:1246
    #4 0xc14b813ccf98 in main staticd/static_main.c:193
    #5 0xe44e7a4773f8 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #6 0xe44e7a4774c8 in __libc_start_main_impl ../csu/libc-start.c:392
    #7 0xc14b813cc92c in _start (/usr/lib/frr/staticd+0x1c92c)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV staticd/static_zebra.c:1172 in static_zebra_srv6_sid_notify
==13815==ABORTING
```

This commit fixes the problem by doing a SID lookup first. If the SID
can't be found, we log an error and return. If the SID is found, we go
ahead and unset the validity flag.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agoMerge pull request #17972 from enkechen-panw/rr-policy
Donatas Abraitis [Sun, 2 Feb 2025 07:53:16 +0000 (09:53 +0200)]
Merge pull request #17972 from enkechen-panw/rr-policy

bgpd: add config default for "route-reflector allow-outbound-policy"

2 months agobgpd: add config default for "route-reflector allow-outbound-policy" 17972/head
Enke Chen [Sat, 1 Feb 2025 18:24:19 +0000 (10:24 -0800)]
bgpd: add config default for "route-reflector allow-outbound-policy"

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>
2 months agoMerge pull request #17971 from donaldsharp/suppress_fib_giving_us_the_business
Donatas Abraitis [Sat, 1 Feb 2025 11:25:37 +0000 (13:25 +0200)]
Merge pull request #17971 from donaldsharp/suppress_fib_giving_us_the_business

bgpd: With suppress-fib-pending ensure withdrawal is sent

2 months agobgpd: With suppress-fib-pending ensure withdrawal is sent 17971/head
Donald Sharp [Fri, 31 Jan 2025 23:53:30 +0000 (18:53 -0500)]
bgpd: With suppress-fib-pending ensure withdrawal is sent

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>
2 months agolibs: return from change_caps if no caps 17970/head
Mark Stapp [Fri, 31 Jan 2025 18:13:48 +0000 (13:13 -0500)]
libs: return from change_caps if no caps

When called without caps/privs, just return from "change_caps"
instead of exiting - it's possible that a process may not need
privs, but a lib (for example) may use the api.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 months agozebra: Ensure dplane does not send work back to master at wrong time 17969/head
Donald Sharp [Fri, 31 Jan 2025 17:38:20 +0000 (12:38 -0500)]
zebra: Ensure dplane does not send work back to master at wrong time

When looping through the dplane providers, the worklist was
being populated with items from the last provider and then
the event system was checked to see if we should stop processing.
If the event system says `yes` then the dplane code would stop
and send the worklist to the master zebra pthread for collection.
This obviously skipped the next dplane provider on the list
which is double plus not good.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoMerge pull request #17956 from pguibert6WIND/isis_srv6_codepoint_erroneous
Donatas Abraitis [Fri, 31 Jan 2025 11:56:09 +0000 (13:56 +0200)]
Merge pull request #17956 from pguibert6WIND/isis_srv6_codepoint_erroneous

isisd: fix erroneous srv6 information in database

2 months agotests: Add testcase for static End/uN validation 17964/head
Carmine Scarpitta [Thu, 30 Jan 2025 18:26:57 +0000 (19:26 +0100)]
tests: Add testcase for static End/uN validation

This commit adds a testcase to validate static End/uN allocation.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agozebra: Fix SRv6 SID Manager
Carmine Scarpitta [Thu, 30 Jan 2025 18:25:57 +0000 (19:25 +0100)]
zebra: Fix SRv6 SID Manager

The SRv6 SID Manager does not allow allocating an SRv6 End/uN function
even though it is already supported by staticd.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agoMerge pull request #17934 from nabahr/autorp-close
Donatas Abraitis [Thu, 30 Jan 2025 14:19:40 +0000 (16:19 +0200)]
Merge pull request #17934 from nabahr/autorp-close

pimd: Close AutoRP socket when not needed

2 months agotopotests: Router deletion in SRv6 sid reachability 17913/head
Mikhail Sokolovskiy [Wed, 29 Jan 2025 22:54:47 +0000 (01:54 +0300)]
topotests: Router deletion in SRv6 sid reachability

Signed-off-by: Mikhail Sokolovskiy <sokolmish@gmail.com>
2 months agobgpd: Release SID on router deletion
Mikhail Sokolovskiy [Wed, 29 Jan 2025 22:54:31 +0000 (01:54 +0300)]
bgpd: Release SID on router deletion

Signed-off-by: Mikhail Sokolovskiy <sokolmish@gmail.com>
2 months agoMerge pull request #17935 from mjstapp/fix_nhg_hash_equal
Donald Sharp [Wed, 29 Jan 2025 15:14:37 +0000 (10:14 -0500)]
Merge pull request #17935 from mjstapp/fix_nhg_hash_equal

zebra: include resolving nexthops in nhg hash

2 months agoMerge pull request #17946 from bobuhiro11/normalize_ebgp_multihop
Donatas Abraitis [Wed, 29 Jan 2025 12:05:12 +0000 (14:05 +0200)]
Merge pull request #17946 from bobuhiro11/normalize_ebgp_multihop

tools: Fix frr-reload for ebgp-multihop TTL reconfiguration.

2 months agoisisd: fix erroneous srv6 information in database 17956/head
Philippe Guibert [Wed, 29 Jan 2025 11:19:24 +0000 (12:19 +0100)]
isisd: fix erroneous srv6 information in database

The show isis database detail command dumps invalid srv6 information:
>  SRv6 Locator: fc00:0:6::/64 (Metric: 0) ipv6-unicast
>    Sub-TLVs:
>      SRv6 End SID Endpoint Behavior: unknown, SID value: fc00:0:6:0:1::
>
>  MT Reachability: 0123.6452.1973.03 (Metric: 10) ipv6-unicast
>    Local Interface IPv6 Address(es): 192::4:3
>    SRv6 Lan End.X SID: fc00:0:3:0:43::, Algorithm: SPF, Weight: 0, Endpoint Behavior: End.DX6, Flags: B:0, S:0, P:0 Neighbor-ID: 0123.6452.1975
>        SRv6 SID Structure Locator Block length: 40, Locator Node length: 24, Function length: 16, Argument length: 0,

The behavior codepoint should use the IANA definitions to display the
correct value. Fix this by calling the appropriate convert function.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 months agotools: Fix frr-reload for ebgp-multihop TTL reconfiguration. 17946/head
Nobuhiro MIKI [Wed, 29 Jan 2025 04:31:53 +0000 (04:31 +0000)]
tools: Fix frr-reload for ebgp-multihop TTL reconfiguration.

In ebgp-multihop, there is a difference in reload behavior when TTL is
unspecified (meaning default 255) and when 255 is explicitly specified.
For example, when reloading with 'neighbor <neighbor> ebgp-multihop
255' in the config, the following difference is created. This commit
fixes that.

    Lines To Delete
    ===============
    router bgp 65001
     no neighbor 10.0.0.4 ebgp-multihop
    exit

    Lines To Add
    ============
    router bgp 65001
     neighbor 10.0.0.4 ebgp-multihop 255
    exit

The commit 767aaa3a8048 is not sufficient and frr-reload needs to be
fixed to handle both unspecified and specified cases.

Signed-off-by: Nobuhiro MIKI <nob@bobuhiro11.net>
2 months agotests: Add a test that shows the v6 recursive nexthop problem 17935/head
Donald Sharp [Mon, 27 Jan 2025 15:34:31 +0000 (10:34 -0500)]
tests: Add a test that shows the v6 recursive nexthop problem

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>
2 months agoMerge pull request #17941 from opensourcerouting/fix-dst-src
Russ White [Tue, 28 Jan 2025 17:23:06 +0000 (12:23 -0500)]
Merge pull request #17941 from opensourcerouting/fix-dst-src

static: fix botched staticd YANG conversion for dst-src

2 months agoMerge pull request #17802 from askorichenko/test-fix-table-map
Russ White [Tue, 28 Jan 2025 17:20:43 +0000 (12:20 -0500)]
Merge pull request #17802 from askorichenko/test-fix-table-map

bgpd: fix table-map option

2 months agoMerge pull request #17906 from LabNConsulting/aceelindem/ospf-prune-dup-next-hops
Russ White [Tue, 28 Jan 2025 17:19:07 +0000 (12:19 -0500)]
Merge pull request #17906 from LabNConsulting/aceelindem/ospf-prune-dup-next-hops

ospfd: Prune duplicate next-hop when installing into zebra route table.

2 months agoMerge pull request #17848 from pguibert6WIND/isis_srv6_topo1_ping
Russ White [Tue, 28 Jan 2025 16:49:20 +0000 (11:49 -0500)]
Merge pull request #17848 from pguibert6WIND/isis_srv6_topo1_ping

Isis srv6 topo1 ping

2 months agoMerge pull request #17924 from donaldsharp/evaluate_paths_optimization
Russ White [Tue, 28 Jan 2025 16:29:15 +0000 (11:29 -0500)]
Merge pull request #17924 from donaldsharp/evaluate_paths_optimization

bgpd: Optimize evaluate paths for a peer going down

2 months agoMerge pull request #17881 from opensourcerouting/fix/last_reset_reason
Russ White [Tue, 28 Jan 2025 15:40:50 +0000 (10:40 -0500)]
Merge pull request #17881 from opensourcerouting/fix/last_reset_reason

bgpd: last reset SNAFU

2 months agolib: fix use after free in `clear event cpu` 17943/head
David Lamparter [Tue, 28 Jan 2025 15:37:52 +0000 (16:37 +0100)]
lib: fix use after free in `clear event cpu`

Freeing any item here means freeing someone's `event->hist`, leaving a
dangling pointer there.  Which will immediately be written to because
we're executing in a CLI function under the `vty_read` event, whose
`event->hist` is then updated.

Deallocating `event->hist` anywhere other than shutting down the whole
event loop is a bad idea to begin with, just zero out the stats instead.

Fixes: FRRouting/frr#16419
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agoMerge pull request #17863 from opensourcerouting/fix/bgp_coverity_1617727
Russ White [Tue, 28 Jan 2025 15:35:57 +0000 (10:35 -0500)]
Merge pull request #17863 from opensourcerouting/fix/bgp_coverity_1617727

bgpd: Check if the peer really exists before sending dynamic capability

2 months agoMerge pull request #17736 from opensourcerouting/table-direct
Russ White [Tue, 28 Jan 2025 15:24:00 +0000 (10:24 -0500)]
Merge pull request #17736 from opensourcerouting/table-direct

bgpd,lib,zebra: permit table-direct on VRFs

2 months agobgpd: Do not ignore auto generated VRF instances when deleting 17947/head
Donatas Abraitis [Tue, 28 Jan 2025 15:11:58 +0000 (17:11 +0200)]
bgpd: Do not ignore auto generated VRF instances when deleting

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>
3 months agotopotests: test v6 & dst-src in static_simple 17941/head
David Lamparter [Mon, 27 Jan 2025 17:36:12 +0000 (18:36 +0100)]
topotests: test v6 & dst-src in static_simple

The "static_simple" test has code for testing IPv6 routes, but it wasn't
even being run (duh.)  Enable it, and also test IPv6 dst-src routes.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 months agostaticd: fix NHT for dst-src routes
David Lamparter [Mon, 27 Jan 2025 16:57:54 +0000 (17:57 +0100)]
staticd: fix NHT for dst-src routes

staticd's NHT code wasn't updating dst-src routes :(

Fixes: FRRouting/frr#14247
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 months agolib, zebra: carry source prefix in route_notify
David Lamparter [Mon, 27 Jan 2025 19:26:32 +0000 (20:26 +0100)]
lib, zebra: carry source prefix in route_notify

When a daemon wants to know about its routes, make it possible to have
that work for dst-src routes.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 months agostaticd: fix botched staticd YANG for dst-src
David Lamparter [Mon, 27 Jan 2025 17:18:24 +0000 (18:18 +0100)]
staticd: fix botched staticd YANG for dst-src

The staticd YANG conversion completely f*cked up dst-src routes.
Stupidly enough, the correct thing is much simpler as seen by the amount
of deletes in this commit.

This does, unfortunately, involve a rather annoying YANG edge case with
what should reasonably be an optional leaf as part of a list key, which
is not possible.  It uses `::/0` as unconditional filler instead, since
that is semantically correct.

The `test_yang_mgmt` topotest needed to be adjusted after this to add
`src-prefix='::/0'`.

Fixes: 88fa5104a04a ("staticd : Configuration northbound implementation")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 months agobgpd: fix table-map option 17802/head
Alexander Skorichenko [Thu, 23 Jan 2025 10:35:44 +0000 (11:35 +0100)]
bgpd: fix table-map option

Schedule zebra to withdraw routes filtered out by a table-map.

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>