]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
5 months agobgpd: Remove call into event_master_free_unused
Donald Sharp [Mon, 28 Oct 2024 21:51:04 +0000 (17:51 -0400)]
bgpd: Remove call into event_master_free_unused

This call was originally put into place to help reduce
memory problems associated with bgp having a bajillion
events under load and then we would have a bunch of events
ready to be used on the unused list.  In the meantime
code was put into place that limited the depth of the
unused list to 10 elements.  This call has now become
unnecessary.  Let's just remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agoMerge pull request #17281 from nabahr/mrib-import
Donald Sharp [Thu, 31 Oct 2024 17:28:57 +0000 (13:28 -0400)]
Merge pull request #17281 from nabahr/mrib-import

Add support to import alternate URIB tables into the main MRIB

5 months agoMerge pull request #17317 from opensourcerouting/feature/allow_setting_custom_params_...
Jafar Al-Gharaibeh [Thu, 31 Oct 2024 13:55:23 +0000 (08:55 -0500)]
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

5 months agoMerge pull request #17318 from opensourcerouting/fix/add_missing_new_line_for_zebra_help
Mark Stapp [Thu, 31 Oct 2024 13:13:56 +0000 (09:13 -0400)]
Merge pull request #17318 from opensourcerouting/fix/add_missing_new_line_for_zebra_help

zebra: Add missing new line for help string

5 months agotests: Add zebra rib import-table tests 17281/head
Nathan Bahr [Tue, 29 Oct 2024 15:06:36 +0000 (15:06 +0000)]
tests: Add zebra rib import-table tests

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
5 months agozebra: Add missing new line for help string 17318/head
Donatas Abraitis [Thu, 31 Oct 2024 08:47:48 +0000 (10:47 +0200)]
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: 1f5611c06d1c243b42279748788f0627793ead9c ("zebra: Allow zebra cli to accept v6 routes with v4 nexthops")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agotests: Add an ability to specify daemon params with unified config 17317/head
Donatas Abraitis [Thu, 31 Oct 2024 08:43:28 +0000 (10:43 +0200)]
tests: Add an ability to specify daemon params with unified config

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agoMerge pull request #17296 from LabNConsulting/liambrady/core-rlimit-respect-hard...
Donatas Abraitis [Thu, 31 Oct 2024 08:19:55 +0000 (10:19 +0200)]
Merge pull request #17296 from LabNConsulting/liambrady/core-rlimit-respect-hard-limit

tests: respect RLIMIT_CORE hard limit

5 months agoMerge pull request #17310 from opensourcerouting/fix/doc_build
Jafar Al-Gharaibeh [Wed, 30 Oct 2024 18:13:34 +0000 (13:13 -0500)]
Merge pull request #17310 from opensourcerouting/fix/doc_build

doc: Create html_context before setting READTHEDOCS

5 months agoMerge pull request #17311 from opensourcerouting/fix/syntax_topotests
Jafar Al-Gharaibeh [Wed, 30 Oct 2024 17:49:43 +0000 (12:49 -0500)]
Merge pull request #17311 from opensourcerouting/fix/syntax_topotests

doc: Use RST, not Markdown format for links

5 months agodoc: Use RST, not Markdown format for links 17311/head
Donatas Abraitis [Wed, 30 Oct 2024 12:26:07 +0000 (14:26 +0200)]
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>
5 months agodoc: Create html_context before setting READTHEDOCS 17310/head
Donatas Abraitis [Wed, 30 Oct 2024 12:15:36 +0000 (14:15 +0200)]
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>
5 months agoMerge pull request #15563 from donaldsharp/bgp_musings
Russ White [Wed, 30 Oct 2024 10:04:45 +0000 (06:04 -0400)]
Merge pull request #15563 from donaldsharp/bgp_musings

Bgp musings

5 months agodoc: Document zebra table import command with additional mrib flag
Nathan Bahr [Tue, 29 Oct 2024 03:40:55 +0000 (03:40 +0000)]
doc: Document zebra table import command with additional mrib flag

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
5 months agozebra: Add ability to import alternate tables into the MRIB
Nathan Bahr [Mon, 28 Oct 2024 18:55:49 +0000 (18:55 +0000)]
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>
6 months agobgpd: add some counters not displayed yet 15563/head
Donald Sharp [Sat, 4 Nov 2023 03:26:56 +0000 (23:26 -0400)]
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>
6 months agobgpd: Further extend `show bgp attribute-info`
Donald Sharp [Sat, 16 Mar 2024 01:08:43 +0000 (21:08 -0400)]
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>
6 months agobgpd: Optimize the usage of jhash
Donald Sharp [Sat, 16 Mar 2024 00:42:39 +0000 (20:42 -0400)]
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>
6 months agotests: respect RLIMIT_CORE hard limit 17296/head
Liam Brady [Tue, 29 Oct 2024 12:50:17 +0000 (08:50 -0400)]
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>
6 months agoMerge pull request #17251 from donaldsharp/bgp_best_path_evpn_issue
Russ White [Tue, 29 Oct 2024 14:16:37 +0000 (10:16 -0400)]
Merge pull request #17251 from donaldsharp/bgp_best_path_evpn_issue

bgpd: bestpath failure when you have a singlepath not in holddown

6 months agoMerge pull request #17226 from louis-6wind/fix-bmp-tests
Russ White [Tue, 29 Oct 2024 14:12:11 +0000 (10:12 -0400)]
Merge pull request #17226 from louis-6wind/fix-bmp-tests

tests: fix bmp tests random failure

6 months agoMerge pull request #17190 from baozhen-H3C/202410180176
Russ White [Tue, 29 Oct 2024 14:08:28 +0000 (10:08 -0400)]
Merge pull request #17190 from baozhen-H3C/202410180176

isisd: The command "'show isis vrf all summary json" has no output.

6 months agoMerge pull request #16990 from lsang6WIND/label-per-nexthop
Russ White [Tue, 29 Oct 2024 14:05:37 +0000 (10:05 -0400)]
Merge pull request #16990 from lsang6WIND/label-per-nexthop

