]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
6 months agobgpd: allow value 0 in aigp-metric setting
Enke Chen [Sun, 20 Oct 2024 19:25:46 +0000 (12:25 -0700)]
bgpd: allow value 0 in aigp-metric setting

The value of 0 is accepted from peers, and can also be set by the
route-map "set aigp-metric igp-metric". For coonsistency, it should
be allowed in "set aigp-metric <value>" as well.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
6 months agoMerge pull request #17157 from LabNConsulting/liambrady/topotest-masked-logging
Donatas Abraitis [Sun, 20 Oct 2024 17:35:04 +0000 (20:35 +0300)]
Merge pull request #17157 from LabNConsulting/liambrady/topotest-masked-logging

tests: logger masked in topotest.py

6 months agoMerge pull request #17167 from sri-mohan1/srib-24-frr-a
Donatas Abraitis [Sun, 20 Oct 2024 10:39:17 +0000 (13:39 +0300)]
Merge pull request #17167 from sri-mohan1/srib-24-frr-a

bgpd: changes for code maintainability

6 months agobgpd: changes for code maintainability
sri-mohan1 [Sat, 19 Oct 2024 09:23:05 +0000 (14:53 +0530)]
bgpd: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
6 months agoMerge pull request #17164 from sri-mohan1/srib-24-frr-a
Mark Stapp [Fri, 18 Oct 2024 20:17:16 +0000 (16:17 -0400)]
Merge pull request #17164 from sri-mohan1/srib-24-frr-a

bgpd: changes for code maintainability

6 months agoMerge pull request #17025 from donaldsharp/ppoll_fix
David Lamparter [Fri, 18 Oct 2024 17:28:09 +0000 (19:28 +0200)]
Merge pull request #17025 from donaldsharp/ppoll_fix

6 months agobgpd: changes for code maintainability
sri-mohan1 [Fri, 18 Oct 2024 16:17:02 +0000 (21:47 +0530)]
bgpd: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
6 months agoMerge pull request #17134 from Shbinging/fix_no_area_nssa_command
Donatas Abraitis [Fri, 18 Oct 2024 11:55:46 +0000 (14:55 +0300)]
Merge pull request #17134 from Shbinging/fix_no_area_nssa_command

ospfd: update ospf_asbr_status when using no_area_nssa command

6 months agoMerge pull request #17154 from donaldsharp/connected_coverity
Jafar Al-Gharaibeh [Thu, 17 Oct 2024 20:32:46 +0000 (15:32 -0500)]
Merge pull request #17154 from donaldsharp/connected_coverity

zebra: Fix possible null deref discovered by coverity

6 months agotests: logger masked in topotest.py
Liam Brady [Thu, 17 Oct 2024 17:35:36 +0000 (13:35 -0400)]
tests: logger masked in topotest.py

a local logger masks the global logger and prevents errors from being
gracefully handled within topotest.py

Signed-off-by: Liam Brady <lbrady@labn.net>
6 months agolib: Correctly handle ppoll pfds.events == 0
Donald Sharp [Tue, 8 Oct 2024 01:46:33 +0000 (21:46 -0400)]
lib: Correctly handle ppoll pfds.events == 0

The frrevent system is spitting out this message in bgpd:
20:40:15 mem1-roc-f2-b1-r5-t2-d4 bgpd[13166]: [XETTR-D5MR0][EC 100663316] Attempting to process an I/O event but for fd: 214(8) no thread to handle this!

This is because as each io event is processed, it is possible that a
.events is set to 0.  This can leave a situation where we ask
ppoll to handle anything that happens on a fd with a .events of 0,
in this situation ppoll can return POLLERR, which indicates that
something bad has happened on the fd.

Let's set the ppoll fds.fd value to -1 when there are no more
events to be processed.  ppoll specifically calls out that
it will just skip this particular one.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agozebra: Fix possible null deref discovered by coverity
Donald Sharp [Thu, 17 Oct 2024 11:42:47 +0000 (07:42 -0400)]
zebra: Fix possible null deref discovered by coverity

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agoMerge pull request #17136 from opensourcerouting/clang-sa-19
Donald Sharp [Thu, 17 Oct 2024 11:38:28 +0000 (07:38 -0400)]
Merge pull request #17136 from opensourcerouting/clang-sa-19

*: fix clang-19 SA

6 months agoospfd: update ospf_asbr_status when using no_area_nssa command
Shbinging [Wed, 16 Oct 2024 05:28:02 +0000 (05:28 +0000)]
ospfd: update ospf_asbr_status when using no_area_nssa command

