Commit graph

37295 commits

Author SHA1 Message Date
anlan_cs 44a82da405 zebra: fix missing kernel routes
The `rib_update_handle_kernel_route_down_possibility()` didn't consider
the kernel routes ( blackhole )  without interface.  When some other
interfaces are down, these kernel routes will be wrongly removed.

Signed-off-by: anlan_cs <anlan_cs@126.com>
2024-10-31 22:45:16 +08:00
Donald Sharp d14dbdb897 bgpd: Move RFC 8212 check for inbound before filter in bgp_update
Currently the code to check to see if any input filters are
applicable is *before* the RFC 8212 check to see if we have
any filters at all.  As such we have already tested for this,
so let's move this check for RFC 8212 to immediately before
the input filter test.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-31 10:35:01 -04:00
Donald Sharp 5592aecefd bgpd: Convert rcvd_attr_printed to a bool
No need for a integer to store this, use a bool

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-31 10:35:01 -04:00
Donald Sharp c6400ca256 bgpd: Refactor bgp_update some for nexthop reachability
The nexthop reachability code was cut-n-pasted 2 times
with just a tiny bit of difference.  If we ever change
that it becomes `fun` to keep them in sync.  Since this
is more important than full on speed of code let's abstract
and get bgp_update() to be a bit easier to maintain.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-31 10:35:01 -04:00
Donald Sharp e3519b3400 bgpd: In bgp_update() for mac addrs ensure we are dealing with evpn
The code is just arbitrarily checking to see if there are any
mac addresses associated with a prefix.  This makes no
sense from the perspective that it can only happen as
an evpn route.  Let's not make non-evpn people pay
the price to check this data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-31 10:35:01 -04:00
Donald Sharp fb78a9b66b bgpd: In bgp_update try to optimize is_loop_check variable
The variable is_loop_check is being set and then later
we test against it multiple times.  Move the setting
of whether or not to check for as loops to where it
is tested against and stop testing it multiple times.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-31 10:35:00 -04:00
Donald Sharp d9fd4901f0 bgpd: Only set bgp_labels in bgp_update if we have num_labels
In the interest of speeding up code, there is no point in
attempting to see if a label is usable if the number of labels
passed in is 0.  Since that is a much much quicker test than
the bgp_is_valid_label() call, let's test that first.

Additionally, there is no point in walking the label[] array
passed in unless we are in the if statement, so move it inside.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-31 10:35:00 -04:00
Donald Sharp 852e6c327d bgpd: allowas_in and aspath_loop_count only used in one if statement
In bgp_update(), the two variables allowas_in and aspath_loop_count
are only used when peer->change_local_as is true.  Move the retrieval
of the allowas_in data to inside the if statement to save some
(very) small amount of time in bgp_update not gathering this
data unless the particular peer has this set.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-31 10:35:00 -04:00
Donald Sharp 1cb6b71b40 lib, tests: Remove in6addr_cmp function from the system
This function should just be memcmp.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-31 10:04:19 -04:00
Donald Sharp 7ebda3892c lib: Replace usage of in6addr_cmp with memcmp
memcmp will return and act exactly the same as in6addr_cmp
but it does it significantly faster than how in6addr_cmp
does it.  Let this be a lesson for implementing something
that is a duplicate of what is provided by the c library.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-31 10:04:19 -04:00
Jafar Al-Gharaibeh 35dbbacc3b
Merge pull request #17317 from opensourcerouting/feature/allow_setting_custom_params_for_daemons_unified_config
tests: Add an ability to specify daemon params with unified config
2024-10-31 08:55:23 -05:00
Mark Stapp 87941fa261
Merge pull request #17318 from opensourcerouting/fix/add_missing_new_line_for_zebra_help
zebra: Add missing new line for help string
2024-10-31 09:13:56 -04:00
Nathan Bahr 180e1a0d77 tests: Add zebra rib import-table tests
Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-10-31 12:44:05 +00:00
Donatas Abraitis 1073e0f9b3 ospfd: Use router_id what Zebra has if we remove a static router_id
If we set router-id, e.g. `router-id x.x.x.x`, then we have:

```
pc.donatas.net# show ip ospf | include Router ID
 OSPF Routing Process, Router ID: x.x.x.x
```

But once we remove it (`no router-id x.x.x.x`), the old router-id remains.

This is kinda OK, but to be consistent with OSPFv3 we should use what Zebra
already has, instead of retaining the old one.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-31 11:38:40 +02:00
Donatas Abraitis 80bfe6784f ospfd: Add a hidden command for old no router-id
A new command is `ospf router-id ...`, but the old one is also valid. Just a no
form was missed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-31 11:37:49 +02:00
Donatas Abraitis 25ae643996 zebra: Add missing new line for help string
```
  -A, --asic-offload        FRR is interacting with an asic underneath the linux kernel
      --v6-with-v4-nexthops Underlying dataplane supports v6 routes with v4 nexthops  -s, --nl-bufsize          Set netlink receive buffer size
```