bgpd: fix prefix same as nexthop in label per nexthop

6 months agoMerge pull request #17245 from fdumontet6WIND/fix1
Donatas Abraitis [Tue, 29 Oct 2024 12:12:05 +0000 (14:12 +0200)]
Merge pull request #17245 from fdumontet6WIND/fix1

bgpd:  fix crash when polling bgp4v2PathAttrTable

6 months agoMerge pull request #17278 from pguibert6WIND/bmp_listener
Donatas Abraitis [Tue, 29 Oct 2024 08:57:05 +0000 (10:57 +0200)]
Merge pull request #17278 from pguibert6WIND/bmp_listener

bgpd: fix blank line in running-config with bmp listener cmd

6 months agoMerge pull request #17189 from Shbinging/fix_some_ospf_unset_commands_syntax
Donatas Abraitis [Tue, 29 Oct 2024 08:43:53 +0000 (10:43 +0200)]
Merge pull request #17189 from Shbinging/fix_some_ospf_unset_commands_syntax

ospfd:fix syntax of some ospf no commands

6 months agoMerge pull request #17257 from pguibert6WIND/srv6_debug
Donatas Abraitis [Tue, 29 Oct 2024 08:32:20 +0000 (10:32 +0200)]
Merge pull request #17257 from pguibert6WIND/srv6_debug

zebra: add 'debug zebra srv6' command

6 months agoMerge pull request #17254 from donaldsharp/mrib_nht_wonky
Jafar Al-Gharaibeh [Mon, 28 Oct 2024 21:20:20 +0000 (16:20 -0500)]
Merge pull request #17254 from donaldsharp/mrib_nht_wonky

Mrib nht wonky

6 months agozebra: When installing a mroute, allow it to flow 17254/head
Donald Sharp [Sat, 26 Oct 2024 01:56:14 +0000 (21:56 -0400)]
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>
6 months agozebra: Add safi to some debugs
Donald Sharp [Fri, 25 Oct 2024 19:44:34 +0000 (15:44 -0400)]
zebra: Add safi to some debugs

Trying to figure out what safi we are talking about is fun when
it is not put into the debugs.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agosharpd: Allow sharpd to watch nexthops in the mrib
Donald Sharp [Sat, 26 Oct 2024 01:21:32 +0000 (21:21 -0400)]
sharpd: Allow sharpd to watch nexthops in the mrib

Nothing special here, just allow sharpd to ask to watch
nexthops in the mrib.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agoMerge pull request #17200 from opensourcerouting/vtysh-fix-list-find
Donald Sharp [Mon, 28 Oct 2024 18:05:29 +0000 (14:05 -0400)]
Merge pull request #17200 from opensourcerouting/vtysh-fix-list-find

vtysh: fix `find` and `list` commands

6 months agobgpd: fix blank line in running-config with bmp listener cmd 17278/head
Philippe Guibert [Mon, 28 Oct 2024 15:04:45 +0000 (16:04 +0100)]
bgpd: fix blank line in running-config with bmp listener cmd

An extra blank line is added in show running-config with BMP:

> ubuntu2204hwe(config)# router bgp 65500
> ubuntu2204hwe(config-router)# bmp targets tgt
> ubuntu2204hwe(config-bgp-bmp)# bmp monitor ipv4 unicast pre-policy
> ubuntu2204hwe(config-bgp-bmp)# bmp listener 192.0.2.100 port 44
> ubuntu2204hwe(config-bgp-bmp)# do show running-config
>
> router bgp 65500
> [..]
>  bmp targets tgt
>   bmp monitor ipv4 unicast pre-policy
>                                       <-- blank line
>   bmp listener 192.0.2.100 port 44
>  exit

Remove the blank line.

Fixes: ed18356f1f2d ("bgpd/bmp: BMP implementation")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 months agozebra: add 'debug zebra srv6' command 17257/head
Philippe Guibert [Tue, 8 Oct 2024 07:32:37 +0000 (09:32 +0200)]
zebra: add 'debug zebra srv6' command

Add a specific debug command to handle srv6 troubleshooting.
Move the srv6 traces that initially were under 'debug zebra packet'
debug.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 months agoMerge pull request #17243 from louis-6wind/fix-bgp-local-label
Donatas Abraitis [Mon, 28 Oct 2024 14:33:50 +0000 (16:33 +0200)]
Merge pull request #17243 from louis-6wind/fix-bgp-local-label

bgpd: fix display of local label in show bgp

6 months agoMerge pull request #16354 from Sokolmish/zebra-no-ra
David Lamparter [Mon, 28 Oct 2024 12:28:29 +0000 (13:28 +0100)]
Merge pull request #16354 from Sokolmish/zebra-no-ra

6 months agoMerge pull request #17250 from pguibert6WIND/flexalgo_uint8
Donatas Abraitis [Mon, 28 Oct 2024 10:30:46 +0000 (12:30 +0200)]
Merge pull request #17250 from pguibert6WIND/flexalgo_uint8

isisd: fix change flex-algorithm number from uint32 to uint8

6 months agoMerge pull request #17160 from opensourcerouting/fix/keep_zebra_on-rib-process_in_frr...
Jafar Al-Gharaibeh [Sun, 27 Oct 2024 23:23:36 +0000 (18:23 -0500)]
Merge pull request #17160 from opensourcerouting/fix/keep_zebra_on-rib-process_in_frr.conf

lib, zebra: Keep `zebra on-rib-process script` in frr.conf

6 months agoMerge pull request #17216 from Jafaral/fix-bsr
Donatas Abraitis [Sun, 27 Oct 2024 19:11:23 +0000 (21:11 +0200)]
Merge pull request #17216 from Jafaral/fix-bsr

pimd, tests: fix bsr assert and expand topotest to pimv6

6 months agoMerge pull request #17255 from systemcrash/patch-1
Donald Sharp [Sun, 27 Oct 2024 00:38:26 +0000 (20:38 -0400)]
Merge pull request #17255 from systemcrash/patch-1

