Merge pull request #21754 from PierreNeltner6WIND/topotest-client-to-clienttopotests: Add a topotest for the no bgp client-to-client reflection command
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...
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>
bgpd: Ignore allocating attr->extra if aigp value is 0RFC 7311 does say anything about value 0, but practically that means nothing
if we receive it as 0...
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd: Move srv6_l3service from attr to attr_extraSave the memory for regular use cases where srv6 it not needed.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd: Move srv6_vpn from attr to attr_extraSave the memory for regular use cases, where srv6 is not needed.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd: Move link_bw from attr to attr_extraSave the memory if link bandwidth is not used for regular use cases.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd: Move link state attribute from attr to attr_extraTo save the memory for use cases where LS is not needed.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd: Move aigp_metric from attr to attr->extraIt takes 8 bytes, and not used with "regular" use cases.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd: Discard only attr->extra instead of flushing all attributesFixes: f56fe96453534ae4cbd78ebb75001e704d762326 ("bgpd: Move nhc attribute from attr to attr_extra")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd: Create BGPID TLV only if we do not return too earlyIf the route-map is used for network (static), and we have a deny, we should
free NHC with this TLV, so instead of that, let's allocate it when we need that
really.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd: Flush attributes that were used for conditional adv route-mapValgrind:
=================================================================
==12114==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 16 byte(s) in 1 object(s) allocated from:
0 0x7f0fb52b83b7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
1 0x7f0fb4e31094 in qcalloc lib/memory.c:111
2 0x56020cc25358 in bgp_attr_extra_dup bgpd/bgp_attr...
bgpd: Move nhc attribute from attr to attr_extraCreate an additional struct called attr_extra for holding optional
feature-specific attributes.
The first client is nhc attribute, but I'm planning to continue with others,
e.g.: aigp_metric, link_bw, evpn stuff, srv6 stuff, link-state stuff...
This would save attr struct from ~360 bytes to ~180 bytes eventually, that's
a huge win for classical deployments with IPv4/IPv6 unicasts.
Signed-off...
bgpd: Fix crash of bgp_bmp.c with a mirror situationThe qitem being used in the bmp mirror code was being
enqueued multiple times across multiple vrf's. This
leads to crashes, modify the code to enqueue a qitem
once per vrf.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests: Add a bgp bmp mirror testCode examination of bgp_bmp.c showed a situation where
having multiple mirrors would create a crash situation.
Show that the crash can happen.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
lib: fix NULL deref in frr_signal_timerWhen `SIGEVENT_SCHEDULE_THREAD` is defined, `frr_signal_timer()` was
NULLing `sigm->t` and then immediately dereferencing it on the next line
to fetch the event loop master:
sigm->t = NULL;
event_add_timer(sigm->t->master, ...);
Rework this so that the NULL dereference cannot happen.
Drop the redundant `sigmaster.t = NULL;` in `signal_init()`;
Signed-off-by: Donald Sharp <sharpd@nvi...
ldpd: Allow event_add_read to work properly on initialCurrently ldpd has a couple of spots that do this:
mem = malloc()
event_add_XXX(....., &mem->t_event...)
malloc can/will give you memory that has randomly
set values. When you call event_add_XXX the address
of the pointer is looked at as well as the dereference
if there is something in there, the event system assumes
that an event is already scheduled. This will cause
the initial event_add_...
tests: Test startup of tc with tc_basicThis test script was not testing the read in of
zebra owned tc qdisc values are read in and removed.
Add this. Additionally convert the test to use
run_and_expect instead of sleep.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra: Convert RTNLGRP_TC netlink messages to use the dplaneModify the code to use the dplane for all RTNLGRP_TC netlink
messages.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra: pass ns_id to zebra_dplane_startup_stageThe zebra_dplane_startup_stage helper only ever needed the namespace
id, not the full struct zebra_ns. Switch its parameter to ns_id_t
directly so callers running in the dataplane pthread can invoke it
without dereferencing a struct zebra_ns owned by the zebra main
thread.
Update all existing callers in if_netlink.c, if_sysctl.c, if_ioctl.c
and kernel_socket.c to pass zns->ns_id.
Signed-off-b...
tests: Add topotests for BGP allowas-in route-mapExtend bgp_as_allow_in test suite with three new test cases covering
route-map based allowas-in filtering functionality.
New tests:
- test_bgp_allowas_in_route_map_p0: Tests selective route acceptance
based on prefix-list matching (subnet and length filtering). Verifies
routes matching both subnet (192.0.2.0/24) and length (ge 31 le 32)
are accepted while others are rejected.
- test_bgp...