Fixes: 1f5611c06d ("zebra: Allow zebra cli to accept v6 routes with v4 nexthops")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-31 10:47:48 +02:00
Donatas Abraitis 879466731b tests: Add an ability to specify daemon params with unified config
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-31 10:43:28 +02:00
Donatas Abraitis 5f11235614
Merge pull request #17296 from LabNConsulting/liambrady/core-rlimit-respect-hard-limit
tests: respect RLIMIT_CORE hard limit
2024-10-31 10:19:55 +02:00
Piotr Jurkiewicz 15e1a133d0 debian: Add missing libprotobuf-dev to grpc build profile
Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
2024-10-30 23:02:48 +01:00
Jafar Al-Gharaibeh 7c1034087e
Merge pull request #17310 from opensourcerouting/fix/doc_build
doc: Create html_context before setting READTHEDOCS
2024-10-30 13:13:34 -05:00
Jafar Al-Gharaibeh e2f3cfa518
Merge pull request #17311 from opensourcerouting/fix/syntax_topotests
doc: Use RST, not Markdown format for links
2024-10-30 12:49:43 -05:00
Donatas Abraitis 9397a5144b doc: Use RST, not Markdown format for links
Fixes: d155d62785 ("doc: Require unified config for all new topotests")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-30 14:26:07 +02:00
Donatas Abraitis ef9f698e04 doc: Create html_context before setting READTHEDOCS
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/frrouting/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 529, in eval_config_file
    exec(code, namespace)  # NoQA: S102
    ^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/frrouting/checkouts/latest/doc/user/conf.py", line 77, in <module>
    html_context["READTHEDOCS"] = True
    ^^^^^^^^^^^^
NameError: name 'html_context' is not defined

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-30 14:15:36 +02:00
Russ White 56d994aeca
Merge pull request #15563 from donaldsharp/bgp_musings
Bgp musings
2024-10-30 06:04:45 -04:00
Donatas Abraitis 4c1ee29116 bgpd: Treat numbered community-list only if it's in a range 1-500
Before this patch, if we set something like:

```
bgp extcommunity-list expanded 1234 permit admin
```

In running config we have:

```
bgp extcommunity-list 1234 seq 5 permit admin
```

That leads to incorrect rendering, even more the line can't be deleted.

With this fix we treat numbered community-list only if it's inside the range
1-500, otherwise it's a non-numbered clist.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-30 10:45:28 +02:00
Nathan Bahr 1c50a553fc doc: Document zebra table import command with additional mrib flag
Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-10-29 20:17:59 +00:00
Nathan Bahr be2a7ed6af zebra: Add ability to import alternate tables into the MRIB
Expanded the cli command to include an mrib flag for importing to
the main table MRIB instead of the main table URIB.
Piped through specifying the safi through the import table functions
rather than hardcoding to SAFI_UNICAST.
Import still only import routes from the URIB subtable, only added the
ability to import into the main table MRIB.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2024-10-29 20:17:59 +00:00
Donald Sharp 5f6200d334 zebra: Deconfuse clang-sa about possible NULL pointer
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-29 16:05:15 -04:00
Donald Sharp 07e9004c62 bgpd: workaround clang-sa for set but not used value
Our switch statements with a default value confuse
clang-sa 19.  Make it happy.  Just following David's
earlier commit.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-29 16:03:45 -04:00
Donald Sharp 1115feedc3 bgpd: add some counters not displayed yet
Add some counters to keep track how often stuff is done.
This is mainly for us developers.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-29 14:11:06 -04:00
Donald Sharp e2090bf4c6 bgpd: Further extend show bgp attribute-info
Fill out a bit more data about what is being held.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-29 14:11:06 -04:00
Donald Sharp a7f223636f bgpd: Optimize the usage of jhash
There are a bunch of jhash_1word uses.  Let's convert
to jhash_3word and get rid of some calls.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-29 14:11:06 -04:00
Mark Stapp b7263c0548 zebra: remove if_table from the zebra NS
Finish removing the if_table from the zebra NS struct.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-10-29 13:49:43 -04:00
Mark Stapp 8353cf5d4c zebra: use new per-NS ifp iterators in vxlan code
Replace use of the old if_table with the new per-NS ifp
iterator apis in the zebra vxlan code.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-10-29 13:49:43 -04:00
Mark Stapp c1160538ea lib,zebra: remove table node from ifp struct
Finish removing the table route_node from the ifp struct.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-10-29 13:49:43 -04:00
Joshua Muthii 5718ee37c7 nhrpd: Modify NHRP authentication feature logging
Modified nhrp_connection_authorized(). Initially, when writing debug
information about incoming NHRP packets with authentication enabled,
the nhrp_connection_authorized() function would print the
passphrase of the incoming packet as if it were a null terminated
string. This meant that if the passphrase on the incoming packet
had non ASCII-complient bytes in it, it would attempt to print those
bytes anyway. There was also no check that the size of the passphrase in
the incoming packet matched the size of the passphrase on the interface.
The changes in this commit log the passphrase on the incoming packet as
well as the passphrase on interface in HEX to avoid issues with ASCII.
It also performs a check that accounts for the sizes of the two different
passphrases