In the processing of nssa, if the number of areas that need to be translated is greater than 0, then abr will be regarded as asbr, and it will be marked (0x3) in the flag of router lsa. When a certain area is set from nssa to a normal area, the areas that need to be translated may be reduced. The asbr should be re-interpreted as abr when the translated area is 0.

Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
6 months agoMerge pull request #17065 from Shbinging/fix_some_ospf_commands
Donatas Abraitis [Thu, 17 Oct 2024 06:01:30 +0000 (09:01 +0300)]
Merge pull request #17065 from Shbinging/fix_some_ospf_commands

ospfd: fix some ospf commands

6 months agoMerge pull request #17091 from enkechen-panw/aigp-fix1
Donatas Abraitis [Thu, 17 Oct 2024 05:55:03 +0000 (08:55 +0300)]
Merge pull request #17091 from enkechen-panw/aigp-fix1

bgpd: fix several issues in sourcing AIGP attribute

6 months agotests: add a new topotest to bgp_aigp
Enke Chen [Wed, 16 Oct 2024 18:19:28 +0000 (11:19 -0700)]
tests: add a new topotest to bgp_aigp

Add a new topotest for getting the aigp from the "igp-metric"
for a redistributed route (ospf route in the test).

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
6 months agobgpd: fix several issues in sourcing AIGP attribute
Enke Chen [Wed, 16 Oct 2024 18:15:28 +0000 (11:15 -0700)]
bgpd: fix several issues in sourcing AIGP attribute

Fix several issues in sourcing AIGP attribute:

1) AIGP should not be set as default for a redistributed route or a
   static network. It should be set by config instead.

2) AIGP sourced by "set aigp-metric igp-metric" in a route-map does
   not set the correct value for a redistributed route.

3) When redistribute a connected route like loopback, the AGIP (with
   value 0) is sourced by "set aigp-metric igp-metric", but the
   attribute is not propagated as the attribute flag is not set.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
6 months agoMerge pull request #16452 from louis-6wind/fix-ipv4-mapped-ipv6-display
Russ White [Wed, 16 Oct 2024 17:01:52 +0000 (13:01 -0400)]
Merge pull request #16452 from louis-6wind/fix-ipv4-mapped-ipv6-display

lib, test: fix display ipv4 mapped ipv6 addresses

6 months agoMerge pull request #17076 from donaldsharp/rnh_and_redistribution_nexthop_num_fix
Donatas Abraitis [Wed, 16 Oct 2024 13:34:08 +0000 (16:34 +0300)]
Merge pull request #17076 from donaldsharp/rnh_and_redistribution_nexthop_num_fix

*: Fix up improper handling of nexthops for nexthop tracking

6 months agoMerge pull request #17020 from pguibert6WIND/asan_shutdown
Donald Sharp [Wed, 16 Oct 2024 13:15:06 +0000 (09:15 -0400)]
Merge pull request #17020 from pguibert6WIND/asan_shutdown

zebra: fix heap-use-after free on ns shutdown

6 months agoMerge pull request #16946 from opensourcerouting/fix/match_src-peer
Russ White [Wed, 16 Oct 2024 11:51:20 +0000 (07:51 -0400)]
Merge pull request #16946 from opensourcerouting/fix/match_src-peer

bgpd: Implement match src-peer ... command

6 months agotests: update fuzz after ipv4 mapped ipv6 print change
Louis Scalbert [Tue, 23 Jul 2024 19:41:21 +0000 (21:41 +0200)]
tests: update fuzz after ipv4 mapped ipv6 print change

Update IS-IS fuzz test to match corrected output after change in the
display of IPv4 mapped IPv6 address.

The update was performed using wuschl [1] like this:

$ wuschl rebuild tests/isisd/test_fuzz_isis_tlv
$ gzip -9 tests/isisd/test_fuzz_isis_tlv_tests.h

[1] https://pypi.org/project/wuschl/

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agolib, test: fix display ipv4 mapped ipv6 addresses
Louis Scalbert [Mon, 22 Jul 2024 14:15:26 +0000 (16:15 +0200)]
lib, test: fix display ipv4 mapped ipv6 addresses

Display ipv4 mapped ipv6 addresses in the format ::ffff:A.B.C.D.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agobgpd: hide read() call from clang-SA
David Lamparter [Wed, 16 Oct 2024 10:56:45 +0000 (12:56 +0200)]
bgpd: hide read() call from clang-SA

Sigh. clang-SA doesn't want you to call read() while holding a mutex.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agozebra: check `dirfd()` result
David Lamparter [Wed, 16 Oct 2024 10:54:45 +0000 (12:54 +0200)]
zebra: check `dirfd()` result

`dirfd()` can theoretically return an error.  Call it once and check the
result.

