Commit graph

425 commits

Author SHA1 Message Date
Mark Stapp 098d692b6f *: expose and clean up 'noreturn' functions
Enable the -Wmissing-noreturn warning, and resolve warnings
for gcc and clang. Add a FRR_NORETURN macro and use that for
the new changes.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-24 13:41:23 -04:00
Mark Stapp 2d42318625 bfdd, bgpd: clean up clang warnings
Clean up some clang compiler warnings.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-16 13:50:21 -04:00
Russ White e190163413
Merge pull request #18592 from zmw12306/bfd_set_shutdown
bfdd: Set bfd.LocalDiag when transitioning to AdminDown
2025-04-15 11:34:28 -04:00
Donald Sharp 86f66afc52
Merge pull request #18586 from zmw12306/bfd_find_disc
bfdd: Fix demultiplexing to rely solely on Your Discriminator
2025-04-10 10:30:05 -04:00
Mark Stapp 2d32ad6aa9 bfdd: clean up -Wshadow warnings
Clean up various variable-shadow warnings in bfdd.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-08 14:41:27 -04:00
zmw12306 b70f973834 bfdd: Set bfd.LocalDiag when transitioning to AdminDown
RFC 5880 6.8.16, need to set LocalDiag when transitioning to AdminDown state.

Signed-off-by: zmw12306 <zmw12306@gmail.com>
2025-04-06 16:13:32 -04:00
zmw12306 b2ab620121 bfdd: Fix demultiplexing to rely solely on Your Discriminator as per RFC 5880.
According to RFC 5880 Section 6.3, once the remote peer reflects back the local discriminator, the receiver MUST demultiplex subsequent BFD packets based solely on the Your Discriminator field. The source IP or interface MUST NOT be used in demultiplexing once the session is established.

Signed-off-by: zmw12306 <zmw12306@gmail.com>
2025-04-05 19:02:31 -04:00
Acee Lindem aa50f5ebb8 bfdd: Add BFD "log-session-changes" feature.
Add the BFD "log-session-changes" via the YANG and northbound API. Also
add the configured value to show and operational state.

