Merge pull request #19165 from opensourcerouting/fix/weighted_ecmp_link_bandwidth_between_vrfsbgpd: Extract link bandwidth value from extcommunity before using for WCMP
bgpd: Extract link bandwidth value from extcommunity before using for WCMPExtended communities are exported/imported correctly between VRFs, but we need
to extract the actual link-bandwidth value from the extended communities.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
tests: Increase timeout for any test that uses the retry mechanism.Test is showing this on failure in the logs for the static_vrf test
locally:
2025-07-09 11:28:15,614 INFO: topo: Function raised exception: "AssertionError("Failed to find \n '192.0.2.130'\n in \n '198.51.100.1 nhid 25 via 192.0.2.2 dev r1-eth0 proto 196 metric 20 \n '\nassert '192.0.2.130' in '198.51.100.1 nhid 25 via 192.0.2.2 dev r1-eth0 proto 196 metric 20 \\n'")"
2025-07-09 11:28:15...
bgpd: fix memory leak with srv6 locatorWhen SRv6 locator is modified for configuration, a memory leak is
observed.
> ==26714==ERROR: LeakSanitizer: detected memory leaks
>
> Direct leak of 1104 byte(s) in 3 object(s) allocated from:
> #0 0x7fb232cb83b7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
> #1 0x7fb232822b79 in qcalloc lib/memory.c:111
> #2 0x7fb23283a8b6 in srv6_locator_all...
bgpd: add trace to dump SID allocator request and its locatorAdd a new trace before sending a message to ZEBRA, to request for a SID.
> 2025/06/25 15:46:12 BGP: [PK8ZC-3S45T] ensure_vrf_tovpn_sid_per_af: allocating new SID for vrf VRF vrf20: afi IPv6, locator loc1
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
topotests: bgp_srv6l3vpn_sid, add test to control sid allocation per vrfAdd test to control SID allocation per vrf. Test the case with a locator
in each of the two BGP instances. Test also the case with no locator in
the default BGP instance.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd: fix release SID upon SID notification mismatchWhen a SID is allocated, and BGP configuration has changed, a mismatch
is identified, but the SID is still considered as valid from zebra
perspective. Fix this by releasing the SID upon error.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd: enforce control on srv6 locator on sid notificationWhen a SID is allocated, no check is done about the locator which has
granted the SID. Retrieve the locator name from the zapi message, and
compare the locator_name against the configured locator name.
Display a message in case locator mismatch appears. Update current
message:
> 2025/06/25 14:36:46 BGP: [MZG7B-9WJC2] bgp_zebra_srv6_sid_notify: received SRv6 SID notify: ctx End.DT4 vrf_id 6 (vr...
bgpd: add bgp_srv6_locator_lookup() APIAdd an API to return the locator structure that should have been
resolved by zebta. Return NULL if no resolution has been done.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd: remove srv6_enabled from bgpd instanceThe srv6_enabled attribute is useless, and reflects the configuration of
a locator. Simplify the algorithm by not using that attribute.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd: fix free SID once sid_unregister calledThe sid_unregister() function accesses the SID value, whereas that SID
value has been freed just before. Swap the order of execution of the two
lines.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd: update hencaps when removing bgp srv6 configurationWhen the bgp srv6 configuration is disabled, the header encaps
configuration should be set to its default value too.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
tests: Fix bgp_bmp testsThe bgp_bmp tests have a global SEQ number that was being shared
across all tests running at the same time. As such if one of the
3 tests was running at the same time as the other 2, you could end
up in a situation where the SEQ number from one test would affect
a different test, thus causing it to get out of sync and fail the test.
I saw this when I added log output to display the starting s...
bgpd: fix "neighbor <n> local-as (null)" in running-configIssue:
The vtysh running-config will incorrectly show
bgp neighbor local-as value as (null) with this config sequence -
1.configure bgp peer-group p1 with local-as as1
2.configure bgp neighbor n1, assign peer-group pg1 to it.
3.set local-as of neighbor n1 to as1
RC:
peer->change_local_as_pretty(having string value of local-as) is not set for bgp neighbor,
when new configured local-as value ...
bfdd: add option to restrict listening VRFsBy default bfdd daemon listens to all created vrfs, which is
incorrect in case of running multiple frr instances in
different namespaces.
Signed-off-by: Alexandra Rukomoinikova <1248756005hfh@gmail.com>
bgpd: Allow setting extcommunity link bandwidth value to zeroThe latest https://datatracker.ietf.org/doc/html/draft-ietf-idr-link-bandwidth-13
says that zero(0) is fine.
>Implemention MUST be able to process and accept a Link Bandwidth Extended
Community where the bandwidth value is set to zero.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd: Fix DEREF_OF_NULL.EX.COND in bgp_updgrp_packetFound by the static analyzer Svace (ISP RAS): DEREF_OF_NULL.EX.COND.
After having been assigned to a NULL value at bgp_updgrp_packet.c:717,
pointer 'from' is passed as 9th parameter in call to function
'bgp_packet_attribute' at bgp_updgrp_packet.c:746, where
it is dereferenced at bgp_attr.c:4638.
Signed-off-by: Petr Vaganov <petrvaganoff@gmail.com>
bgpd: adjust display formatJust adjust display format for `show bgp ipv6 unicast`, add two white spaces.
Before:
```
Network Next Hop Metric LocPrf Weight Path
*>i 3001::/64 fe80::2e53:4aff:fe30:820
0 100 0 i
```
After
```
Network Next Hop Metric LocPrf Weight Path
*>i 3001::/64 fe80::2e53:4aff:fe30:82...