Commit Graph

36696 Commits

Author SHA1 Message Date
Carmine Scarpitta
253991771d tests: Remove duplicate check_ping import
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-21 11:17:01 +02:00
Carmine Scarpitta
372b8762eb tests: Remove log monitor XX from srv6_sid_manager test
`log monitor XX` command is deprecated and does nothing. Let's remove it.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-21 11:09:41 +02:00
Carmine Scarpitta
1ea13efac0 tests: Remove log monitor XX from srv6_sid_manager test
`log monitor XX` command is deprecated and does nothing. Let's remove it.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-21 11:09:41 +02:00
Carmine Scarpitta
ddd690968e tests: Remove log monitor XX from srv6_encap_src_addr test
`log monitor XX` command is deprecated and does nothing. Let's remove it.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-09-21 11:09:41 +02:00
zhou-run
a9af78af42 isisd: Fix infinity flag not being set successfully
When creating SPF neighbors and calling spf_adj_list_parse_tlv(), the F_ISIS_SPF_ADJ_METRIC_INFINITY flag is only set to a local variable flags and not set to the SPF neighbor sadj->flags. Additionally, the pseudo node metric pseudo_metric is also not reflected in the F_ISIS_SPF_ADJ_METRIC_INFINITY flag, the metric should be checked using sadj->metric.

Signed-off-by: zhou-run <zhou.run@h3c.com>
2024-09-21 16:47:40 +08:00
Barry A. Trent
9b68853e0d pimd: add igmp proxy cli and yang configuration
Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
2024-09-20 13:44:48 -07:00
Barry A. Trent
26b67993d0 pimd, yang: add cli for igmp proxy
Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
2024-09-20 13:44:27 -07:00
Acee Lindem
77de5eeb80 ospfd: Interface 'ip ospf neighbor-filter' startup config not applied.
When 'ip ospf neighbor-filter <filter-name>' is configured in the startup
configuration, it is in the running configuration but not applied on the
interface.