docs: Update evpn.rst

6 months agodocs: Update evpn.rst 17255/head
Paul Donald [Sat, 26 Oct 2024 12:23:57 +0000 (14:23 +0200)]
docs: Update evpn.rst

spelling

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
6 months agobgpd: bestpath failure when you have a singlepath not in holddown 17251/head
Donald Sharp [Fri, 25 Oct 2024 21:17:53 +0000 (17:17 -0400)]
bgpd: bestpath failure when you have a singlepath not in holddown

When you have multiple paths to a particular route and a single
path changes.  In addition of the other paths are either in
hold down or not established or really just not selected you
could end up with a situation where the bestpath choosen
was a path that was in hold down.

Modify the code such that when there is nothing worse
in bestpath selection for the choosen path, but were
unable to do any sorting, just put the path on the top
of the list and declare it the winner.  Else just
do the original and put it at the end.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agobgpd: fix crash when polling bgp4v2PathAttrTable 17245/head
Francois Dumontet [Mon, 21 Oct 2024 10:49:50 +0000 (12:49 +0200)]
bgpd:  fix crash when polling bgp4v2PathAttrTable

we have

(gdb) p *path->attr->aspath
$1 = {refcnt = 3, segments = 0x0, json = 0x0, str = 0x55723d0b7470 "", str_len = 0, asnotation = ASNOTATION_PLAIN}

It looks like this aspath is empty, resulting in a size 0 and NULL pointer for path->attr->aspath->segments which leads to the SIGSEGV

fixe: return 0 when segments is null.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
6 months agoisisd: fix change flex-algorithm number from uint32 to uint8 17250/head
Philippe Guibert [Fri, 25 Oct 2024 08:23:54 +0000 (10:23 +0200)]
isisd: fix change flex-algorithm number from uint32 to uint8

The algorithm number is encoded on 8 bits and does not require
an unsigned 32 bit value to store the value.

Fixes: cc4926c1284e ("isisd,yang: add algorithm-prefix-sid configuration tree")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 months agobgpd: fix display of local label in show bgp 17243/head
Louis Scalbert [Fri, 25 Oct 2024 15:54:07 +0000 (17:54 +0200)]
bgpd: fix display of local label in show bgp

Fix the display of the local label in show bgp.

