Commit graph

37696 commits

Author SHA1 Message Date
Donatas Abraitis b330e6d3eb m4: Update ax_lua to support Lua 5.4
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-13 14:13:36 +02:00
Donald Sharp a962ff7833
Merge pull request #17829 from Jafaral/static-metric
tests: avoid nondeterministic route
2025-01-10 10:12:39 -05:00
Donatas Abraitis b4d640fc38
Merge pull request #17813 from enkechen-panw/aigp-fix6
bgpd: use igpmetric in bgp_aigp_metric_total()
2025-01-10 16:26:34 +02:00
Donald Sharp d390f471f1
Merge pull request #17830 from opensourcerouting/fix/timers_bgp_default
bgpd: Fix showing default `timers bgp x y`
2025-01-10 09:24:00 -05:00
Donatas Abraitis 35c0c827f2
Merge pull request #17811 from enkechen-panw/aggr-fix3
bgpd: fix memory leak in bgp_aggregate_install()
2025-01-10 09:47:21 +02:00
Donatas Abraitis 485342fe35
Merge pull request #17831 from Jafaral/ospf6-nodebug
ospf6d: guard a couple of debugs
2025-01-10 09:45:20 +02:00
Jafar Al-Gharaibeh 83990851ba ospf6d: guard a couple of debugs
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-09 17:26:10 -06:00
Enke Chen 36ce18d278 bgpd: fix memory leak in bgp_aggregate_install()
Potential memory leak with as-set and matching-MED-only config.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2025-01-09 14:48:35 -08:00
Donatas Abraitis 76fc75de9e bgpd: Fix showing default timers bgp x y
Fixes: ef4a9215b9 ("bgpd: Reuse defined constants for BGP timers")
Fixes: ab3535fbcf ("bgpd: Implement connect retry backoff")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-09 23:56:31 +02:00
Jafar Al-Gharaibeh 3915dd5b53 tests: avoid nondeterministic route
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-09 15:44:25 -06:00
Jafar Al-Gharaibeh 7e3d4048a6
Merge pull request #17805 from donaldsharp/2_test_fixes
2 test fixes
2025-01-09 15:40:08 -06:00
Jafar Al-Gharaibeh 34431a38f1
Merge pull request #17809 from donaldsharp/nhg_fix
zebra: Fix leaked nhe
2025-01-09 15:38:54 -06:00
Donatas Abraitis 003869b179
Merge pull request #17801 from enkechen-panw/aggr-fix2
bgpd: apply route-map for aggregate before attribute comparison
2025-01-09 23:02:26 +02:00
Donatas Abraitis 0b48c8e134
Merge pull request #17807 from louis-6wind/fix-bgp-orf-crash
bgpd: fix crash in displaying json orf prefix-list
2025-01-09 22:57:51 +02:00
Donatas Abraitis 3c3c7fc08d
Merge pull request #17808 from louis-6wind/rem-if-dead
lib: remove interface dead code
2025-01-09 22:54:43 +02:00
Enke Chen b89e66a3bc bgpd: use igpmetric in bgp_aigp_metric_total()
Use igpmetric from bgp_path_info in bgp_igp_metric_total() to be
consistent with all other cases, e.g., as in bgp_path_info_cmp().

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2025-01-09 12:02:02 -08:00
Donald Sharp 414bc26bc0 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.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-01-09 13:43:58 -05:00
Louis Scalbert 5100d842f6 lib: remove interface dead code
Remove interface dead code.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-01-09 18:38:28 +01:00
Louis Scalbert 8ccf60921b bgpd: fix crash in displaying json orf prefix-list
bgpd crashes when there is several entries in the prefix-list. No
backtrace is provided because the issue was catched from a code review.

Fixes: 856ca177c4 ("Added json formating support to show-...-neighbors-... bgp commands.")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-01-09 18:35:18 +01:00
Louis Scalbert b7e843d7e8 bgpd: fix bgp orf prefix-list json prefix
0x<address>FX was displayed instead of the prefix.

Fixes: b219dda129 ("lib: Convert usage of strings to %pFX and %pRN")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-01-09 18:35:18 +01:00
Donald Sharp 97fa24e70b 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.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-01-09 12:34:50 -05:00
Donald Sharp b46d3a1a42 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.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-01-09 10:31:07 -05:00
Jafar Al-Gharaibeh 465d286819
Merge pull request #17798 from mjstapp/fix_remove_clear_thread
libs: remove deprecated 'clear thread' cli
2025-01-09 09:01:33 -06:00
Enke Chen 43c5670141 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.

Here is an example of the churn:

debug bgp aggregate prefix 5.5.5.0/24
!
route-map set-comm permit 10
 set community 65004:200
!
router bgp 65001
 address-family ipv4 unicast
  redistribute static
  aggregate-address 5.5.5.0/24 route-map set-comm
!

Step 1:
  ip route 5.5.5.1/32 Null0

Jan  8 10:28:49 enke-vm1 bgpd[285786]: [J7PXJ-A7YA2] bgp_aggregate_install: aggregate 5.5.5.0/24, count 1
Jan  8 10:28:49 enke-vm1 bgpd[285786]: [Y444T-HEVNG]   aggregate 5.5.5.0/24: installed

Step 2:
  ip route 5.5.5.2/32 Null0