clang-SA: technically correctâ„¢.  Ain't that the best kind of correct?

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agozebra: don't misappropriate `errno`
David Lamparter [Wed, 16 Oct 2024 10:53:47 +0000 (12:53 +0200)]
zebra: don't misappropriate `errno`

`errno` has its own semantics.  Sometimes it is correct to write to it.
This is not one of those cases - just use a separate `nl_errno`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agozebra: don't try to read past EOF
David Lamparter [Wed, 16 Oct 2024 10:52:48 +0000 (12:52 +0200)]
zebra: don't try to read past EOF

`FILE *` objects are theoretically in an invalid state if you try to use
them past their reporting EOF.  Adjust the code to make it correct.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agovtysh: make clang-SA happy about reusing stdin
David Lamparter [Wed, 16 Oct 2024 10:50:50 +0000 (12:50 +0200)]
vtysh: make clang-SA happy about reusing stdin

While the logic here is perfectly fine, clang-SA doesn't understand that
the fopen() and fclose() match up with each other.  Just use a separate
variable to make clang-SA happy.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agovtysh: remove duplicate nonblocking handling
David Lamparter [Wed, 16 Oct 2024 10:46:35 +0000 (12:46 +0200)]
vtysh: remove duplicate nonblocking handling

non-blocking retries are already handled in `vtysh_client_receive()`.
And by the point we're back in `vtysh_client_run()`, errno may have been
overwritten by the close() call in vtysh_client_receive().

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agoldpd: free previous config if it wasn't applied
David Lamparter [Wed, 16 Oct 2024 10:40:01 +0000 (12:40 +0200)]
ldpd: free previous config if it wasn't applied

If a create-config command is received, but the config is never applied,
the config will be leaked on the next create-config command.  This
should theoretically never happen, but let's fix it anyway.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agopimd: MLD packets always have an interface
David Lamparter [Wed, 16 Oct 2024 11:25:37 +0000 (13:25 +0200)]
pimd: MLD packets always have an interface

If a packet doesn't have an interface, we're gonna crash 2 lines below.
An assert is a little more useful... and makes clang-SA not complain
about it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agopimd: mark rest-of-packet ignored in C-RP parse
David Lamparter [Wed, 16 Oct 2024 10:45:35 +0000 (12:45 +0200)]
pimd: mark rest-of-packet ignored in C-RP parse

The `buf` pointer is being updated as the parse goes along.  It's not
used after the last update, but I'd rather keep this in for consistency.
Just make a note of it being unused.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agopimd: initialize prefix value in Auto-RP
David Lamparter [Wed, 16 Oct 2024 10:43:52 +0000 (12:43 +0200)]
pimd: initialize prefix value in Auto-RP

clang-SA complains that it's only partially initialized (because it's
used with IPv4 only).  The code later calls some AF-generic code,
prompting clang-SA to complain that the non-IPv4 parts are used without
being set.  While this shouldn't happen, just initialize it fully.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agolib: fix invalid use of errno in PTM
David Lamparter [Wed, 16 Oct 2024 10:42:30 +0000 (12:42 +0200)]
lib: fix invalid use of errno in PTM

errno is only valid if there was an actual error.  A zero return value
isn't an error, it's either EOF or an empty datagram depending on
context.  Fix the logic.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agolib: guard close() in netns code
David Lamparter [Wed, 16 Oct 2024 10:42:02 +0000 (12:42 +0200)]
lib: guard close() in netns code

clang-SA complains that ns->fd could be invalid.  Add a guard.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agolib: make clang-SA not choke on defun_lex.l
David Lamparter [Wed, 16 Oct 2024 10:41:06 +0000 (12:41 +0200)]
lib: make clang-SA not choke on defun_lex.l

The flex-generated code is disabled for clang-SA builds already, but
that means that function prototypes are missing too.  Just add dummy
function prototypes so clang-SA can process the file.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months ago*: clang-SA switch-enum initializer workarounds
David Lamparter [Wed, 16 Oct 2024 10:24:44 +0000 (12:24 +0200)]
*: clang-SA switch-enum initializer workarounds

In these cases the value assigned by the switch block is used directly
rather than returned.  Mark the initial/default value as used so
clang-SA doesn't complain about it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months ago*: clang-SA friendly switch-enum-return-string
David Lamparter [Wed, 16 Oct 2024 10:23:23 +0000 (12:23 +0200)]
*: clang-SA friendly switch-enum-return-string

clang-19's SA complains about unused initializers for this kind of
"switch (enum) { return string }" kind of code.  Use direct string
return values to avoid the issue.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agoMerge pull request #17114 from Jafaral/getenv
Donatas Abraitis [Wed, 16 Oct 2024 07:50:02 +0000 (10:50 +0300)]
Merge pull request #17114 from Jafaral/getenv