> r1# show bgp ipv4 labeled-unicast 172.16.2.2/32
> BGP routing table entry for 172.16.2.2/32, version 2
> Local label: 16 <---- MISSING
> Paths: (1 available, best #1, table default, vrf (null))
>   Advertised to non peer-group peers:
>  192.168.1.2
>  65501
>    192.168.1.2 from 192.168.1.2 (172.16.2.2)
>      Origin IGP, metric 0, valid, external, best (First path received)
>      Remote label: 3
>      Last update: Fri Oct 25 17:55:45 2024

Fixes: 67f67ba481 ("bgpd: Drop label_ntop/label_pton functions")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agotests: expand bsr topotest to cover ipv6 17216/head
Jafar Al-Gharaibeh [Wed, 23 Oct 2024 05:09:06 +0000 (00:09 -0500)]
tests: expand bsr topotest to cover ipv6

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
6 months agopimd: allow a bsr with higher priority to take over
Jafar Al-Gharaibeh [Wed, 23 Oct 2024 19:14:58 +0000 (14:14 -0500)]
pimd: allow a bsr with higher priority to take over

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
6 months agopimd: allow resolving bsr via directly connected secondary address
Jafar Al-Gharaibeh [Wed, 23 Oct 2024 04:09:53 +0000 (23:09 -0500)]
pimd: allow resolving bsr via directly connected secondary address

This only matters to single hop nodes that are adjacent to the bsr. More common
with IPv6 where LL address is used in PIM as the primary address. If the BSR IP
happens to be an address on the same interface, the receiving pim router
rejects the BSR address because it expects the BSR IP to resolve via the LL address
even if we have a connected route for the same BSR IP subnet. Effectively, we want to
allow rpf to be resolved via secondary IPs with connected routes on the same interface,
and not limit them to primary addresses.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
6 months agotests: fix bgp_bmp_vrf race condition 17226/head
Louis Scalbert [Thu, 24 Oct 2024 15:18:55 +0000 (17:18 +0200)]
tests: fix bgp_bmp_vrf race condition

The bgp_bmp_vrf topotest is randomly failing with similar messages:

> 2024-10-24 16:59:03,037 ERROR: topo: test failed at "bgp_bmp.test_bgp_bmp/test_bmp_bgp_unicast": Checking the updated prefixes has failed ! Generated JSON diff error report:
>
> $->pre-policy->update: expected has key '172.31.0.15/32' which is not present in output

It is particularly unsuccessful when run with valgrind:

> python3 -m pytest -vvss --valgrind-leak-kinds=all --valgrind-extra --valgrind-memleaks bgp_bmp_vrf

bgp_bmp_vrf is configuring a BMP policy on r1 and then some static BGP
prefixes on r2. If for some reasons, the BGP UPDATE arrives to r1 before
the BMP configuration is operational, the UPDATE is not sent to the BMP
server and the test fails.

Pre-configure the BMP policies at startup to avoid this race condition.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agotests: fix bgp_bmp race condition
Louis Scalbert [Thu, 24 Oct 2024 13:35:35 +0000 (15:35 +0200)]
tests: fix bgp_bmp race condition

The bgp_bmp topotest is randomly failing with similar messages:

> 2024-10-24 16:59:03,037 ERROR: topo: test failed at "bgp_bmp.test_bgp_bmp/test_bmp_bgp_unicast": Checking the updated prefixes has failed ! Generated JSON diff error report:
>
> $->pre-policy->update: expected has key '172.31.0.15/32' which is not present in output

It is particularly unsuccessful when run with valgrind:

> python3 -m pytest -vvss --valgrind-leak-kinds=all --valgrind-extra --valgrind-memleaks bgp_bmp

bgp_bmp is configuring a BMP policy on r1 and then some static BGP
prefixes on r2. If for some reasons, the BGP UPDATE arrives to r1 before
the BMP configuration is operational, the UPDATE is not sent to the BMP
server and the test fails.

Pre-configure the BMP policies at startup to avoid this race condition.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agotests: factorize code in bgp_bmp_vrf
Louis Scalbert [Thu, 24 Oct 2024 14:33:43 +0000 (16:33 +0200)]
tests: factorize code in bgp_bmp_vrf

Factorize code in bgp_bmp_vrf

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agotests: factorize code in bgp_bmp
Louis Scalbert [Thu, 24 Oct 2024 11:10:50 +0000 (13:10 +0200)]
tests: factorize code in bgp_bmp

Factorize code in bgp_bmp

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agotests: rework bgp_bmp_vrf
Louis Scalbert [Thu, 24 Oct 2024 14:16:19 +0000 (16:16 +0200)]
tests: rework bgp_bmp_vrf

The BGP BMP VRF topotest is difficult to debug. It does not say which
prefix is not received by BGP or BMP when it fails.

Rework the test to convert the actual BMP logs to JSON and compare the
BGP table and BMP server logs output to expected reference JSON files.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agotests: rework bgp_bmp
Louis Scalbert [Wed, 23 Oct 2024 13:17:00 +0000 (15:17 +0200)]
tests: rework bgp_bmp

The BGP BMP topotest is difficult to debug. It does not say which prefix
is not received by BGP or BMP when it fails.

Rework the test to convert the actual BMP logs to JSON and compare the
BGP table and BMP server logs output to expected reference JSON files.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agotests: augment bgp bmp test wait time
Louis Scalbert [Wed, 23 Oct 2024 10:57:27 +0000 (12:57 +0200)]
tests: augment bgp bmp test wait time

Augment bgp bmp test wait time

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agotopotests: supress bgp_vpnv4/6_per_nexthop_label warning 16990/head
Loïc Sang [Mon, 7 Oct 2024 13:00:45 +0000 (15:00 +0200)]
topotests: supress bgp_vpnv4/6_per_nexthop_label warning

WARNING: topo: Waiting time is too small
(count=10, wait=0.5), using default values (count=20, wait=3)

Supress warning by inscreasing wait time.

Signed-off-by: Loïc Sang <loic.sang@6wind.com>
6 months agobgpd: fix prefix same as nexthop in label per nexthop
Loïc Sang [Wed, 2 Oct 2024 12:47:18 +0000 (14:47 +0200)]
bgpd: fix prefix same as nexthop in label per nexthop

When a prefix is imported using the "network" command under a vrf, which
is a connected prefix, and in the context of label allocation per
nexthop:

..
>router bgp 1 vrf vrf1
> address-family ipv4 unicast
>  redistribute static
>  network 172.16.0.1/32  <--- connected network
>  network 192.168.106.0/29
>  label vpn export auto
>  label vpn export allocation-mode per-nexthop
..

We encounter an MPLS entry where the nexthop is the prefix itself:

> 18             BGP   172.16.0.1     -

Actually, when using the "network" command, a bnc context is used, but
it is filled by using the prefix itself instead of the nexthop for other
BGP updates. Consequently, when picking up the original nexthop for
label allocation, the function behaves incorrectly. Instead ensure that
the nexthop type of bnc->nexthop is not a nexthop_ifindex; otherwise
fallback to the per vrf label.

Update topotests.

Signed-off-by: Loïc Sang <loic.sang@6wind.com>
6 months agoMerge pull request #17199 from enkechen-panw/aigp-fix5
Donatas Abraitis [Fri, 25 Oct 2024 06:59:29 +0000 (09:59 +0300)]
Merge pull request #17199 from enkechen-panw/aigp-fix5

bgpd: compare aigp after local route check in bgp_path_info_cmp()

6 months agoMerge pull request #17207 from louis-6wind/bmpserver-log
Donatas Abraitis [Fri, 25 Oct 2024 06:58:57 +0000 (09:58 +0300)]
Merge pull request #17207 from louis-6wind/bmpserver-log

tests: add bmpserver logging

6 months agoMerge pull request #17229 from donaldsharp/bgp_update_optimizations
Donatas Abraitis [Fri, 25 Oct 2024 06:57:07 +0000 (09:57 +0300)]
Merge pull request #17229 from donaldsharp/bgp_update_optimizations

Optimizations and problem fixing for large scale ecmp from bgp

6 months agoMerge pull request #17215 from nabahr/autorp_no_path
Donatas Abraitis [Fri, 25 Oct 2024 06:05:16 +0000 (09:05 +0300)]
Merge pull request #17215 from nabahr/autorp_no_path

pimd: PIM autorp no path RP fix

6 months agoMerge pull request #17155 from opensourcerouting/memstats-zlog
Donald Sharp [Fri, 25 Oct 2024 01:07:09 +0000 (21:07 -0400)]
Merge pull request #17155 from opensourcerouting/memstats-zlog

lib: `debug memstats-at-exit` improvements

6 months agobgpd: Fix wrong pthread event cancelling 17229/head
Donald Sharp [Thu, 24 Oct 2024 21:44:31 +0000 (17:44 -0400)]
bgpd: Fix wrong pthread event cancelling

0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=130719886083648) at ./nptl/pthread_kill.c:44
1  __pthread_kill_internal (signo=6, threadid=130719886083648) at ./nptl/pthread_kill.c:78
2  __GI___pthread_kill (threadid=130719886083648, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
3  0x000076e399e42476 in __GI_raise (sig=6) at ../sysdeps/posix/raise.c:26
4  0x000076e39a34f950 in core_handler (signo=6, siginfo=0x76e3985fca30, context=0x76e3985fc900) at lib/sigevent.c:258
5  <signal handler called>
6  __pthread_kill_implementation (no_tid=0, signo=6, threadid=130719886083648) at ./nptl/pthread_kill.c:44
7  __pthread_kill_internal (signo=6, threadid=130719886083648) at ./nptl/pthread_kill.c:78
8  __GI___pthread_kill (threadid=130719886083648, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
9  0x000076e399e42476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
10 0x000076e399e287f3 in __GI_abort () at ./stdlib/abort.c:79
11 0x000076e39a39874b in _zlog_assert_failed (xref=0x76e39a46cca0 <_xref.27>, extra=0x0) at lib/zlog.c:789
12 0x000076e39a369dde in cancel_event_helper (m=0x5eda32df5e40, arg=0x5eda33afeed0, flags=1) at lib/event.c:1428
13 0x000076e39a369ef6 in event_cancel_event_ready (m=0x5eda32df5e40, arg=0x5eda33afeed0) at lib/event.c:1470
14 0x00005eda0a94a5b3 in bgp_stop (connection=0x5eda33afeed0) at bgpd/bgp_fsm.c:1355
15 0x00005eda0a94b4ae in bgp_stop_with_notify (connection=0x5eda33afeed0, code=8 '\b', sub_code=0 '\000') at bgpd/bgp_fsm.c:1610
16 0x00005eda0a979498 in bgp_packet_add (connection=0x5eda33afeed0, peer=0x5eda33b11800, s=0x76e3880daf90) at bgpd/bgp_packet.c:152
17 0x00005eda0a97a80f in bgp_keepalive_send (peer=0x5eda33b11800) at bgpd/bgp_packet.c:639
18 0x00005eda0a9511fd in peer_process (hb=0x5eda33c9ab80, arg=0x76e3985ffaf0) at bgpd/bgp_keepalives.c:111
19 0x000076e39a2cd8e6 in hash_iterate (hash=0x76e388000be0, func=0x5eda0a95105e <peer_process>, arg=0x76e3985ffaf0) at lib/hash.c:252
20 0x00005eda0a951679 in bgp_keepalives_start (arg=0x5eda3306af80) at bgpd/bgp_keepalives.c:214
21 0x000076e39a2c9932 in frr_pthread_inner (arg=0x5eda3306af80) at lib/frr_pthread.c:180
22 0x000076e399e94ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
23 0x000076e399f26850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb) f 12
12 0x000076e39a369dde in cancel_event_helper (m=0x5eda32df5e40, arg=0x5eda33afeed0, flags=1) at lib/event.c:1428
1428 assert(m->owner == pthread_self());

In this decode the attempt to cancel the connection's events from
the wrong thread is causing the crash.  Modify the code to create an
event on the bm->master to cancel the events for the connection.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agobgpd: Fix deadlock in bgp_keepalive and master pthreads
Donald Sharp [Thu, 24 Oct 2024 18:17:51 +0000 (14:17 -0400)]
bgpd: Fix deadlock in bgp_keepalive and master pthreads

(gdb) bt
0  futex_wait (private=0, expected=2, futex_word=0x5c438e9a98d8) at ../sysdeps/nptl/futex-internal.h:146
1  __GI___lll_lock_wait (futex=futex@entry=0x5c438e9a98d8, private=0) at ./nptl/lowlevellock.c:49
2  0x00007af16d698002 in lll_mutex_lock_optimized (mutex=0x5c438e9a98d8) at ./nptl/pthread_mutex_lock.c:48
3  ___pthread_mutex_lock (mutex=0x5c438e9a98d8) at ./nptl/pthread_mutex_lock.c:93
4  0x00005c4369c17e70 in _frr_mtx_lock (mutex=0x5c438e9a98d8, func=0x5c4369dc2750 <__func__.265> "bgp_notify_send_internal") at ./lib/frr_pthread.h:258
5  0x00005c4369c1a07a in bgp_notify_send_internal (connection=0x5c438e9a98c0, code=8 '\b', sub_code=0 '\000', data=0x0, datalen=0, use_curr=true) at bgpd/bgp_packet.c:928
6  0x00005c4369c1a707 in bgp_notify_send (connection=0x5c438e9a98c0, code=8 '\b', sub_code=0 '\000') at bgpd/bgp_packet.c:1069
7  0x00005c4369bea422 in bgp_stop_with_notify (connection=0x5c438e9a98c0, code=8 '\b', sub_code=0 '\000') at bgpd/bgp_fsm.c:1597
8  0x00005c4369c18480 in bgp_packet_add (connection=0x5c438e9a98c0, peer=0x5c438e9b6010, s=0x7af15c06bf70) at bgpd/bgp_packet.c:151
9  0x00005c4369c19816 in bgp_keepalive_send (peer=0x5c438e9b6010) at bgpd/bgp_packet.c:639
10 0x00005c4369bf01fd in peer_process (hb=0x5c438ed05520, arg=0x7af16bdffaf0) at bgpd/bgp_keepalives.c:111
11 0x00007af16dacd8e6 in hash_iterate (hash=0x7af15c000be0, func=0x5c4369bf005e <peer_process>, arg=0x7af16bdffaf0) at lib/hash.c:252
12 0x00005c4369bf0679 in bgp_keepalives_start (arg=0x5c438e0db110) at bgpd/bgp_keepalives.c:214
13 0x00007af16dac9932 in frr_pthread_inner (arg=0x5c438e0db110) at lib/frr_pthread.c:180
14 0x00007af16d694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
15 0x00007af16d726850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb)