Jan  8 10:29:03 enke-vm1 bgpd[285786]: [J7PXJ-A7YA2] bgp_aggregate_install: aggregate 5.5.5.0/24, count 2
Jan  8 10:29:03 enke-vm1 bgpd[285786]: [S2EH5-EQSX6]   aggregate 5.5.5.0/24: existing, removed
Jan  8 10:29:03 enke-vm1 bgpd[285786]: [Y444T-HEVNG]   aggregate 5.5.5.0/24: installed
---

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2025-01-08 17:34:29 -08:00
Enke Chen b0f96fc247 Revert "bgpd: Reinstall aggregated routes if using route-maps and it was changed"
This reverts commit ee1986f1b5.

The fix is incomplete, and is no longer needed with the fix that applies
the route-map for an aggregate and then compares the attribute.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2025-01-08 09:13:11 -08:00
Donald Sharp 3d7dbcf6c6
Merge pull request #17795 from gromit1811/bugfix_priv_syscaps_alloc
lib: Fix privs syscaps (pset_t) allocation
2025-01-08 10:20:11 -05:00
Mark Stapp cb119907f0 libs: remove deprecated 'clear thread' cli
Remove a deprecated 'clear thread cpu' command.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-01-08 10:17:51 -05:00
Donald Sharp 068a637a46
Merge pull request #17778 from enkechen-panw/aggr-fix
bgpd: add a debug command for route aggregation
2025-01-08 08:57:54 -05:00
Martin Buck 4ed9147d98 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>
2025-01-08 10:38:56 +01:00
Enke Chen 2a19daa830 bgpd: add debugging command for route aggregation
Add a new debugging command:

  debug bgp aggregate [prefix <A.B.C.D/M|X:X::X:X/M>]

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2025-01-07 22:52:41 -08:00
Russ White 21fe1f4d83
Merge pull request #17707 from gromit1811/pr16811_rebased
tests: cleanup ospf6 ecmp inter area
2025-01-07 16:14:15 -05:00
Donald Sharp cc07a4a200
Merge pull request #17772 from LabNConsulting/chopps/fix-oper-walk
improve error handling of operational state walk callback
2025-01-07 13:52:37 -05:00
Donald Sharp 96ab6ae32b
Merge pull request #17781 from LabNConsulting/chopps/fix-keyless-list-query
fix xpath query on keyless list with positional predicate
2025-01-07 13:17:37 -05:00
Donald Sharp 0a52c233d3
Merge pull request #17782 from LabNConsulting/chopps/new-notify-msg-fmt
New YANG notify msg fmt
2025-01-07 13:15:40 -05:00
Donald Sharp 1a7923e7bc
Merge pull request #17783 from LabNConsulting/chopps/new-oper-get-callback
Add new oper state get callback
2025-01-07 13:11:26 -05:00
Russ White 8168dd931d
Merge pull request #17725 from opensourcerouting/fix/full_no_form_for_area-password
isisd: Allow full `no` form for `domain-password` and `area-password`
2025-01-07 09:41:39 -05:00
Russ White 6060d8b347
Merge pull request #17723 from opensourcerouting/fix/bgpd_metric_worse
bgpd: Respect `bgp bestpath missing-as-worst` for `table-map` as well
2025-01-07 09:41:08 -05:00
Russ White 8ed117ae19
Merge pull request #17700 from Andrew-Dickinson/fix-socket-gc
ospfclient: fix crash due to streamwriter garbage collect
2025-01-07 09:38:05 -05:00
Martin Buck a09d98a95e 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>
2025-01-07 15:22:02 +01:00
Martin Buck 763069cd3b tests: ospf6_ecmp_inter_area, use router_json_cmp
Use router_json_cmp when checking for proper nexthops to get better
diagnostics in case of mismatches. Add step() messages to see which check
failed.

Based on original PR#16811 commit:

    expect_num_nexthops() errors are not understandable.

    Use router_json_cmp.

    Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2025-01-07 15:21:58 +01:00
Russ White 2a90c80f49
Merge pull request #17733 from pguibert6WIND/bmp_event_changes
BMP handling of BGP configuration changes
2025-01-07 09:06:43 -05:00
Russ White 16d1a880d3
Merge pull request #17771 from opensourcerouting/fix/show_ifindex_bgp
bgpd: Show ifindex for every BGP nexthop cache entry
2025-01-07 09:03:33 -05:00
Russ White 5d75339c12
Merge pull request #17773 from LabNConsulting/chopps/more-oper-test-fix
tests: improve test reliability
2025-01-07 09:02:41 -05:00
Russ White ff794c5ffe
Merge pull request #17774 from famfo/doc/alpine
doc: fix building for alpine package path
2025-01-07 09:01:29 -05:00
Russ White 88f80328ca
Merge pull request #17779 from anlancs/ospfd/fix-wrong-check-summary
ospfd: fix wrong check for two commands
2025-01-07 08:56:36 -05:00
Russ White 1b13705517
Merge pull request #17667 from opensourcerouting/fix/withdraw_routes_regarless_of_coalescing_timer_to_expire_path_info_unusable
bgpd: Withdraw routes without waiting for the coalescing timer to expire
2025-01-07 08:54:52 -05:00
Russ White 7f2be9a595
Merge pull request #17474 from sougata-github-nvidia/rib_ip_protocol_cleanup
zebra: Fix ip protocol route-map issue.
2025-01-07 08:45:07 -05:00
Russ White c9c9608c70
Merge pull request #17431 from krishna-samy/bgpd_json_commits
bgpd: show json output changes to optimize various show commands
2025-01-07 08:43:55 -05:00
Christian Hopps e729676cfe tests: add test for new northbound get function
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-07 07:01:46 -05:00
Christian Hopps 4379066fdd lib: if.c use new get() oper callback
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-07 06:59:15 -05:00