vtysh: fix SA warning, no need to call getenv() twice

6 months agoMerge pull request #17116 from enkechen-panw/zfix-2
Donatas Abraitis [Wed, 16 Oct 2024 05:12:28 +0000 (08:12 +0300)]
Merge pull request #17116 from enkechen-panw/zfix-2

zebra: unlock node only after operation in zebra_free_rnh()

6 months agoMerge pull request #17126 from donaldsharp/ospf_lsa_declarations
Donatas Abraitis [Wed, 16 Oct 2024 05:10:27 +0000 (08:10 +0300)]
Merge pull request #17126 from donaldsharp/ospf_lsa_declarations

ospfd: Fixup ospf_lsa.[ch] to properly spell out parameters for funct…

6 months agoospfd: fix no area shortcut MODE command, MODE can be default
Shbinging [Fri, 11 Oct 2024 09:48:33 +0000 (09:48 +0000)]
ospfd: fix no area shortcut MODE command, MODE can be default

Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
6 months agoMerge pull request #17107 from donaldsharp/actuallY_call_the_command
Jafar Al-Gharaibeh [Wed, 16 Oct 2024 02:24:33 +0000 (21:24 -0500)]
Merge pull request #17107 from donaldsharp/actuallY_call_the_command

tests: iproute2_check_path_selection call the actual command

6 months agoospfd: Fixup ospf_lsa.[ch] to properly spell out parameters for functions
Donald Sharp [Tue, 15 Oct 2024 22:32:14 +0000 (18:32 -0400)]
ospfd: Fixup ospf_lsa.[ch] to properly spell out parameters for functions

Our standard says when in a .h file and declaring a function all parameters
must have their variables spelled out.  Let's do this for ospf_lsa.h

Modified ospf_lsa.c to also use event instead of thread, and uint8_t instead
of unsigned short.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agoMerge pull request #17038 from opensourcerouting/feature/bgp_set_metric_internal
Russ White [Tue, 15 Oct 2024 21:58:05 +0000 (17:58 -0400)]
Merge pull request #17038 from opensourcerouting/feature/bgp_set_metric_internal

bgpd: Derive and set MED from IGP or AIGP

6 months agoMerge pull request #15586 from donaldsharp/nht_explain_doc
Jafar Al-Gharaibeh [Tue, 15 Oct 2024 19:25:35 +0000 (14:25 -0500)]
Merge pull request #15586 from donaldsharp/nht_explain_doc

zebra: Attempt to explain the rnh tracking code better

6 months agoMerge pull request #17088 from donaldsharp/connected_kernel_fun
Jafar Al-Gharaibeh [Tue, 15 Oct 2024 19:04:51 +0000 (14:04 -0500)]
Merge pull request #17088 from donaldsharp/connected_kernel_fun

zebra: Prevent a kernel route from being there when a connected should

6 months agoMerge pull request #17073 from louis-6wind/fix-ipv6-ll-nexthop-reflector
Russ White [Tue, 15 Oct 2024 18:18:49 +0000 (14:18 -0400)]
Merge pull request #17073 from louis-6wind/fix-ipv6-ll-nexthop-reflector

bgpd, tests: don't send local nexthop from rr client

6 months agozebra: unlock node only after operation in zebra_free_rnh()
Enke Chen [Tue, 15 Oct 2024 17:23:10 +0000 (10:23 -0700)]
zebra: unlock node only after operation in zebra_free_rnh()

Move route_unlock_node() after rnh_list_del().

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
6 months agoMerge pull request #17104 from opensourcerouting/frr-format-array-crash
Donald Sharp [Tue, 15 Oct 2024 17:22:54 +0000 (13:22 -0400)]
Merge pull request #17104 from opensourcerouting/frr-format-array-crash

tools/gcc-plugins: don't crash on array parameters

6 months agozebra: Attempt to explain the rnh tracking code better
Donald Sharp [Wed, 20 Mar 2024 19:32:30 +0000 (15:32 -0400)]
zebra: Attempt to explain the rnh tracking code better

I got asked today what was going on in the rnh code.  I
had to take time off of what I was doing and rewrap my
head around this code, since it's been a long time.
As that this question may come up again in the future
I am trying to document this better so that someone
coming behind us will be able to read this and get
a better idea of what the algorithm is attempting
to do.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agovtysh: fix SA warning, no need to call getenv() twice
Jafar Al-Gharaibeh [Tue, 15 Oct 2024 16:11:03 +0000 (11:11 -0500)]
vtysh: fix SA warning, no need to call getenv() twice

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
6 months ago*: Fix up improper handling of nexthops for nexthop tracking
Donald Sharp [Fri, 11 Oct 2024 18:01:10 +0000 (14:01 -0400)]
*: Fix up improper handling of nexthops for nexthop tracking

