tests: clean out a few warningsEnforcing `-Werror` on the tests isn't particularly helpful, but might
as well make it clean while at it.
The noreturn stuff isn't worth it IMHO, hence just disabling that
warning for tests.
Signed-off-by: David 'equinox' Lamparter <equinox@opensourcerouting.org>
ospfd: work around known frr-format plugin issueThe `frr-format` plugin (which checks format strings for correct use of
e.g. `%pI4`) has some shortcomings that I can't fix since they'd either
need touching GCC (so you'd need a custom GCC version to use it... yeah,
no.) or they would need an excessive amount of time from me to try and
understand GCC interna (that I will never again need.)
Specifically, the type `(size_t) ( ... )` here is "co...
isisd, tools: fix 2 uninitialized warningsStupidly enough I didn't note down which compiler is complaining about
these, but I know I haven't gone and randomly added initializers for
fun. Some version of something complained about these two.
Signed-off-by: David 'equinox' Lamparter <equinox@opensourcerouting.org>
lib: silence a `.l` clang unused-but-set warning```
lib/command_lex.l:77:24: error: variable 'buffer' set but not used [-Werror,-Wunused-but-set-global]
```
I'm not digging further into this since this is dealing in
flex-generated code, and while it might be "unused-but-set" with my
specific flex version (being in fact unused), it'll probably break with
some random other flex version.
Signed-off-by: David 'equinox' Lamparter <equinox@opens...
zebra/fpm_listener: add a `FRR_NORETURN` for clangclang-23 is unhappy:
```
zebra/fpm_listener.c:1124:1: error: function 'sigterm_handler' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
```
Signed-off-by: David 'equinox' Lamparter <equinox@opensourcerouting.org>
lib: fix event loop shutdown conditionWhen clearing out events from a loop, we just set the fd to `-1`, which
is perfectly fine. But we didn't update the highest-used index, which
is used for determining if a loop still has things to do. It was never
getting to zero, leading to another broken shutdown condition.
Again, no impact to normal daemon operation, just `test_zmq` hanging.
(I haven't dug up where this broke, it worked a...
lib: fix epoll refactor of event_fetch loopWhen epoll support was added, `event_fetch_inner_loop` got split off
from the containing function, which in itself is a good thing.
Unfortunately this change missed the fact that the inner loop code there
has (*had*) side effects carried through to the next loop iteration by
way changing some variables that take effect into the next loop.
This doesn't break anything - almost. It affects proce...
lib: don't crash on xref=NULL events in `%pTHD``%pTHD` isn't really used in a lot of places, and those that exist
AFAICS can't run into this condition, but either way we shouldn't crash
when printing a zeroed/unused `struct event` with `%pTHD`. (`->xref`
won't ever be NULL while an event is in use.)
(I ran into this after adding some printf debugging.)
Signed-off-by: David 'equinox' Lamparter <equinox@opensourcerouting.org>
zebra: strip unneeded casts that trip frr-formatThis only shows up with the frr-format plugin loaded into GCC:
```
zebra/zebra_dplane.c:6759: warning: format ‘%Lu’ expects argument of type ‘uint64_t’, but argument 4 has type ‘long unsigned int’ (strict match required [B]) [-Wformat=]
```
The arguments are, in fact, correctly typed `uint64_t`, but there's this
GCC "peculiarity" that using a cast in an argument list "boils down" the
cast all...
zebra: match config write to CLI in PREF64Well, the test didn't try writing the configuration and loading it back,
so a mismatch snuck in :(. The CLI expects `lifetime` to be there as a
word, but it's not written back out. So we write invalid config. Sigh.
Add the missing word to config writes, but also allow the broken form as
a hidden command.
Signed-off-by: David 'equinox' Lamparter <equinox@opensourcerouting.org>
Merge pull request #21754 from PierreNeltner6WIND/topotest-client-to-clienttopotests: Add a topotest for the no bgp client-to-client reflection command
bgpd: limit GR-stale NHT-unreach delete to GR helper contextPR #21742 added deletion of stale paths in evaluate_paths() when the
nexthop becomes unreachable, gated on BGP_PATH_STALE. However,
BGP_PATH_STALE is also set during Enhanced Route Refresh (RFC 7313)
in bgp_clear_route_node(), clearing_clear_one_pi(), and
bgp_set_stale_route(), so the existing gate could in principle act on
stales set via the enhanced-refresh path.
Mirror the GR-specific half ...
lib: rename `netns_linux.c` to `netns.c`Since the file is used on all platforms, just name it `netns.c`.
Signed-off-by: David 'equinox' Lamparter <equinox@opensourcerouting.org>
lib: remove netns_other.cThe condition at the top of this file can never be met, because the
defines it is checking are defined in `config.h`, which is included from
`zebra.h`, which is included *after* the condition check.
So, this file was never even compiled.
Signed-off-by: David 'equinox' Lamparter <equinox@opensourcerouting.org>
tests: Add topotest for BGP-LS SRv6 extensions in BGP-only fabricAdd a dedicated topotest suite bgp_link_state_bgp_fabric_srv6 to
verify BGP-LS export of SRv6 NLRIs and attributes in a BGP-only fabric
scenario.
The topology consists of four fabric routers (r1-r4) with SRv6 locators
and static uN/uA SIDs configured, peering with a route reflector (rr)
acting as the BGP-LS collector. r1/r2 form an iBGP pair (AS 65001),
r3/r4 form an eBGP pair (AS 65002/65003)...
bgpd: Advertise SRv6 Capabilities TLV in BGP-LS Node attributesAdd a helper bgp_ls_has_srv6_capability() that returns true when the
BGP-LS instance has received at least one SRv6 locator.
When originating the BGP Node NLRI, include the SRv6 Capabilities TLV
in the node attributes if the instance has SRv6 capability. This signals
to BGP-LS consumers that the node is SRv6-capable.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
bgpd: Request all SRv6 locators on BGP-LS instance registrationWhen a BGP instance with BGP-LS fabric distribution enabled registers
with the SRv6 SID Manager, request all locators instead of a specific
one.
This ensures BGP-LS receives the full locator set at startup and can
originate Prefix NLRIs with SRv6 Locator TLVs for each configured
locator.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
bgpd: Originate and withdraw SRv6 locator prefixes as BGP-LS Prefix NLRIsWhen a new SRv6 locator is received from the SRv6 SID Manager, originate
a BGP-LS Prefix NLRI carrying an SRv6 Locator TLV with the locator
flags, metric and algorithm number. When a locator is removed, withdraw
the corresponding Prefix NLRI.
On the first locator advertisement, set has_srv6_locator on the BGP-LS
instance and re-originate the Node NLRI so the SRv6 Capabilities TLV is
included.
...
bgpd: Refactor BGP-LS prefix origination into shared helperExtract common BGP-LS prefix NLRI construction into a new internal
helper to avoid duplication between route-prefix and locator-prefix
origination paths.
Add bgp_ls_originate_prefix_internal() to centralize:
- allocating the prefix NLRI and selecting the NLRI type from AFI
- populating local-node descriptors (ASN and BGP Router-ID)
- building prefix descriptors (BGP route type and IP reachabi...
zebra,lib: Allow SRv6 locator query for all locatorsAllow SRv6 get-locator requests to omit the locator name and treat that
as a request for all locators.
Update zclient and zapi message handling so NULL locator names are
encoded/decoded safely and passed through to the SRv6 manager callback.
In zebra SRv6 manager, when locator_name is NULL, iterate all configured
locators and send each one to the requesting client.
This adds bulk locator ret...
bgpd: Export static SRv6 END.X SIDs in BGP-LS link attributesAdd BGP-LS support for static SRv6 END.X LocalSIDs and attach them to
BGP link NLRIs as SRv6 End.X attributes.
Maintain a per-instance END.X SID list keyed by SID/prefix and store
peer matching keys (next-hop IPv6 and ifindex). When END.X localsids are
added or removed, update the list and refresh the corresponding BGP link
advertisement.
Refactor link origination to accept optional attribute...
bgpd: Export static SRv6 END SIDs as BGP-LS SRv6 SID NLRIsAdd BGP-LS support for static SRv6 LocalSIDs (END behaviors) learned via
zebra route redistribution.
Introduce BGP-LS handlers to process redistribute add/delete events and
react to SRv6 localsid updates. For eligible static IPv6 routes, map
seg6local action/context to SRv6 endpoint behavior and optional SID
structure fields, then originate/withdraw SRv6 SID NLRIs.
Signed-off-by: Carmine Scar...
bgpd: Subscribe IPv6 redistribution with distribute bgp-fabric-link-stateWhen BGP-LS fabric distribution is enabled, bgpd must receive IPv6
redistributed routes from zebra so SRv6-related route information can
be exported through BGP-LS.
On distribute bgp-fabric-link-state, register IPv6 ZEBRA_ROUTE_ALL
redistribution by calling bgp_redist_add() and
bgp_redistribute_set(). Log a warning if subscription setup fails.
On no distribute bgp-fabric-link-state, remove th...
zebra: Encode seg6local action/context in redistributed nexthopsWhen zebra sends redistributed routes, SRv6 seg6local metadata attached
to nexthops is not propagated in the ZAPI payload.
Encode seg6local metadata in zsend_redistribute_route() by setting
ZAPI_NEXTHOP_FLAG_SEG6LOCAL and filling seg6local_action plus
seg6local_ctx when a nexthop has a valid seg6local action.
This preserves SRv6 LocalSID metadata across zebra-to-bgpd
redistribution, so bgpd c...
Merge pull request #21859 from opensourcerouting/feature/reintroduce_attr_extra_2bgpd: Move some optional feature-specific attributes from struct attr to struct attr_extra
ospf6d: fix missing updating the global tableWhen the `old_route->paths` in `ospf6_intra_prefix_route_ecmp_path` changes,
the corresponding entry in the area table has already been updated. However,
when the global table is updated subsequently, the corresponding entry cannot
be deleted due to the changed `old_route->paths`.
So, relax `ospf6_area_route_hook_remove`'s search and ignore the paths. This way,
the corresponding entry in the g...
pimd: Fix crash when up->channel_oil is NULLThe up->channel_oil is being de-referenced
without any NULL check.
In events like VRF migration, where the timer fires
in some cases when the up->channel_oil is already deleted
it could lead to intermittent crash.
Signed-off-by: usrivastava-nvidia <usrivastava@nvidia.com>
bgpd: cancel LLGR stale timer on peer AF deleteWhen BGP GR helper mode arms an LLGR stale timer, the event callback argument is the struct peer_af for that AFI/SAFI. Deactivating the AF with no neighbor ... activate frees the peer_af in peer_af_delete(), but the stale timer could remain queued and later dereference the freed callback argument.
Cancel peer->t_llgr_stale[afi][safi] while deleting the peer AF so no stale LLGR callback can run...
lib: fix libfrr version dump from command lineDue to... reasons... we nowadays start with a stack frame that is 16
byte aligned, but GCC expects it to be 16 + off by 8 and therefore
subtracts 8. Which makes the stack unaligned and as soon as we execute
a `movaps` (the "a" is for aligned) we go up in flames.
Add `force_align_arg_pointer` attribute. Technically intended for
interop with legacy code/libraries, but fixes this here too.
Sig...
mgmtd: use proper LIB_LDFLAGS for libmgmt_be_nb`LIB_LDFLAGS` doesn't contain anything of import, normally. So not
using it will work perfectly fine.
Until someone like me does funky things with the build and then the one
library not having it in its LDFLAGS breaks :).
Signed-off-by: David 'equinox' Lamparter <equinox@opensourcerouting.org>
tools/checkpatch: rewrite DEFUN-removal functionOn top of the state leak fixed in the previous commit, the end condition
was a bit too specific, causing actual code to be ignored. (e.g. an
ALIAS isn't followed by the code block, and the diff chunk might end.)
Rewrite the thing in Friday-afternoon-stupid-simple.
Signed-off-by: David 'equinox' Lamparter <equinox@opensourcerouting.org>
tools: use more pedestrian perl, nuke flip-flop opSo, TIL perl has `..` and it's called the "flip-flop operator". Left
side turns it on, right side turns it off, and the point of it is that
it *remembers state*.
Unfortunately, it also *remembers state*. Between multiple input files
or commits in this case. So if one of your commits ended its diff
context inside a `DEFUN`... it would stay on "disabled". Which means
the beginning of your ne...
bgpd: Move attr->pmsi_tnl_type to attr->extraAnd make it dependent with attr->extra->tunn_id, because tunn_id is used
only if pmsi_tnl_type is PMSI_TNLTYPE_INGR_REPL.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>