Moved CISCO_PASS_LENGTH_LEN from nhrp_vty.c to nhrp_protocol.h
for easier access  to the macro in other files

Signed-off-by: Joshua Muthii <jmuthii@labn.net>
2024-10-29 13:15:43 -04:00
Joshua Muthii d599aa1da6 nhrpd: Add topotest for retrying resolution request
Modified nhrp_topo topotest to test for newly added resolution
request retry feature. Changes to the topotest include adding a spoke to the
existing nhrp_topo topotest so that a topology with two spokes and hub
can be used to create shortcuts and test the sending/resending of
resolution requests and responses between spoke and hub. The resolution
request retry feature was tested by blocking incoming resolution requests on a
receiving nodes to stop the creation of a successful shortcut - which
then triggered the sending spoke to retry sending resolution requests

Signed-off-by: Joshua Muthii <jmuthii@labn.net>
2024-10-29 13:15:16 -04:00
Liam Brady b4dc01b3de tests: respect RLIMIT_CORE hard limit
In the case that the RLIMIT_CORE hard limit cannot
be raised on a system, do not fail due to an exception.
Instead, attempt to increase the soft limit to as large
a value as possible (e.g. to the set hard limit).

Signed-off-by: Liam Brady <lbrady@labn.net>
2024-10-29 13:07:57 -04:00
Russ White 56495a88df
Merge pull request #17251 from donaldsharp/bgp_best_path_evpn_issue
bgpd: bestpath failure when you have a singlepath not in holddown
2024-10-29 10:16:37 -04:00
Russ White 574a71516a
Merge pull request #17226 from louis-6wind/fix-bmp-tests
tests: fix bmp tests random failure
2024-10-29 10:12:11 -04:00
Russ White b5c3b44de1
Merge pull request #17190 from baozhen-H3C/202410180176
isisd: The command "'show isis vrf all summary json" has no output.
2024-10-29 10:08:28 -04:00
Russ White 4a6e1c0acb
Merge pull request #16990 from lsang6WIND/label-per-nexthop
bgpd: fix prefix same as nexthop in label per nexthop
2024-10-29 10:05:37 -04:00
Donatas Abraitis e42dd44123
Merge pull request #17245 from fdumontet6WIND/fix1
bgpd:  fix crash when polling bgp4v2PathAttrTable
2024-10-29 14:12:05 +02:00
Donatas Abraitis e534d9cc7b
Merge pull request #17278 from pguibert6WIND/bmp_listener
bgpd: fix blank line in running-config with bmp listener cmd
2024-10-29 10:57:05 +02:00
Donatas Abraitis cf6a575cbd
Merge pull request #17189 from Shbinging/fix_some_ospf_unset_commands_syntax
ospfd:fix syntax of some ospf no commands
2024-10-29 10:43:53 +02:00
Donatas Abraitis 60f77de79d
Merge pull request #17257 from pguibert6WIND/srv6_debug
zebra: add 'debug zebra srv6' command
2024-10-29 10:32:20 +02:00
Jafar Al-Gharaibeh 2945258c7c
Merge pull request #17254 from donaldsharp/mrib_nht_wonky
Mrib nht wonky
2024-10-28 16:20:20 -05:00
Donald Sharp 3bff65abc7 zebra: When installing a mroute, allow it to flow
Currently the mroute code was not allowing the mroute
to be sent to the dataplane.  This leaves us with a
situation where the routes being installed where never
being set as installed and additionally nht against
the mrib would not work if the route came into existence
after the nexthop tracking was asked for.

Turns out all the pieces where there to let this work.
Modify the code to pass it to the dplane and to send
it back up as having worked.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-28 15:02:39 -04:00
Mark Stapp 2b05d34a00 zebra: use new per-NS iteration in zebra_evpn
Use the new per-NS interface iteration apis in the evpn
module.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-10-28 14:54:06 -04:00
Mark Stapp d349877aa5 zebra: removing use of per-NS if_table
Remove use of the per-NS if_table from zebra/interface
module. Use new add, lookup, and iteration apis.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-10-28 14:54:06 -04:00