Currently FRR needs to send a uint16_t value for the number
of nexthops as well it needs the ability to properly decode
all of this.  Find and handle all the places that this happens.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agoMerge pull request #17106 from louis-6wind/fix-bmp-converity
Russ White [Tue, 15 Oct 2024 15:55:42 +0000 (11:55 -0400)]
Merge pull request #17106 from louis-6wind/fix-bmp-converity

bgpd: fix bmp coverity issue 1600779

6 months agoMerge pull request #17101 from Shbinging/fix_no_area_range_command
Russ White [Tue, 15 Oct 2024 15:20:34 +0000 (11:20 -0400)]
Merge pull request #17101 from Shbinging/fix_no_area_range_command

ospfd: fix the bug that the empty area was not free after no_area_range was executed

6 months agoMerge pull request #17083 from opensourcerouting/fix/openfabric_remove_redundant_check
Russ White [Tue, 15 Oct 2024 15:17:02 +0000 (11:17 -0400)]
Merge pull request #17083 from opensourcerouting/fix/openfabric_remove_redundant_check

isisd: Remove circuit state check for openfabric

6 months agoMerge pull request #17058 from opensourcerouting/fix/apply_route_maps_earlier
Russ White [Tue, 15 Oct 2024 15:15:41 +0000 (11:15 -0400)]
Merge pull request #17058 from opensourcerouting/fix/apply_route_maps_earlier

lib: Apply and generate route-map commands earlier before any other protocol

6 months agoMerge pull request #17053 from opensourcerouting/fix/drop_bgp_network_import_check_ex...
Russ White [Tue, 15 Oct 2024 15:14:35 +0000 (11:14 -0400)]
Merge pull request #17053 from opensourcerouting/fix/drop_bgp_network_import_check_exact_cmd

bgpd: Drop deprecated `bgp network import-check exact` command

6 months agotests: Check if underlay IGP metric is reflected into BGP after cost changes
Donatas Abraitis [Wed, 9 Oct 2024 15:35:33 +0000 (18:35 +0300)]
tests: Check if underlay IGP metric is reflected into BGP after cost changes

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobgpd: Re-announce the routes if the underlay IGP metric changes
Donatas Abraitis [Wed, 9 Oct 2024 15:20:48 +0000 (18:20 +0300)]
bgpd: Re-announce the routes if the underlay IGP metric changes

If the underlay IGP metric changes, we SHOULD re-announce the routes with the
correct bpi->extra->igpmetric set.

Without this patch if the IGP link cost (metric) changes, we never notice this
and the peers do not have the updated metrics, which in turn causes incorrect
best path selections on remote peers.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agodoc: Add `set metric aigp` command
Donatas Abraitis [Tue, 8 Oct 2024 18:53:19 +0000 (21:53 +0300)]
doc: Add `set metric aigp` command

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agotests: Check if `set metric aigp` works
Donatas Abraitis [Tue, 8 Oct 2024 18:48:23 +0000 (21:48 +0300)]
tests: Check if `set metric aigp` works

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobgpd: Implement `set metric aigp` command
Donatas Abraitis [Tue, 8 Oct 2024 18:47:40 +0000 (21:47 +0300)]
bgpd: Implement `set metric aigp` command

Same as `set metric igp`, but in this case accumulated IGP metric is being
sent as MED attribute.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agotests: Check if MED can be derived from `set metric igp|aigp`
Donatas Abraitis [Tue, 8 Oct 2024 18:36:13 +0000 (21:36 +0300)]
tests: Check if MED can be derived from `set metric igp|aigp`

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobgpd: Implement `set metric igp` command
Donatas Abraitis [Tue, 8 Oct 2024 17:57:49 +0000 (20:57 +0300)]
bgpd: Implement `set metric igp` command

Set metric automatically from the path info (IGP protocol).

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobgpd: Set MED using a helper bgp_attr_set_med()
Donatas Abraitis [Tue, 8 Oct 2024 14:15:00 +0000 (17:15 +0300)]
bgpd: Set MED using a helper bgp_attr_set_med()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agoMerge pull request #17093 from enkechen-panw/aigp-fix2
Donatas Abraitis [Tue, 15 Oct 2024 14:23:04 +0000 (17:23 +0300)]
Merge pull request #17093 from enkechen-panw/aigp-fix2

bgpd: fix route selection with AIGP

6 months agotests: iproute2_check_path_selection call the actual command
Donald Sharp [Tue, 15 Oct 2024 13:51:08 +0000 (09:51 -0400)]
tests: iproute2_check_path_selection call the actual command