The bgp keepalive pthread gets deadlocked with itself and consequently
the bgp master pthread gets locked when it attempts to lock
the peerhash_mtx, since it is also locked by the keepalive_pthread

The keepalive pthread is locking the peerhash_mtx in
bgp_keepalives_start.  Next the connection->io_mtx mutex in
bgp_keepalives_send is locked and then when it notices a problem it invokes
bgp_stop_with_notify which relocks the same mutex ( and of course
the relock causes it to get stuck on itself ).  This generates a
deadlock condition.

Modify the code to only hold the connection->io_mtx as short as
possible.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agobgpd: Only grab the confed path count if we are comparing it
Donald Sharp [Thu, 24 Oct 2024 15:40:56 +0000 (11:40 -0400)]
bgpd: Only grab the confed path count if we are comparing it

This is just a small optimization but when calling path_info_cmp
hundreds of millions of times this adds up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agobgpd: Store aspath count after aspath has changed
Donald Sharp [Thu, 24 Oct 2024 15:27:24 +0000 (11:27 -0400)]
bgpd: Store aspath count after aspath has changed

When running bestpath on a very large number of ecmp.
BGP ends up calling aspath_count a very very large number
of times, which results in ~15% cpu runtime in aspath_count_hops.
Modify the aspath to keep track of it's own count.  This results
in the function now taking up ~1.5% of the cpu runtime.  Enough
for the moment to be ignored.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agobgpd: Do not call evpn_overlay_free no matter what
Donald Sharp [Wed, 23 Oct 2024 17:16:29 +0000 (13:16 -0400)]
bgpd: Do not call evpn_overlay_free no matter what

