bgpd: Link L2VNI to L3VNI only when it really existsWhen a L2VNI is made known to bgpd, the current linking of it to L3VNI
does not quite check if the L3VNI is known to bgpd. This is incorrect
and can lead to problematic behavior in some situations. In one
specific instance, if type-1 routes from a remote MH pair already
exist, the ES-VRF association gets prematurely setup leading to the
corresponding L3NHG getting setup with incorrect informati...
build: enable epoll in the event lib by defaultEnable epoll by default on platforms where it's present. The
configure tests fall back to ppoll (or poll) otherwise.
Signed-off-by: Mark Stapp <mjs@cisco.com>
lib: converting epoll-based code to typesafe hashUse the typesafe hash lib for the new epoll objects. Also make
a few cleanups and adjustments after testing.
Signed-off-by: Mark Stapp <mjs@cisco.com>
lib: Support epoll APIs in thread management routineThis commit adds support for epoll APIs for better
performance. This is controlled by a configure option. Note that
epoll APIs are only available for Linux platforms. For BSD and
other linux platforms which do not support epoll APIs, poll APIs
are still used.
Signed-off-by: Kaifei Peng <2534164734@qq.com>
Signed-off-by: Mark Stapp <mjs@cisco.com>
bgpd: Initialize ifindex to IFINDEX_INTERNAL to avoid garbage in zlog_debug../bgpd/bgp_zebra.c: In function 'zebra_read_route':
../bgpd/bgp_zebra.c:574:25: warning: 'ifindex' may be used uninitialized in this function [-Wmaybe-uninitialized]
574 | zlog_debug("Rx route ADD %s %s[%d] %pFX nexthop %s (type %d if %u) metric %u distance %u tag %" ROUTE_TAG_PRI,
| ^
../bgpd/bgp_zebra.c:509:19: note: 'ifindex' was decla...
bgpd: Initialize nhtype to unspecified (0) before using in zlog_debug../bgpd/bgp_zebra.c:505:30: note: 'nhtype' was declared here
505 | enum nexthop_types_t nhtype;
| ^
../bgpd/bgp_zebra.c: In function 'zebra_read_route':
../bgpd/bgp_zebra.c:574:25: warning: 'ifindex' may be used uninitialized in this function [-Wmaybe-uninitialized]
574 | zlog_debug("Rx route ADD %s %s[%d] %pFX nexthop %s (t...
bgpd: fix srv6-only command defaulted when 'no segment-routing ipv6'When the 'no segment-routing ipv6' command is applied, the current
srv6-only configuration is still used; this makes think that the
previous command is ineffective. Fix this by defaulting the value to
false.
Fixes: 4c80ab09dfd7 ("bgpd: add srv6-only command per bgp instance")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
topotests: bgp_srv6l3vpn_sid, add a withdraw vpn path checkAdd a test in bgp_srv6l3vpn_sid test where, upon withdrawing a VRF BGP
update, the resulting VPN paths are completly withdrawn.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd: fix withdraw all VPN paths upon withdraw L3VRF path suppressedOn a L3VPN configuration with srv6 and mpls coexistence, both paths are
exported. Upon withdrawing the path of origin, only one out of the two
VPN paths is suppressed.
> r1# show bgp ipv4 vpn
> [..]
> Route Distinguisher: 11:10
> *> 192.168.1.0/24 0.0.0.0@7< 0 32768 ?
> UN=0.0.0.0 EC{77:77} label=16 sid=2001:db8:1:1:: sid_structure=[40,24,16,0] type=bgp, subtype=5...
bgpd: fix uninitialized variable in bgp_need_listeningThe listener variable was not initialized to NULL, causing undefined
behavior when the listen_sockets list is empty. This prevented the
listening socket from being created for the default VRF, leading to
poll() errors and crashes in BGP tests.
Root cause: When the list is empty, the loop never executes, leaving
listener uninitialized. The subsequent NULL check then reads an
uninitialized value...
bgpd: fix memory leak in BGP NHC TLV processingFix memory leak that occurs when processing duplicate NHC TLVs in
BGP UPDATE messages. The code was allocating a TLV structure and
value buffer before checking if a TLV with the same code already
existed. If a duplicate was found, the newly allocated TLV was
leaked.
Also fix error path where TLV was not freed before returning on
NNHN TLV validation error.
This leak can occur on long-lived BGP...
bgpd: add evpn prefix in json outputPR 4850 has changed JSON output format where
evpn prefix is dissected to display each
fields. In effort to do so, it removed the
evpn prefix and prefixlen fields which causes
a regression issue in exisitng cli parser.
Adding back evpn prefix and prefixlen.
Ticket: CM-30105
Reviewed By:CCR-10420
Testing Done:
TORS1# show bgp l2vpn evpn route vni 1002 mac
00:02:00:00:00:01 ip fe80::202:ff:fe00:...
lib: ospf_snmp.c is compiling with warningsSince the change to the byte length macros
was switching it from a sizeof(X) to a straight
number, the number is being treated as a integer.
GCC is rightly treating this as mixing integer
sizes and calling out problems. Let's tell
the compiler that these values are actually Unsigned
Longs.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
lib: Change sizeof(..) to actual byte sizes for addressesCoverity is complaining about mixing sizeof operators with
ptr arithmetic. Let's just convert to the actual byte sizes
instead of doing sizeof().. We already have this in other
places in the code. Should be ok.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests: Add a test to check if BGP socket is created for a default VRFApplied a black styling also...
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd: Activate listening socket for a default VRF when createdThe intention was to stop/start listening sockets for VRF instances, but not
for a default VRF. This is especially useful for VRF leaking, when non-default
VRFs do not have any peers configured.
Fixes: f8dafef42b694de723df256765df37f8405ef48e ("bgpd: avoid socket activation for VRF instances")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
docker: Move apk dependencies into APKBUILD fileInstall as root, but take them from APKBUILD file to be consistent as others.
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
zebra: Check return code of sscanfWe check the return code of sscanf, every where but this
place. Do so.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
nhrpd: Initialize variableCoverity thinks it is possible that FRR has
a code path where the nmba_addr is not initialized
when it is used to set another variable. Let's
make coverity happy.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
tests: check import of non zebra extern_learn neighborsCheck import of non zebra extern_learn neighbors to zebra neighbor
table.
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>