For some reason this was missing.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agobgpd: fix bmp coverity issue 1600779
Louis Scalbert [Tue, 15 Oct 2024 13:42:02 +0000 (15:42 +0200)]
bgpd: fix bmp coverity issue 1600779

Fix bmp coverity issue 1600779. peer->su_local cannot be NULL.

Fixes: 035304c25a ("bgpd: bmp loc-rib peer up/down for vrfs")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agoMerge pull request #17103 from opensourcerouting/fix/null_ptr_dereference_bmp_bgp
Mark Stapp [Tue, 15 Oct 2024 12:24:54 +0000 (08:24 -0400)]
Merge pull request #17103 from opensourcerouting/fix/null_ptr_dereference_bmp_bgp

bgpd: Check if su_local/su_remote exist before encoding BMP peer state

6 months agoMerge pull request #17099 from opensourcerouting/fix/remove_BGP_NEXTHOP_CONNECTED_CHANGED
Mark Stapp [Tue, 15 Oct 2024 12:24:22 +0000 (08:24 -0400)]
Merge pull request #17099 from opensourcerouting/fix/remove_BGP_NEXTHOP_CONNECTED_CHANGED

bgpd: Remove unused BGP_NEXTHOP_CONNECTED_CHANGED flag for nexthop

6 months agoMerge pull request #16737 from raja-rajasekar/rajasekarr/vlan_to_dplane
Mark Stapp [Tue, 15 Oct 2024 12:06:34 +0000 (08:06 -0400)]
Merge pull request #16737 from raja-rajasekar/rajasekarr/vlan_to_dplane

zebra: vlan to dplane

6 months agotools/gcc-plugins: don't crash on array parameters
David Lamparter [Tue, 15 Oct 2024 11:28:41 +0000 (13:28 +0200)]
tools/gcc-plugins: don't crash on array parameters

Need to have arrays as a stop condition in this type normalization
function, like pointers and function pointers.  Actual arrays as
argument types are extremely rare to see because C has this
array-decay-to-pointer thing, but it can happen.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 months agobgpd: Check if su_local/su_remote exist before encoding BMP peer state
Donatas Abraitis [Tue, 15 Oct 2024 09:51:51 +0000 (12:51 +0300)]
bgpd: Check if su_local/su_remote exist before encoding BMP peer state

Fixes: 035304c25a3890a040acbe23ca385750b062cdce ("bgpd: bmp loc-rib peer up/down for vrfs")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobgpd: Remove unused BGP_NEXTHOP_CONNECTED_CHANGED flag for nexthop
Donatas Abraitis [Tue, 15 Oct 2024 09:43:38 +0000 (12:43 +0300)]
bgpd: Remove unused BGP_NEXTHOP_CONNECTED_CHANGED flag for nexthop

Also reduce the size of change_flags, which is way enough to be 1 byte.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agoospfd:fix the bug that the empty area was not free after the command was executed
Shbinging [Tue, 15 Oct 2024 07:26:50 +0000 (07:26 +0000)]
ospfd:fix the bug that the empty area was not free after the 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>
6 months agoMerge pull request #17001 from louis-6wind/bmp-new
Donatas Abraitis [Tue, 15 Oct 2024 06:09:42 +0000 (09:09 +0300)]
Merge pull request #17001 from louis-6wind/bmp-new

bgpd: bmp loc-rib peer up/down for vrfs

6 months agoMerge pull request #17087 from louis-6wind/fix-as-override
Donatas Abraitis [Tue, 15 Oct 2024 05:54:49 +0000 (08:54 +0300)]
Merge pull request #17087 from louis-6wind/fix-as-override

doc: clarify bgp as-override

6 months agoMerge pull request #17074 from chiragshah6/evpn_dev4
Donatas Abraitis [Tue, 15 Oct 2024 05:20:54 +0000 (08:20 +0300)]
Merge pull request #17074 from chiragshah6/evpn_dev4

bgpd: fix evpn mh esi down

6 months agotests: fix and adjust topotest/bgp_aigp
Enke Chen [Tue, 15 Oct 2024 01:47:59 +0000 (18:47 -0700)]
tests: fix and adjust topotest/bgp_aigp

Fix and adjust the topotest post the fix for route selection with
AIGP.

When there are multiple IGP domains (OSPF in this case), the nexthop
for a BGP route with the AIGP attribute must be resolved in its own
IGP domain.

The changes in r2/bgpd.conf and r3/bgpd.conf are needed as incorrect
IGP metrics are received from NHT for the recursive nexthops. Once
the issue is resolved, the changes can be reverted.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
6 months agobgpd: fix route selection with AIGP
Enke Chen [Tue, 15 Oct 2024 01:42:15 +0000 (18:42 -0700)]
bgpd: fix route selection with AIGP