bgp_update is a very expensive call.  Calling evpn_overlay_free
even when we have no evpn data to free is not trivial.  Let's
limit the call into this function until we actually have data to
free.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agobgpd: compare aigp after local route check in bgp_path_info_cmp() 17199/head
Enke Chen [Thu, 24 Oct 2024 17:50:37 +0000 (10:50 -0700)]
bgpd: compare aigp after local route check in bgp_path_info_cmp()

For consistency between RIB and BGP, the aigp comparison should
be made after the local route check in bgp bestpath selection.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
6 months agotests: add a new BGP AIGP topotest
Enke Chen [Thu, 24 Oct 2024 17:30:24 +0000 (10:30 -0700)]
tests: add a new BGP AIGP topotest

The topotest verifies that a local route is favored irrespective
of its AIGP value.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
6 months agotests: add bmpserver logging 17207/head
Louis Scalbert [Wed, 23 Oct 2024 10:26:28 +0000 (12:26 +0200)]
tests: add bmpserver logging

Add bmpserver logging

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agotests: bmpserver, detect session close immediately
Louis Scalbert [Wed, 23 Oct 2024 10:25:42 +0000 (12:25 +0200)]
tests: bmpserver, detect session close immediately

bmpserver infinitely loops after the clients has closed the TCP session.
In this situation, recv() returns empty data.

Detect session close immediately.

Fixes: 875511c466 ("topotests: add basic bmp collector")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agotests: apply black to bmpserver
Louis Scalbert [Wed, 23 Oct 2024 10:37:31 +0000 (12:37 +0200)]
tests: apply black to bmpserver

Apply black to bmpserver

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agoMerge pull request #17191 from louis-6wind/fix-bgp-labels
Donatas Abraitis [Thu, 24 Oct 2024 14:35:36 +0000 (17:35 +0300)]
Merge pull request #17191 from louis-6wind/fix-bgp-labels

bgpd: fix uninitialized bgp_labels

6 months agopimd: PIM autorp no path RP fix 17215/head
Nathan Bahr [Tue, 22 Oct 2024 15:32:52 +0000 (15:32 +0000)]
pimd: PIM autorp no path RP fix

Just because there is currently no path to the RP doesn't mean it failed to add.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
6 months agoMerge pull request #17162 from louis-6wind/fix-bh-nh-vrf
Donatas Abraitis [Wed, 23 Oct 2024 14:34:44 +0000 (17:34 +0300)]
Merge pull request #17162 from louis-6wind/fix-bh-nh-vrf

zebra: fix showing nexthop vrf for ipv6 blackhole

6 months agoMerge pull request #17183 from Shbinging/fix_no_area_range_command_2
Donatas Abraitis [Wed, 23 Oct 2024 09:41:37 +0000 (12:41 +0300)]
Merge pull request #17183 from Shbinging/fix_no_area_range_command_2

ospfd:fix the bug that the empty area was not free after no area range command was executed

6 months agobgpd: fix uninitialized labels 17191/head
Louis Scalbert [Tue, 22 Oct 2024 16:08:13 +0000 (18:08 +0200)]
bgpd: fix uninitialized labels

Fix uninitialized labels that cause multiple valgrind issues.

> ==3729602== Use of uninitialised value of size 8
> ==3729602==    at 0x492B493: hash_get (hash.c:140)
> ==3729602==    by 0x2629D2: bgp_labels_intern (bgp_label.c:98)
> ==3729602==    by 0x2E6C92: bgp_adj_out_set_subgroup (bgp_updgrp_adv.c:622)
> ==3729602==    by 0x2A6810: subgroup_process_announce_selected (bgp_route.c:3340)
> ==3729602==    by 0x2E5FF6: group_announce_route_walkcb (bgp_updgrp_adv.c:260)
> ==3729602==    by 0x2E3E28: update_group_walkcb (bgp_updgrp.c:1759)
> ==3729602==    by 0x492B9A0: hash_walk (hash.c:270)
> ==3729602==    by 0x2E498C: update_group_af_walk (bgp_updgrp.c:2090)
> ==3729602==    by 0x2E7C0D: group_announce_route (bgp_updgrp_adv.c:1119)
> ==3729602==    by 0x2A796E: bgp_process_main_one (bgp_route.c:3865)
> ==3729602==    by 0x2A808A: bgp_process_wq (bgp_route.c:3991)
> ==3729602==    by 0x49CC7CF: work_queue_run (workqueue.c:282)
> ==3729602==    by 0x49BBF25: event_call (event.c:2019)
> ==3729602==    by 0x49413CA: frr_run (libfrr.c:1238)
> ==3729602==    by 0x1FD1D3: main (bgp_main.c:555)