Signed-off-by: Acee Lindem <acee@lindem.com>
2024-09-20 20:39:49 +00:00
Jafar Al-Gharaibeh
bb995fb915
Merge pull request #16881 from donaldsharp/zebra_nhg_install_fix
zebra: Pass in ZEBRA_ROUTE_MAX instead of true
2024-09-20 14:29:20 -05:00
Donald Sharp
8bb70ffb26 tests: Add a very basic dump bgp PATH.. topotest
None of the bgp dump code was even tested.  Add a bit
of basic stuff that it at least generates a dump file.
This can be extended at a future time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-20 13:02:51 -04:00
Mark Stapp
c40635c5c2 zebra: unlock if_table route_nodes
Must unlock if we break during iteration over any lib/table
tree.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-09-20 12:24:01 -04:00
Donald Sharp
58722b9448 zebra: Pass in ZEBRA_ROUTE_MAX instead of true
zebra_nhg_install_kernel takes a route type.  We don't
know it at that particular spot but we should not be passing
in `true`.  Let's use ZEBRA_ROUTE_MAX to indicate we do not
know, so that the correct thing is done.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-20 11:00:11 -04:00
Donald Sharp
65609a672f
Merge pull request #16876 from opensourcerouting/fix/ZEBRA_SEG6_LOCAL_ACTION_END_DX6_should_put_full_inaddr6
zebra: Send a correct size of ctx->nh6 for SRv6 SEG6_LOCAL_ACTION_END_DX6
2024-09-20 09:40:04 -04:00
Shbinging
d2c59d68c4 ospfd: fix no ospf abr-type syntax
Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2024-09-20 15:06:22 +08:00
Donald Sharp
40c9d64919
Merge pull request #16874 from enkechen-panw/redist-fix
bgpd: fix misplaced arguments in bgp_redistribute_add()
2024-09-19 22:16:20 -04:00
Donald Sharp
ddd100400a
Merge pull request #16875 from opensourcerouting/fix/deprecate_json
isisd: Remove deprecated JSON fields
2024-09-19 22:15:14 -04:00
Donatas Abraitis
73d01a8e40 zebra: Send a correct size of ctx->nh6 for SRv6 SEG6_LOCAL_ACTION_END_DX6
Fixes: f6e58d26f6 ("zebra, sharpd: add srv6 End.DX6 support")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-09-19 23:54:43 +03:00
Donatas Abraitis
17206eb818 isisd: Remove deprecated JSON fields
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-09-19 23:44:25 +03:00
Donatas Abraitis
74f12853c6
Merge pull request #16738 from odivlad/fix-stdout-fork
lib: Attach stdout to child only if --log=stdout and stdout FD is a tty
2024-09-19 22:24:19 +02:00
Donatas Abraitis
b5e266b032
Merge pull request #16782 from pguibert6WIND/fix_nexthop_set_failed_message
bgpd: fix 'nexthop_set failed' error message often displayed
2024-09-19 22:23:37 +02:00
Donatas Abraitis
2302e29146
Merge pull request #16872 from donaldsharp/remove_nl_addraw_l
zebra: Remove nl_addraw_l
2024-09-19 21:19:02 +02:00
Enke Chen
cb5e415c2a tests: adjust topotest after bgp_redistribute_add() fix
In ospf_multi_vrf_bgp_route_leak, the admin distance for the
redistributed ospf route should be 110, and should remain as 110 after
it's imported into another vrf, and then downloaded to zebra.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2024-09-19 11:57:20 -07:00
Enke Chen
3c433ae558 bgpd: fix misplaced arguments in bgp_redistribute_add()
Fix the misplaced arguments "bhtype" and "api.distance" in
bgp_redistribute_add().

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2024-09-19 08:52:35 -07:00
Donald Sharp
ccbfb46d28 zebra: Remove nl_addraw_l
This function is never used.  So let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-19 08:28:48 -04:00
Donatas Abraitis
cc7d3afdd5
Merge pull request #16848 from enkechen-panw/ecomm-val
bgpd: define val in ecommunity_val as uint8_t
2024-09-19 11:33:58 +02:00
Donatas Abraitis
4d18e4a8b3
Merge pull request #16868 from sri-mohan1/srib-24-frr-a
bgpd: changes for code maintainability
2024-09-19 11:33:36 +02:00
Louis Scalbert
6dc83f6a9a yang: use relative path for route-map
f1ea52bee9 ("yang: use relative path instead of absolute one for
route-map") has introduced a route-map optimization but some paths
were not changed.

Use relative path instead absolute one everywhere.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-09-19 11:26:57 +02:00
zhou-run
556a1138af isisd: Fix NHLFE entry memory leaks
Before adding an NHLFE entry, zebra calls nhlfe_nexthop_active_ipv4()/nhlfe_nexthop_active_ipv6() to check if there is a corresponding directly connected route for the next hop prefix of the NHLFE. If such a route exists, it directly overwrites the output interface of the NHLFE's next hop with the output interface of the directly connected route. If the output interface of the directly connected route is different from the output interface of the NHLFE's next hop, deleting the NHLFE entry later will fail because nhlfe_nhop_match() cannot find the same next hop address and output interface, leading to an NHLFE entry leak.

Establishing neighbors in ISIS only requires the existence of the neighbor's IP address and does not need the neighbor's IP address to be in the same subnet as the local IP address. When zebra creates an adjacency label entry, it uses the neighbor's IP address as the next hop. If the neighbor's IP address is not in the same subnet as the local IP address and there is a local directly connected route with the neighbor's IP address prefix, it will result in an issue where the corresponding adjacency label entry in zebra cannot be deleted.

We cannot enforce that ISIS must establish neighbors using IPv4 and IPv6 addresses in the same subnet, but we can ensure that IPv4 or IPv6 addresses in different subnets do not create adjacency labels.

Signed-off-by: zhou-run <zhou.run@h3c.com>
2024-09-19 14:07:35 +08:00
sri-mohan1
8b590cf759 bgpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2024-09-19 09:18:06 +05:30
Jafar Al-Gharaibeh
9a009e1274
Merge pull request #16860 from LabNConsulting/aceelindem/ospf-sr-algo-vulnerability
ospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV
2024-09-18 18:55:47 -05:00
Enke Chen
4b138bdd00 bgpd: define val in ecommunity_val as uint8_t
The type of the val field in ecommunity_val is used inconsistently
in a number of places. It should be defined as uint8_t.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2024-09-18 12:28:03 -07:00
Mark Stapp
f07579254a
Merge pull request #16857 from donaldsharp/logger_warning
tests: use logger.warning not logger.warn
2024-09-18 14:52:41 -04:00
Acee Lindem
0dc969185f ospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV
When parsing the SR-Algorithm TLV in the OSPF Router Information Opaque
LSA, assure that not more than the maximum number of supported
algorithms are copied from the TLV.

Signed-off-by: Acee Lindem <acee@lindem.com>
2024-09-18 18:09:19 +00:00
Jafar Al-Gharaibeh
31c015195d
Merge pull request #16846 from donaldsharp/zebra_evpn_mac_cleanup
Zebra evpn mac cleanup
2024-09-18 13:04:01 -05:00
Mark Stapp
05481607a1 bgpd: cancel events once in peer_free()
Don't need to cancel scheduled events twice in a row - just
once.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-09-18 13:38:00 -04:00
Jafar Al-Gharaibeh
5ae0b26220
Merge pull request #16856 from donaldsharp/ospf_vrf_debugs
ospfd: Add vrf name to debug functions in ospf_zebra.c
2024-09-18 11:26:50 -05:00
Donald Sharp
5634307f3a
Merge pull request #16841 from mjstapp/fix_bgp_script
bgpd: remove bgpd.h from bgp script header
2024-09-18 12:00:06 -04:00
Donald Sharp
8b25888ce8
Merge pull request #16816 from opensourcerouting/feature/bgp_dual_as
bgpd: Implement BGP dual-as feature
2024-09-18 11:59:16 -04:00
Donald Sharp
3d3c0e35eb tests: use logger.warning not logger.warn
Apparently logger.warn is being deprecated.  So let's
switch over to logger.warning.  Clearly it's better

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-18 11:56:42 -04:00
Donald Sharp
ffa0fd5c43 bgpd: Fixup crash when leaking from default vrf for mpls vpn's
When we get a update on a route that we already have information on
from another router and that route has been leaked ensure that
we do not crash when trying to releak the code when we may want
to modify the as path.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-18 18:03:10 +03:00
Don Slice
dc4440bdb2 bgpd: copy asn for prefixes imported as type5 from a vrf
When a prefix in a vrf is imported into evpn as a type5,
copy the asn of the source to make sure it is reflected
in the target vrf.

Ticket: cumuluslinux-2554562
Signed-off-by: Don Slice <dslice@nvidia.com>
2024-09-18 18:03:10 +03:00
Don Slice
d4426b62d2 bgpd: copy source vrf ASN to leaked route and block loops
When we leak routes and are using a different ASN in the
source vrf from the target vrf, it's possible we could
create loops because of an incomplete as-path (missing
the source vrf ASN). This fix adds the source vrf ASN and
stops the importing of a BGP prefix that has the target
ASN in the as-path in the source vrf.

Signed-off-by: Don Slice <dslice@nvidia.com>
2024-09-18 18:03:10 +03:00
Don Slice
091abc6b28 bgpd: do not allow override ASN unless hidden or auto-created
While it's okay to allow overwriting the ASN of a bgp vrf/instance
that is either hidden or automatically created, it's dangerous to
allow it on explicitly defined instances.  If that were allowed,
a typo entering the bgp config could take down existing peering,
which would be a bad thing.

Signed-off-by: Don Slice <dslice@nvidia.com>
2024-09-18 18:03:10 +03:00
Don Slice
4d0e7a49cf bgpd: VRF-Lite fix default bgp delete
1. bgp coredump is observed when we delete default bgp instance
   when we have multi-vrf; and route-leaking is enabled between
   default, non-default vrfs.
Removing default router bgp when routes leaked between non-default vrfs.
- Routes are leaked from VRF-A to VRF-B
- VPN table is created with auto RD/RT in default instance.
- Default instance is deleted, we try to unimport the routes from all VRFs
- non-default VRF schedules a work-queue to process deleted routes.
- Meanwhile default bgp instance clears VPN tables and free the route
  entries as well, which are still referenced by non-default VRFs which
  have imported routes.
- When work queue process starts to delete imported route in VRF-A it cores
  as it accesses freed memory.

- Whenever we delete bgp in default vrf, we skip deleting routes in the vpn
  table, import and export lists.
- The default hidden bgp instance will not be listed in any of the show
  commands.
- Whenever we create new default instance, handle it with AS number change
  i.e. old hidden default bgp's AS number is updated and also changing
  local_as for all peers.

2. A default instance is created with ASN of the vrf with the import
  statement.
  This may not be the ASN desired for the default table
- First problem with current behavior.
  Define two vrfs with different ASNs and then add import between.
  starting without any bgp config (no default instance)
  A default instance is created with ASN of the vrf with the import
  statement.
  This may not be the ASN desired for the default table
- Second related problem.  Start with a default instance and a vrf in a
  different ASN. Do an import statement in the vrf for a bgp vrf instance
  not yet defined and it auto-creates that bgp/vrf instance and it inherits
  the ASN of the importing vrf
- Handle bgp instances with different ASNs and handle ASN for auto created
  BGP instance

Signed-off-by: Kantesh Mundaragi <kmundaragi@vmware.com>
2024-09-18 18:03:10 +03:00
Russ White
6109043c54
Merge pull request #16720 from opensourcerouting/fix/default_originate_not_needed_if_not_enabled
bgpd: Do not scan update-groups if default-originate timer is set to 0
2024-09-18 10:11:23 -04:00
Donald Sharp
9f149fabd4 ospfd: Add vrf name to debug functions in ospf_zebra.c
This file had a bunch of debugs that were operating on
specific vrf's but not telling you which vrf this was
happening in.  Add code to allow operator debugging
to understand what vrf is being worked on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-18 09:52:49 -04:00
Donald Sharp
1af0a67401 zebra: In zebra_evpn_mac.c remove bad comments
Adding comments that tell what a variable is doing in
the middle of a function call makes it extremely hard
to read the formatting.  Remove.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-18 07:35:54 -04:00
Donald Sharp
03a7ab10fe zebra: Reindent some badly formatted functions in zebra_evpn_mac.c
Fix some badly formatted code to fit better on the screen.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-18 07:33:17 -04:00
Donald Sharp
390406973c zebra: Reframe zebra_evpn_mac.c to be properly formatted
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-18 07:33:17 -04:00
Donald Sharp
d1af3910b6
Merge pull request #16849 from opensourcerouting/fix/remove_rpki_cmd
bgpd: Remove deprecated RPKI command
2024-09-18 07:27:18 -04:00