The nexthop metric should be added to AIGP when calculating the
bestpath in bgp_path_info_cmp().

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
6 months agobgpd: fix evpn mh esi flap remove local routes
Chirag Shah [Tue, 8 Oct 2024 02:04:43 +0000 (19:04 -0700)]
bgpd: fix evpn mh esi flap remove local routes

In symmetric routing, when local ESI is down,
the MH peer learnt local mac-ip
prefix is installed into teannt vrf (given l3vni).

When ESI is back up and associated to evi/vni then
remove the local synced mac-ip imported routes from the
tenant vrf as local neigh/arp is present.

Ticket: #3878699
Testing:

peer advertised mac-ip route:
*> [2]:[0]:[48]:[aa:aa:aa:00:00:01]:[32]:[45.0.0.51] RD 27.0.0.4:9
                    27.0.0.4 (spine-1)
                                                           0 64435 65016 i
                    ESI:03:44:38:39:ff:ff:01:00:00:01
                    RT:65016:1000 RT:65016:4000 ET:8 Rmac:44:38:39:ff:ff:16

When local ESI is flapped
torm-11:# ip neigh show 45.0.0.51
45.0.0.51 dev vlan1000 lladdr aa:aa:aa:00:00:01 REACHABLE proto zebra

Before fix:
(The imported route remained in tenant-vrf)
torm-11:# ip route show vrf vrf1 45.0.0.51
45.0.0.51 nhid 257 proto bgp metric 20

After fix:

torm-11# ip route show vrf vrf1 45.0.0.51
torm-11#

trace:
2024/10/11 18:19:29 BGP: [JMP3T-178G8] route [2]:[0]:[48]:[00:02:00:00:00:08]:[32]:[21.1.0.5]
is matched on local esi 03:00:00:00:77:01:04:00:00:0e, uninstall from VRF tenant1 route table

Signed-off-by: Chirag Shah <chirag@nvidia.com>
6 months agozebra: Prevent a kernel route from being there when a connected should
Donald Sharp [Mon, 14 Oct 2024 15:25:32 +0000 (11:25 -0400)]
zebra: Prevent a kernel route from being there when a connected should

There exists a series of events where a kernel route is learned
first( that happens to be exactly what a connected route should be )
and FRR ends up with both a kernel route and a connected route,
leaving us in a very strange spot.  This code change just mirrors
the existing code of if there is a connected route drop the kernel
route.  Here we just do the reverse, if we have a kernel route
already and a connected should be created, remove the kernel and
keep the connected.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agotests: fix bgp_as_override number of routers
Louis Scalbert [Mon, 14 Oct 2024 12:39:00 +0000 (14:39 +0200)]
tests: fix bgp_as_override number of routers

There is only 4 routers not 6.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agodoc: clarify bgp as-override
Louis Scalbert [Mon, 14 Oct 2024 12:36:54 +0000 (14:36 +0200)]
doc: clarify bgp as-override

Clarify bgp as-override

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agobgpd, tests: don't send local nexthop from rr client
Louis Scalbert [Fri, 11 Oct 2024 04:59:16 +0000 (06:59 +0200)]
bgpd, tests: don't send local nexthop from rr client

AS 65000  | AS 65001
          |
      RR  |
       |  |
R1 --- | --- R2
          |

When r1 peer is an iBGP route reflector client of rr and r2 peer is a
eBGP neighbor of rr, and all three routers shares the same network, r2
receives announcements coming from r1 with a IPv6 link-local nexthop
from rr. This is incorrect as r2 should send traffic to r1 without
involving rr.

Do not send an IPv6 link-local nexthop if the originating peer is a
route-reflector client.

Link: https://github.com/FRRouting/frr/pull/16219#issuecomment-2397425505
Link: https://github.com/FRRouting/frr/pull/17037#discussion_r1792529683
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agobgpd: rename reflect in subgroup_announce_check
Louis Scalbert [Fri, 11 Oct 2024 04:57:14 +0000 (06:57 +0200)]
bgpd: rename reflect in subgroup_announce_check

In subgroup_announce_check(), the variable reflect is misleading, as it
suggests a relation to route reflection. However, it actually refers to
the scenario where an iBGP peer announces a route to another iBGP peer.

Rename reflect to ibgp_to_ibgp.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agoMerge pull request #17062 from donaldsharp/dplane_fpm_nl_problems
Donatas Abraitis [Mon, 14 Oct 2024 05:14:34 +0000 (08:14 +0300)]
Merge pull request #17062 from donaldsharp/dplane_fpm_nl_problems