> ==2604268== Use of uninitialised value of size 8
> ==2604268==    at 0x4943016: hash_get (hash.c:159)
> ==2604268==    by 0x26EFC1: bgp_labels_intern (bgp_label.c:97)
> ==2604268==    by 0x28077B: leak_update (bgp_mplsvpn.c:1298)
> ==2604268==    by 0x2824A3: vpn_leak_from_vrf_update (bgp_mplsvpn.c:1932)
> ==2604268==    by 0x2C281C: bgp_static_update (bgp_route.c:6974)
> ==2604268==    by 0x2C366F: bgp_static_set (bgp_route.c:7263)
> ==2604268==    by 0x2C435B: bgp_network_magic (bgp_route.c:7556)
> ==2604268==    by 0x2ACF09: bgp_network (bgp_route_clippy.c:86)
> ==2604268==    by 0x4914EE7: cmd_execute_command_real (command.c:1003)
> ==2604268==    by 0x4915060: cmd_execute_command (command.c:1062)
> ==2604268==    by 0x4915610: cmd_execute (command.c:1228)
> ==2604268==    by 0x49E7C32: vty_command (vty.c:625)
> ==2604268==    by 0x49E9B56: vty_execute (vty.c:1388)
> ==2604268==    by 0x49EC331: vtysh_read (vty.c:2400)
> ==2604268==    by 0x49E06F1: event_call (event.c:2001)
> ==2604268==    by 0x495AB8B: frr_run (libfrr.c:1238)
> ==2604268==    by 0x200C4B: main (bgp_main.c:555)

Fixes: ddb5b4880b ("bgpd: vpn-vrf route leaking")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agoospfd:fix syntax of some no commands 17189/head
Shbinging [Tue, 22 Oct 2024 06:48:33 +0000 (06:48 +0000)]
ospfd:fix syntax of some no commands

Fix syntax of the following no commands:
1. `no area virtual link A.B.C.D hello-interval <NUM>`, `<NUM>` can be omitted.
2. `no area nssa default-information-originate metric <NUM>`, `<NUM>` can be omitted.
3. `no area nssa range cost <NUM>`, `<NUM>` can be omitted.
4. `no area default cost <NUM>`, `<NUM>` can be omitted.
5. `no ospf write-multiplier <NUM>`, `<NUM>` can be omitted.
6. `no default-information originate metric <NUM>`, `<NUM>` can be omitted.
7. `no distance <NUM>`, `<NUM>` can be omitted.

Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
6 months agoisisd: The command "'show isis vrf all summary json" has no output. 17190/head
baozhen-H3C [Tue, 22 Oct 2024 07:59:39 +0000 (15:59 +0800)]
isisd: The command "'show isis vrf all summary json" has no output.

When input 'show isis vrf all summary', output is as follow:
sonic# show isis vrf all summary
vrf             : default
Process Id      : 55
System Id       : 0000.0000.0006
Symbolic name   : RouterA
Up time         : 4d01h52m ago
Number of areas : 1
Area 10:
  Net: 10.0000.0000.0006.00
  IS_name: RouterA
  TX counters per PDU type:
     L1 IIH: 365003
     L1 LSP: 20468
    L1 PSNP: 8
   LSP RXMT: 0
  RX counters per PDU type:
     L1 IIH: 361577
     L2 IIH: 434
     L1 LSP: 10492
    L1 CSNP: 114260
  Level-1:
    LSP0 regenerated: 4840
         LSPs purged: 0
    SPF:
      minimum interval  : 1
    IPv4 route computation:
      last run elapsed  : 00:01:02 ago
      last run duration : 327 usec
      run count         : 12053
However, json display is null.

After the commit:
sonic# show isis vrf all summary json
{
  "vrfs":[
    {
      "vrf":"default",
      "process-id":56,
      "system-id":"0000.0000.0007",
      "up-time":"20:40:33",
      "number-areas":1,
      "areas":[
        {
          "area":"10",
          "net":"10.0000.0000.0007.00",
          "tx-pdu-type":{
            "l1-iih":52234,
            "l1-lsp":1053,
            "l1-csnp":8269,
            "l1-psnp":1,
            "lsp-rxmt":0
          },
          "rx-pdu-type":{
            "l1-iih":52245,
            "l2-iih":26116,
            "l1-lsp":1388,
            "l1-csnp":8269
          },
          "levels":[
            {
              "id":1,
              "lsp0-regenerated":89,
              "lsp-purged":0,
              "spf":"no pending",
              "minimum-interval":1,
              "last-run-elapsed":"00:00:05",
              "last-run-duration-usec":192,
              "last-run-count":1454
            }
          ]
        }
      ]
    }
  ]
}

Signed-off-by: baozhen-H3C <bao.zhen@h3c.com>
6 months agoMerge pull request #17198 from donaldsharp/backout_stdout_changes
Russ White [Tue, 22 Oct 2024 20:35:05 +0000 (16:35 -0400)]
Merge pull request #17198 from donaldsharp/backout_stdout_changes

Revert "lib: Attach stdout to child only if --log=stdout and stdout F…

6 months agoMerge pull request #17192 from donaldsharp/bgp_bmp_stream_leak
Russ White [Tue, 22 Oct 2024 20:16:57 +0000 (16:16 -0400)]
Merge pull request #17192 from donaldsharp/bgp_bmp_stream_leak

bgpd: Do not leak a stream with bmp code

6 months agovtysh: fix `find` and `list` commands 17200/head
David Lamparter [Tue, 22 Oct 2024 18:41:32 +0000 (20:41 +0200)]
vtysh: fix `find` and `list` commands

I simply missed that `node->cmd_vector` is needed for `find` and `list`
to work correctly.

Fixes: #17043
Fixes: 4bc41193e810 ("vtysh, lib: preprocess CLI graphs")
Reported-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agobgpd: fix allocating uninitialized bgp_labels
Louis Scalbert [Tue, 22 Oct 2024 13:07:26 +0000 (15:07 +0200)]
bgpd: fix allocating uninitialized bgp_labels

Memory was not zeroed at allocation.

> ==2604268== Conditional jump or move depends on uninitialised value(s)
> ==2604268==    at 0x26F026: bgp_labels_unintern (bgp_label.c:116)
> ==2604268==    by 0x30000C: adj_free (bgp_updgrp_adv.c:81)
> ==2604268==    by 0x3019EE: bgp_adj_out_remove_subgroup (bgp_updgrp_adv.c:728)
> ==2604268==    by 0x30537C: subgroup_withdraw_packet (bgp_updgrp_packet.c:1042)
> ==2604268==    by 0x2970AF: bgp_generate_updgrp_packets (bgp_packet.c:508)
> ==2604268==    by 0x49E06F1: event_call (event.c:2001)
> ==2604268==    by 0x495AB8B: frr_run (libfrr.c:1238)
> ==2604268==    by 0x200C4B: main (bgp_main.c:555)