Signed-off-by: Acee Lindem <acee@lindem.com>
2025-03-03 22:46:01 +00:00
Mark Stapp 6d14b169e6
Merge pull request #18125 from donaldsharp/bfd_fd_zero
bfdd: 0 is a valid fd.
2025-02-12 14:21:42 -05:00
Jafar Al-Gharaibeh acd10af3fb
Merge pull request #18026 from donaldsharp/bfd_fixups
Bfd fixups
2025-02-12 12:00:23 -06:00
Donald Sharp 7535465284 bfdd: 0 is a valid fd.
It's unlikely that this would ever get a 0 fd to use
but let's just let the code assume it is ok.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-12 10:33:22 -05:00
David Lamparter 5bc4309b61 bfdd: use lower lateness warning for TX timers
FRR's event loop prints a warning if a timer is executed more than some
given threshold late, default being 4s.  Set a more appropriate
threshold for BFD TX timers (half TX interval).

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-02-11 12:16:11 +01:00
Donald Sharp 8119e167b0 bfdd: Use pass by reference for bfd_key_delete
Coverity is pointing out that bfd_key_delete is
passing by value instead of reference for a very
large structure.  Double plus not good.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-05 08:47:31 -05:00
Donald Sharp 6d80d0c595 bfdd: Use pass by reference instead of pass by value for a struct
The function bfd_key_lookup is currently sending by value for
a now very large structure.  Let's convert this over to pass
by reference.  This is noticed by coverity.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-05 08:42:00 -05:00
wumu.zsl e766b68a18 bfdd: Fix CI build issue on kernel with no IPV6_HDRINCL
Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-23 03:25:02 +00:00
wumu.zsl 0ef6003167 bfdd: add bfdname info when notify bfd status to PTM
Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-23 02:59:55 +00:00
wumu.zsl 3548b3004d bfdd: enable sbfd session
1) create socket to send sbfd packets
2) integrate sbfd logic with existing BFD

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-23 02:59:09 +00:00
wumu.zsl c58cbb2c44 bfdd: add sbfd state machine functions
Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-23 02:58:46 +00:00
wumu.zsl e6a531d092 bfdd: implement functions for sending sbfd pkts with SRv6 header
Two types of sbfd packets are supported: initiator packet and echo packet

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-23 02:57:12 +00:00
wumu.zsl 5107e273d0 bfdd: create a hash table for local sbfd reflector info
Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-23 02:32:03 +00:00
wumu.zsl 868c4d02e6 bfdd: adjust show commands for SBFD
Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-23 02:31:36 +00:00
wumu.zsl 311f5d40e3 bfdd: add sbfd config commands to bfdd cli
Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-23 02:31:11 +00:00
wumu.zsl e58f018e43 bfdd: implement Xpath callbacks for SBFD
Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-23 02:30:44 +00:00
wumu.zsl 12af5e19a1 bfdd: support sbfd session create and destroy
refactor bfd_session_create and bfd_session_destroy to support SBFD

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-23 02:29:09 +00:00
wumu.zsl c4f9964aec bfdd: add bfdname in bfd_key
sbfd will use bfdname for key hash, We introduced a bfd-name for every sbfd session, normal BFD sessions can leave it as NULL.
A unique bfd-name can be used to identify a sbfd session quickly. This is quite useful in our Srv6 deployment for path protection case.
For example, if use the sbfd session to protect the SRv6 path A-B-D, we would assign the name 'path-a-b-d' or 'a-b-d' to the session.

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-22 15:00:24 +00:00
wumu.zsl 32705fe720 bfdd: add enum bfd_mode_type for different bfd types
Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-01-07 03:31:56 +00:00
Russ White e268fc4665
Merge pull request #16987 from opensourcerouting/bfd-echo-sock
bfdd: disable echo socket when not using it
2024-11-26 08:51:07 -05:00
Mark Stapp f511530788 bfdd: retain remote dplane client socket
When using bfd in remote-dataplane client mode, don't close
a new client socket if we're going to try to use it.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-11-19 14:54:06 -05:00
Rafael Zalamena 20c3756f30 bfdd: disable echo socket when not using it
Lets avoid a performance penalty in forwarding when not using the BFD
echo feature. The echo socket uses raw packet capturing along with a BPF
filter which causes performance issues.

While here change code to use `-1` for closed sockets instead of valid
FD number `0`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-11-12 23:03:20 -03:00
Philippe Guibert 244155ac47 bfdd, doc, yang: change bfd timer and multiplier values
The minimum and maximum values for BFD timers and multiplier settings
have been updated to align with RFC 5880 requirements.

Since the values inputted via VTY are in milliseconds, the maximum
permissible value on the VTY interface is 4,294,967 milliseconds.

For the multiplier setting, the minimum value is now restricted to be
greater than zero, as zero is not allowed.