zebra: Only notify dplane work pthread when needed

6 months agoMerge pull request #17082 from anlancs/zebra/add-debug-flags-fix
Donatas Abraitis [Mon, 14 Oct 2024 05:12:40 +0000 (08:12 +0300)]
Merge pull request #17082 from anlancs/zebra/add-debug-flags-fix

zebra: add back one field for debug

6 months agoisisd: Remove circuit state check for openfabric
Donatas Abraitis [Sun, 13 Oct 2024 16:54:08 +0000 (19:54 +0300)]
isisd: Remove circuit state check for openfabric

If we have something like:

```
int eth1
 ip router openfabric x
 ipv6 router openfabric x
```

And eth1 is removed, the first `ip router ...` fails and only `ipv6 router ...`
is enabled.

If we leave only:

```
int eth1
 ipv6 router openfabric x
```

Then also, no interface is going to be enabled, which is weird too.

Fixes: https://github.com/FRRouting/frr/issues/17075
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agozebra: add back one field for debug
anlan_cs [Sun, 13 Oct 2024 13:26:02 +0000 (21:26 +0800)]
zebra: add back one field for debug

The `flags` field is removed recently, so add back it for debug.

Signed-off-by: anlan_cs <anlan_cs@126.com>
6 months agoMerge pull request #17071 from louis-6wind/fix-ipv6-ll-nexthop-unchanged
Donatas Abraitis [Sun, 13 Oct 2024 11:16:54 +0000 (14:16 +0300)]
Merge pull request #17071 from louis-6wind/fix-ipv6-ll-nexthop-unchanged

bgpd: split nexthop-local unchanged peer subgroup

6 months agofpm: Allow max fpm message size to float based on ecmp
Donald Sharp [Fri, 11 Oct 2024 13:33:35 +0000 (09:33 -0400)]
fpm: Allow max fpm message size to float based on ecmp

Currently the max message size is 4k.  With a 256 way
ecmp FRR is seeing message sizes that are in the
6k size.  There is desire to allow this to increase as
well to 512.  Since the multipath size directly effects
how big the message may be when sending the routes ecmp
let's give a bit of headroom for this value when compiling
FRR at greater sizes.  Additionally since we know not everyone
is using such large ecmp, allow them to build as appropriate
for their use cases.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agozebra: Slow down fpm_process_queue
Donald Sharp [Fri, 11 Oct 2024 00:08:32 +0000 (20:08 -0400)]
zebra: Slow down fpm_process_queue

When the fpm_process_queue has run out of space
but has written to the fpm output buffer, schedule
it to wake up immediately, as that the write will go out
pretty much immediately, since it was scheduled first.
If the fpm_process_queue has not written to the output
buffer then delay the processing by 10 milliseconds to
allow a possibly backed up write processing to have a
chance to complete it's work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agozebra: Only notify dplane work pthread when needed
Donald Sharp [Thu, 10 Oct 2024 20:00:08 +0000 (16:00 -0400)]
zebra: Only notify dplane work pthread when needed

The fpm_nl_process function was getting the count
of the total number of ctx's processed.  This leads
to after having processed 1 context to always signal
the dataplane that there is work to do.  Change the
code to only notify the dplane worker when a context
was actually added to the outgoing context queue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
6 months agotopotest: add bgp_bmp_vrf topotest
Louis Scalbert [Wed, 28 Feb 2024 13:12:19 +0000 (14:12 +0100)]
topotest: add bgp_bmp_vrf topotest

Add test to check BMP in VRF.

Note that the following configuration works with interface r1-eth0
towards 192.0.2.10 (BMP collector) in the default VRF but not in vrf1.

> router bgp 65501 vrf vrf1
>  bmp targets bmp1
>   bmp connect 192.0.2.10 port 1789 min-retry 100 max-retry 10000

Also, for some reasons, the test works even without "bgpd: bmp loc-rib
peer up/down for vrfs" commit.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agotopotests: check for bmp peer up/down messages
Louis Scalbert [Wed, 28 Feb 2024 13:07:06 +0000 (14:07 +0100)]
topotests: check for bmp peer up/down messages

Check for bmp peer up / down  messages

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agotopotests: add peer down log in bmp collector
Louis Scalbert [Wed, 28 Feb 2024 12:51:50 +0000 (13:51 +0100)]
topotests: add peer down log in bmp collector

Add peer down log in bmp collector

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
6 months agotopotests: log bmp peer up message type in collector
Louis Scalbert [Wed, 28 Feb 2024 12:50:50 +0000 (13:50 +0100)]
topotests: log bmp peer up message type in collector

Log "peer up" message type in BMP collector logs.

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