Chirag Shah [Mon, 13 Jan 2025 02:31:02 +0000 (18:31 -0800)]
tools: fix frr-reload for nbr deletion of no form cmds
When a bgp neighbor removed from associated to peer-group,
the neighbor is fully deleted, subsequent deletion of any
configuration related to the neighbor leads to failure
in frr-reload.
Handle any 'no neighbor ...' part of lines_to_del list
Testing:
Below first line would delete the neighbor swp1.10,
the existing code before the change handles to remove
config starts with 'neighbor swp1.10 ...' but not
'no neighbor swp1.10 ...'.
LaTex doesn't like the Unicon character `≥` which should be represented
by the special sequnce `$\leq$`. Since this is buried all in Sphinx, and
we also have a scrip that look for the character, the easiest fix is to
just use `>=` instead which works without warnings, and without asking to
ignore every warning about the use of every instance of the special char.
Christian Hopps [Sun, 12 Jan 2025 09:42:33 +0000 (09:42 +0000)]
tests: update munet to 0.15.4
- add readline and waitline functions for use with popen objects
- other non-topotest (munet native) run changes
- vm/qemu support booting cloud images (rocky, ubuntu, debian)
- native topology init commands
Enke Chen [Sat, 11 Jan 2025 22:01:36 +0000 (14:01 -0800)]
bgpd: fix churn of aggregate routes from duplicate config
Currently when an aggregate-address is configured, the existing
entry is always removed regardless whether any change is involved.
This would create unnecessary churn of the aggregate route when
the same config is applied for the aggregate address.
The fix is to check for duplicate aggregate-address config.
Rajasekar Raja [Fri, 10 Jan 2025 21:39:12 +0000 (13:39 -0800)]
zebra: Optimize invoking nhg compare func
In some cases, the old_re nhe and the newnhe is same and there is no
point in comparing them both since they are the same. Skip comparing in
such cases.
Ex:
2025/01/09 23:49:27.489020 ZEBRA: [W4Z4R-NTSMD] zebra_nhg_rib_find_nhe: => nhe 0x555f611d30c0 (44[38/39/45])
2025/01/09 23:49:27.489021 ZEBRA: [ZH3FQ-TE9NV] zebra_nhg_rib_compare_old_nhe: 0.0.0.0/0 new id: 44 old id: 44
2025/01/09 23:49:27.489021 ZEBRA: [YB8HE-Z86GN] zebra_nhg_rib_compare_old_nhe: 0.0.0.0/0 NEW 0x555f611d30c0 (44[38/39/45])
2025/01/09 23:49:27.489023 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.9[0] vrf default(0) wgt 1, with flags
2025/01/09 23:49:27.489024 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 30.1.2.9[0] vrf default(0) wgt 1, with flags
2025/01/09 23:49:27.489025 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.2[4] vrf default(0) wgt 1, with flags ACTIVE
2025/01/09 23:49:27.489026 ZEBRA: [ZM3BX-HPETZ] zebra_nhg_rib_compare_old_nhe: 0.0.0.0/0 OLD 0x555f611d30c0 (44[38/39/45])
2025/01/09 23:49:27.489027 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.9[0] vrf default(0) wgt 1, with flags
2025/01/09 23:49:27.489028 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 30.1.2.9[0] vrf default(0) wgt 1, with flags
2025/01/09 23:49:27.489028 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.2[4] vrf default(0) wgt 1, with flags ACTIVE
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
anlan_cs [Thu, 9 Jan 2025 08:36:12 +0000 (16:36 +0800)]
ospfd: avoid the redundant timers
Since the timer thread for ```OSPF_ROUTE_AGGR_DEL``` has been created,
the subsequent "no summary-address" commands shouldn't trigger redundant timers.
Donald Sharp [Wed, 8 Jan 2025 14:42:49 +0000 (09:42 -0500)]
tests: bgp_srv6l3vpn_to_bgp_vrf3 needs more time
The test starts with checking for rib insertion
of routes that may take some time after system
startup to come up. Under heavy load this may
cause this test to just fail. Give it more time.
Donald Sharp [Thu, 9 Jan 2025 17:34:50 +0000 (12:34 -0500)]
zebra: Fix leaked nhe
During route processing in zebra, Zebra will create a nexthop
group that matches the nexthops passed down from the routing
protocol. Then Zebra will look to see if it can re-use a
nhe from a previous version of the route entry( say a interface
goes down ). If Zebra decides to re-use an nhe it was just dropping
the route entry created. Which led to nexthop group's that had
a refcount of 0 and in some cases these nexthop groups were installed
into the kernel.
Add a bit of code to see if the returned entry is not being used
and it has no reference count and if so, properly dispose of it.
Donald Sharp [Wed, 8 Jan 2025 14:41:21 +0000 (09:41 -0500)]
tests: bgp_srv6_sid_reachability should give more time
The test starts right in on check_pings with a 10 second
time out. Any type of delay on startup is going to cause
problems. Give the first check_ping significant time
for the test to be fully brought up.
Enke Chen [Thu, 9 Jan 2025 01:34:29 +0000 (17:34 -0800)]
bgpd: apply route-map for aggregate before attribute comparison
Currently when re-evaluating an aggregate route, the full attribute of
the aggregate route is not compared with the existing one in the BGP
table. That can result in unnecessary churns (un-install and then
install) of the aggregate route when a more specific route is added or
deleted, or when the route-map for the aggregate changes. The churn
would impact route installation and route advertisement.
The fix is to apply the route-map for the aggregate first and then
compare the attribute.
Martin Buck [Wed, 8 Jan 2025 09:38:56 +0000 (10:38 +0100)]
lib: Fix privs syscaps (pset_t) allocation
Don't over-allocate syscaps in zcaps2sys(): This is just a single struct
(pset_t) with a count and a pointer to an array of capabilities, not an
array. So only allocate a single pset_t, not num copies of it.
The allocation size of syscaps->caps then needs to be based on the number of
Linux capabilities (count), but that is already handled properly a few lines
below.
Note that this fix is mostly cosmetic and for correctness. There was no
potential for memory corruption, because num is guaranteed to be nonzero. So
at least the one required pset_t was always allocated (but potentially much
more).
Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
Philippe Guibert [Tue, 12 Nov 2024 08:41:46 +0000 (09:41 +0100)]
topotests: bmp, test syncro for pre/post-policy of imported bgps
Add a test that controls that the configuration of an imported
BGP instance triggers a re-syncronisation.
Ensure that changing an attribute like route distinguisher
triggers also a re-syncronisation.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Mon, 11 Nov 2024 21:24:57 +0000 (22:24 +0100)]
bgpd: add sync for monitored afi/safi of imported bgps
If an imported BGP is configured after BGP updates have been
received, then BMP will not detect those updates in the
monitor messages.
Syncronisation is also needed for separate instances.
For each imported bgp instance, syncronisation is re-done
for monitored afi/safis for ALL available instances.
- upon configuring an afi/safi (as previously)
- when configuring an imported view
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Mon, 16 Dec 2024 11:12:53 +0000 (12:12 +0100)]
bgpd: rework bmp end of rib processing
Move the end of rib processing code of a given BGP instance in a
separate function. This code prepares the next commit, it avoids
having the following warning:
> WARNING: Too many leading tabs - consider code refactoring
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Thu, 19 Dec 2024 13:23:40 +0000 (14:23 +0100)]
bgpd: fix access to invalid memory zone
> ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f73891cb146 bp 0x7ffca86584c0 sp 0x7ffca8658490 T0)
> ==837617==The signal is caused by a READ memory access.
> ==837617==Hint: address points to the zero page.
> #0 0x7f73891cb146 in bmp_targets_const_next bgpd/bgp_bmp.c:149
> #1 0x7f73891cb1a5 in bmp_targets_next bgpd/bgp_bmp.c:149
> #2 0x7f73891e875a in _bmp_vrf_state_changed_internal bgpd/bgp_bmp.c:3520
> #3 0x7f73891e8922 in bmp_vrf_itf_state_changed bgpd/bgp_bmp.c:3566
> #4 0x55e511af8d1b in hook_call_bgp_vrf_status_changed bgpd/bgp_zebra.c:64
> #5 0x55e511afa304 in bgp_ifp_up bgpd/bgp_zebra.c:234
> #6 0x7f738981c193 in hook_call_if_up lib/if.c:57
> #7 0x7f738981d09a in if_up_via_zapi lib/if.c:203
> #8 0x7f73899d6f54 in zclient_interface_up lib/zclient.c:2671
> #9 0x7f73899e3e5a in zclient_read lib/zclient.c:4624
> #10 0x7f738998078d in event_call lib/event.c:1996
> #11 0x7f7389848933 in frr_run lib/libfrr.c:1232
> #12 0x55e5117f7ae1 in main bgpd/bgp_main.c:557
> #13 0x7f7389229d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
> #14 0x7f7389229e3f in __libc_start_main_impl ../csu/libc-start.c:392
> #15 0x55e5117f4234 in _start (/usr/lib/frr/bgpd+0x2ec234)
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd, topotests: bmp imported bgp, send peer up events when config param changed
When a BGP instance is created or becomes valid, and when a parameter
is updated (router-id, route distinguisher), the peer up messages other
than loc rib peer up messages, are sent. Add a test that controls if
peer down and peer up messages are sent accordingly with correct route
distinguisher values.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Thu, 19 Dec 2024 08:19:12 +0000 (09:19 +0100)]
bgpd, topotests: bmp imported bgp, add loc-rib peer up support when vrf flaps
Add the emission of a loc-rib peer up event for an imported bgp instance
when vrf state changes. Add a test to control in the BMP collector
that the peer up message is the one from that BGP instance.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Thu, 19 Dec 2024 07:58:02 +0000 (08:58 +0100)]
bgpd, topotests: bmp imported bgp, add loc-rib peer up support when router-id changes
Add the emission of a loc-rib peer up event for an imported bgp instance
at route-id reconfiguration. Add a test to control in the BMP collector
that the peer up message is the one from that BGP instance.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Thu, 19 Dec 2024 07:36:12 +0000 (08:36 +0100)]
bgpd, topotests: bmp, add loc-rib peer up event for imported bgp
Add the emission of a loc-rib peer up event for an imported bgp instance
at import-vrf configuration. Add a test to control in the BMP collector
that the peer up message is the one from that BGP instance.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Mon, 23 Sep 2024 13:03:15 +0000 (15:03 +0200)]
bgpd: bmp, handle imported bgp instances for bmp statistics
Only the BMP statistics of the current BGP instance are handled.
Extend the transmission of BMP statistics for imported BGP instances.
- Separate the bmp_stats() function in two, and pass the bgp
instance to process its bgp peers, as a separate parameter.
- Pass the BGP peers from imported instances as parameter
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Mon, 23 Sep 2024 10:01:20 +0000 (12:01 +0200)]
bgpd: bmp, handle imported bgp instances in bmp_send_peerup()
When a BMP target comes up, only the peer up events of the
current BGP instance are sent.
- Apply the peer up event for external peers that are imported
by the BMP target.
- handle the peer up event when an imported vrf is
configured in a target.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd: bmp, handle imported bgp instances for peer up/down events
Only the peer transition events of the local BGP instance where BMP
is configured, were handled.
Add the support for peers from imported BGP instances:
- Add an internal API bmp_send_bt() function to handle stream
emission per bmp target
- Modify the BMP peer transition code to export the peer status
notifications to all BMP instances importing it.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Thu, 19 Sep 2024 16:04:02 +0000 (18:04 +0200)]
bgpd: add 'bmp import-vrf-view' command
Add a configuration command to import BGP information from
another BGP instance. Specifically, it should be possible for
a user to have a BMP instance configured on the default VRF,
and be able to import the VRF information from the other BGP
VRF instances.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Philippe Guibert [Mon, 23 Sep 2024 11:23:34 +0000 (13:23 +0200)]
bgpd: bmp, rename bmp->targets->bgp with peer->bgp
Some BMP actions require to get the bgp instance of the
given peer. Instead of considering that the BGP BMP instance
is the BGP instance of the peer, let us use directly the
peer->bgp pointer.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Martin Buck [Fri, 20 Dec 2024 17:55:26 +0000 (18:55 +0100)]
tests: ospf6_ecmp_inter_area, no shutdown r7/r8 eth3
Drop eth3 shutdown from ospf6d.conf - it doesn't do anything there. And it
actually shouldn't do anything: eth3 on r7/r8 are used as loopback-like
interfaces to inject the address on eth2 into OSPFv3. So they need to be up
for eth2 to work as expected.
Based on original PR#16811 commit:
eth3 shutdown is not applied because it is ospf6d.conf.
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>