Fixes: 3c86f776f0 ("bgpd: add bgp_labels hash")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agoMerge pull request #17180 from anlancs/zebra/review-move-dplane
Jafar Al-Gharaibeh [Tue, 22 Oct 2024 15:29:49 +0000 (10:29 -0500)]
Merge pull request #17180 from anlancs/zebra/review-move-dplane

zebra: drop NEWLINK event handling in the main thread

6 months agoRevert "lib: Attach stdout to child only if --log=stdout and stdout FD is a tty" 17198/head
Donald Sharp [Tue, 22 Oct 2024 15:13:07 +0000 (11:13 -0400)]
Revert "lib: Attach stdout to child only if --log=stdout and stdout FD is a tty"

This reverts commit 0e3c5e8e5907321b35201f0985c1d3f4a1b0e639.

6 months agoMerge pull request #17174 from baozhen-H3C/202410180225
Russ White [Tue, 22 Oct 2024 15:07:53 +0000 (11:07 -0400)]
Merge pull request #17174 from baozhen-H3C/202410180225

isisd: fix 'show isis route' and 'show isis fast-reroute summary' errors with vrf

6 months agoMerge pull request #17166 from anlancs/zebra/review-remove-one
Russ White [Tue, 22 Oct 2024 15:06:50 +0000 (11:06 -0400)]
Merge pull request #17166 from anlancs/zebra/review-remove-one

zebra: remove useless code

6 months agoMerge pull request #17165 from opensourcerouting/fix/bgp_community_no_export_oad
Russ White [Tue, 22 Oct 2024 15:05:38 +0000 (11:05 -0400)]
Merge pull request #17165 from opensourcerouting/fix/bgp_community_no_export_oad

bgpd: Do not filter no-export community for BGP OAD

6 months agoMerge pull request #17151 from opensourcerouting/fix/send_link_bw_as_non-transitive_t...
Russ White [Tue, 22 Oct 2024 15:03:00 +0000 (11:03 -0400)]
Merge pull request #17151 from opensourcerouting/fix/send_link_bw_as_non-transitive_to_ebgp

bgpd: Handle non-transitive extended communities

6 months agobgpd: Do not leak a stream with bmp code 17192/head
Donald Sharp [Tue, 22 Oct 2024 14:10:46 +0000 (10:10 -0400)]
bgpd: Do not leak a stream with bmp code

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agobgpd: Handle non-transitive opaque extended communities also for eBGP peers 17151/head
Donatas Abraitis [Thu, 17 Oct 2024 11:24:32 +0000 (14:24 +0300)]
bgpd: Handle non-transitive opaque extended communities also for eBGP peers

Fixes: 765a0855f1ffec68ed42f2fac8afcaaeed99fd1a ("bgpd: Rework extended community transitiviness")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobgpd: Check transivity flag for node target extended community with CHECK_FLAG()
Donatas Abraitis [Thu, 17 Oct 2024 10:33:17 +0000 (13:33 +0300)]
bgpd: Check transivity flag for node target extended community with CHECK_FLAG()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobgpd: Rework extended community transitiviness
Donatas Abraitis [Thu, 17 Oct 2024 08:31:56 +0000 (11:31 +0300)]
bgpd: Rework extended community transitiviness

Extended communities can be transitive or non-transitive.

Like other attributes (e.g., MED) non-transitive extended communities SHOULD
be sent to the direct peer, but not forward them to eBGP peers next.

Before this patch, we never send non-transitive extended attributes to the
direct peers at all.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobgpd: Add a function to strip non-transitive extended communities
Donatas Abraitis [Thu, 17 Oct 2024 08:31:10 +0000 (11:31 +0300)]
bgpd: Add a function to strip non-transitive extended communities

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobgpd: Print ipv6 extended communities if debug updates is turned on
Donatas Abraitis [Thu, 17 Oct 2024 08:29:31 +0000 (11:29 +0300)]
bgpd: Print ipv6 extended communities if debug updates is turned on

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobgpd: Check for the extended community size before setting the flag
Donatas Abraitis [Thu, 17 Oct 2024 08:27:43 +0000 (11:27 +0300)]
bgpd: Check for the extended community size before setting the flag

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agotests: Check if non-transitive link-bandwidth communities are sent/received correctly
Donatas Abraitis [Thu, 17 Oct 2024 08:25:39 +0000 (11:25 +0300)]
tests: Check if non-transitive link-bandwidth communities are sent/received correctly

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobgpd: Handle non-transitive extended communities for link-bandwidth
Donatas Abraitis [Thu, 17 Oct 2024 08:11:50 +0000 (11:11 +0300)]
bgpd: Handle non-transitive extended communities for link-bandwidth

If we received a non-transitive extended community (in this case it was
extended link-bandwidth), we treated it as unknown because we didn't check for
the transitive flag correctly.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agoMerge pull request #17168 from enkechen-panw/aigp-fix3
Donatas Abraitis [Tue, 22 Oct 2024 05:39:35 +0000 (08:39 +0300)]
Merge pull request #17168 from enkechen-panw/aigp-fix3

bgpd: fix AIGP calculation in route advertisement

6 months agoospfd:fix the bug that the empty area was not free after no area range command was... 17183/head
Shbinging [Tue, 22 Oct 2024 05:34:26 +0000 (05:34 +0000)]
ospfd:fix the bug that the empty area was not free after no area range command was executed

    When we use the no area X.X.X.X range A.B.C.D/M command, if the area no longer has an interface to which it belongs, then the area should be deleted from the LSDB. This processing logic is consistent with instructions such as no network area and no area authentication.

Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>