]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
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: 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 agoisisd: fix 'show isis route' and 'show isis fast-reroute summary' errors with vrf 17174/head
baozhen-H3C [Mon, 21 Oct 2024 08:20:27 +0000 (16:20 +0800)]
isisd: fix 'show isis route' and 'show isis fast-reroute summary' errors with vrf

When the VRF does not exist, the command will display results for the 'default' VRF.
1.before the commit:
sonic# show vrf
vrf Vrf1 id 41 table 1001
sonic# show isis vrf abc route level-1
Area 10:
IS-IS L1 IPv4 routing table:

Prefix          Metric  Interface  Nexthop   Label(s)
-------------------------------------------------------
0.0.0.0/0       5       Ethernet0  10.1.1.2  -
6.6.6.6/32      10      -          -         -

sonic# show isis vrf abc fast-reroute summary level-1
Area 10:
IS-IS L1 IPv4 Fast ReRoute summary:

Protection \ Priority     Critical  High      Medium    Low       Total
--------------------------------------------------------------------------
Classic LFA               0         0         2         3         5
Remote LFA                0         0         0         0         0
Topology Independent LFA  0         0         0         0         0
ECMP                      0         0         0         0         0
Unprotected               0         0         2         2         4
Protection coverage       0.00%     0.00%     50.00%    60.00%    55.56%

2.after the commit:
sonic# show vrf
vrf Vrf1 id 41 table 1001
sonic# show isis vrf abc route level-1
sonic# show isis vrf abc fast-reroute summary level-1

What I do:
    Move 'ISIS_FIND_VRF_ARGS(argv, argc, idx, vrf_name, all_vrf);' to the front, otherwise changing 'idx' while searching for other parameters may result in failing to find the vrf parameter.

Signed-off-by: baozhen-H3C <bao.zhen@h3c.com>
6 months agobgpd: fix AIGP calculation in route advertisement 17168/head
Enke Chen [Tue, 22 Oct 2024 01:03:08 +0000 (18:03 -0700)]
bgpd: fix AIGP calculation in route advertisement

Currently the AIGP is always incremented when a route with the
attribute is advertised. That is incorrect when the nexthop is
unchanged, as is commonly the case in route reflection.

Adjust the AIGP for propagation only when the nexthop is set
to ourselves.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
6 months agotests: add a topotest bgp_aigp_rr
Enke Chen [Tue, 22 Oct 2024 00:49:19 +0000 (17:49 -0700)]
tests: add a topotest bgp_aigp_rr

In this topotest, the route reflector advertises a route with the
aigp attribute to its client, some with the nexthop unchanged and
some with the nexthp changed. Different aigp values are sent to
the clients depending on the nexthop setting.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
6 months agoMerge pull request #17172 from opensourcerouting/fix/doc_unified_config
Jafar Al-Gharaibeh [Mon, 21 Oct 2024 18:40:48 +0000 (13:40 -0500)]
Merge pull request #17172 from opensourcerouting/fix/doc_unified_config

doc: Require unified config for all new topotests

6 months agodoc: Require unified config for all new topotests 17172/head
Donatas Abraitis [Mon, 21 Oct 2024 06:10:13 +0000 (09:10 +0300)]
doc: Require unified config for all new topotests

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agoMerge pull request #17169 from enkechen-panw/aigp-fix4
Donatas Abraitis [Mon, 21 Oct 2024 05:18:17 +0000 (08:18 +0300)]
Merge pull request #17169 from enkechen-panw/aigp-fix4

bgpd: allow value 0 in aigp-metric setting

6 months agobgpd: allow value 0 in aigp-metric setting 17169/head
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 17167/head
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 agozebra: remove useless code 17166/head
anlan_cs [Sat, 19 Oct 2024 05:32:49 +0000 (13:32 +0800)]
zebra: remove useless code

Signed-off-by: anlan_cs <anlan_cs@126.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 agotests: Check if BGP no-export community is passed to BGP OAD peers 17165/head
Donatas Abraitis [Fri, 18 Oct 2024 19:51:37 +0000 (22:51 +0300)]
tests: Check if BGP no-export community is passed to BGP OAD peers

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
6 months agobgpd: Do not filter no-export community for BGP OAD (one administration domain)
Donatas Abraitis [Fri, 18 Oct 2024 19:35:28 +0000 (22:35 +0300)]
bgpd: Do not filter no-export community for BGP OAD (one administration domain)

OAD is treated as an _internal_ BGP peer, and some of the rules (including BGP
attributes) can be relaxed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
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 17164/head
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 17157/head
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 17025/head
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 17154/head
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 17134/head
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 17091/head
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 16452/head
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 17136/head
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 17065/head
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 17126/head
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() 17116/head
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 15586/head
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 17114/head
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 17076/head
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 17038/head
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 17107/head
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 17106/head
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 17104/head
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 17103/head
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 17099/head
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 17101/head
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>