The minimum transmit interval has been set to 10 milliseconds to ensure
reliable service performance.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-08 10:32:16 +02:00
Louis Scalbert b5a23c029c bfdd: add no variants to all configurations
Continue the work of b70835d690 ("bfdd: add no variants to interval
configurations")

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-10-03 13:09:56 +02:00
Rafael Zalamena b70835d690 bfdd: add no variants to interval configurations
Add missing no commands to various interval configurations.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-10-01 18:58:24 -03:00
Rafael Zalamena 88a9aa9c6b bfdd: remove control socket obsolete code
Let's remove the obsolete BFD control socket. If the functionality is
needed then YANG/northbound notifications / getting should be used
instead.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-07-25 10:37:11 -03:00
sri-mohan1 d9e51c6399 bfdd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2024-07-16 15:30:41 +05:30
Igor Ryzhov d315382d47 bfdd: fix BFD_GETCBIT
The macro should check C bit, not F bit.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-15 01:57:16 +03:00
Igor Ryzhov b6e6656a2e
Merge pull request #15697 from zmw12306/bfd_check_Mflag
bfdd: Add check for flag Multipoint (M)
2024-04-12 16:09:43 +03:00
zmw12306 665ec41339 bfdd: add check for flag M
Signed-off-by: zmw12306 <zmw12306@gmail.com>
2024-04-11 20:30:56 -04:00
Mark Stapp 72b31b96fc *: create a single registry of daemons' default port values
Create a single registry of default port values that daemons
are using. Most of these are vty ports, but there are some
others for features like ospfapi and zebra FPM.

Signed-off-by: Mark Stapp <mjs@labn.net>
2024-02-01 11:40:02 -05:00
David Lamparter 634f481113 *: fix frr_daemon_info indentation
clang-format doesn't understand FRR_DAEMON_INFO is a long macro where
laying out items semantically makes sense.

(Also use only one `FRR_DAEMON_INFO(` in isisd so editors don't get
confused with the mismatching `( ( )`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-27 19:02:51 +01:00
David Lamparter 80b6787e27 build: nuke BFDD_CONTROL_SOCKET
This just unnecessarily complicates things by involving autoconf.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-27 19:01:19 +01:00
Donald Sharp c6d94a7056 *: zebra.h should not have fcntl.h
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-09 12:50:40 -05:00
Donald Sharp 848dcf3d03 *: remove sys/stat.h from zebra.h
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-09 12:39:23 -05:00
Donald Sharp 2700519cb3 *: Remove sys/ioctl.h from zebra.h
Practically no-one uses this and ioctls are pretty much
wrappered.  Further wrappering could make this even better.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:42:17 -05:00
Christian Hopps 2c01083d35 lib: all: remove './' from xpath 22% speedup
fixes #8299

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-29 14:37:23 -05:00
Christian Hopps bb6fe6beb9
Merge pull request #14811 from donaldsharp/zebra_final_shutdown_finally
Zebra final shutdown finally
2023-11-28 20:14:42 +01:00
Donald Sharp a3dfb08662 bfdd: Free zclient memory on shutdown
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-21 12:41:18 -05:00
Donald Sharp 07b91ca096 *: Let's use the native IFNAMSIZ instead of INTERFACE_NAMSIZ
INTERFACE_NAMSIZ is just a redefine of IFNAMSIZ and IFNAMSIZ
is the standard for interface name length on all platforms
that FRR currently compiles on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-21 08:08:29 -05:00
Donald Sharp 315aa6cde4 *: Remove netlink headers from lib/zebra.h
The headers associated with netlink code
really only belong in those that need it.
Move these headers out of lib/zebra.h and
into more appropriate places.  bgp's usage
of the RT_TABLE_XXX defines are probably not
appropriate and will be cleaned up in future
commits.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-07 06:46:19 -05:00
David Lamparter d889055d8e lib: convert if_zapi_callbacks into actual hooks
...so that multiple functions can be subscribed.

The create/destroy hooks are renamed to real/unreal because that's what
they *actually* signal.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-11-02 17:10:43 -07:00
anlan_cs b580c52698 *: remove ZEBRA_INTERFACE_VRF_UPDATE
Currently when one interface changes its VRF, zebra will send these messages to
all daemons in *order*:
    1) `ZEBRA_INTERFACE_DELETE` ( notify them delete from old VRF )
    2) `ZEBRA_INTERFACE_VRF_UPDATE` ( notify them move from old to new VRF )
    3) `ZEBRA_INTERFACE_ADD` ( notify them added into new VRF )

When daemons deal with `VRF_UPDATE`, they use
`zebra_interface_vrf_update_read()->if_lookup_by_name()`
to check the interface exist or not in old VRF. This check will always return
*NULL* because `DELETE` ( deleted from old VRF ) is already done, so can't
find this interface in old VRF.

Send `VRF_UPDATE` is redundant and unuseful. `DELETE` and `ADD` are enough,
they will deal with RB tree, so don't send this `VRF_UPDATE` message when
vrf changes.

Since all daemons have good mechanism to deal with changing vrf, and don't
use this `VRF_UPDATE` mechanism.  So, it is safe to completely remove
all the code with `VRF_UPDATE`.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2023-10-07 10:06:39 +08:00