Commit graph

492 commits

Author SHA1 Message Date
Russ White a710f4bdb7
Merge pull request #18417 from AndriiFullroot/VyOS_T7226
ldpd: Option for disabled LDP hello message during TCP
2025-04-29 11:11:35 -04:00
Donald Sharp d7e19c604f *: Allow returns to work with --enable-undefined-behavior
If you have undefined behavior compilation checking gcc
starts to complain about a bunch of places that do not
have return's.  When most of them actually do and we
have the assert's to prove it.  I'm just doing this
to make the compiler happy for me, so I can continue
to do work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-04-28 14:05:28 -04:00
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 1378ebf640 ldpd: clean up warnings from -Wshadow
Clean up various variable-shadow warnings in ldpd.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-08 14:41:27 -04:00
Andrii Melnychenko 8087be8e70 ldpd: Option for disabled LDP hello message during TCP
Added option "disable-establish-hello" that disableds
sending additional LDP hello multicast messages during
TCP session establishment.
This option enables per interface: "(config-ldp-af-if)".

Signed-off-by: Andrii Melnychenko <a.melnychenko@vyos.io>
2025-03-25 14:52:20 +01:00
David Lamparter 74b9f0ae74 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>
2024-10-16 13:30:25 +02:00
anlan_cs 1919df3a64 ldpd: fix wrong gtsm count
In linux networking stack, the received mpls packets will be processed
by the host *twice*, one as mpls packet, the other as ip packet, so
its ttl decreased 1.

So, we need release the `IP_MINTTL` value if gtsm is enabled, it is for the
mpls packets of neighbor session caused by the command:
`label local advertise explicit-null`.

This change makes the gtsm mechanism a bit deviation.

Fix PR #8313

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2024-06-15 23:30:18 +08:00
Donald Sharp 73ad64a6f4 *: Modify agentx to be allowed to be called
If you had a situation where an operator turned on
ospfd with snmp but not ospf6d and agentx was configured
then you get into a situation where ospf6d would complain
that the config for agentx did not exist.  Let's modify
the code to allow this situation to happen.

Fixes: #15896
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-05-10 10:16:29 -04:00
David Lamparter 95a737ed1b ldpd: use zlog recirculation for subprocesses
This way, full functionality of `zlog_*` is available.

Having `fatal()` be wrappers around `assertf()` also means we get
backtraces, which is not the case for a plain `exit(1)`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-03-10 12:42:14 +01: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 0f79e6b876 build: nuke LDPD_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 8049f74fc6 lib: zebra.h is not using signal.h
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-09 12:50:40 -05: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 0dc7704fd5
Merge pull request #14867 from opensourcerouting/zclient-options-cleanup
*: clean up `zclient` options
2023-11-25 09:15:07 -05:00
David Lamparter cc90c54b36 *: add zclient_options_sync
... and use it instead of fiddling with the `.synchronous` field.

(Make it const while at it.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-11-23 15:20:13 +01:00
David Lamparter 8b23c0b0bd *: convert struct interface->connected to DLIST
Replace `struct list *` with `DLIST(if_connected, ...)`.

NB: while converting this, I found multiple places using connected
prefixes assuming they were IPv4 without checking:

- vrrpd/vrrp.c: vrrp_socket()
- zebra/irdp_interface.c: irdp_get_prefix(), irdp_if_start(),
  irdp_advert_off()

(these fixes are really hard to split off into separate commits as that
would require going back and reapplying the change but with the old list
handling)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-11-22 23:00:30 +01: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
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
Donald Sharp f024e4db71 ldpd: Clarify error situation for different problems
Clarify the fatal error message recorded when an error situation
happens.  Disambiguating the default case from the TLV_TYPE_DYNAMIC_CAP
case.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-10-13 13:48:43 -04:00
Igor Ryzhov 7d67b9ff28 build: add -Wimplicit-fallthrough
Also:
- replace all /* fallthrough */ comments with portable fallthrough;
pseudo keyword to accomodate both gcc and clang
- add missing break; statements as required by older versions of gcc
- cleanup some code to remove unnecessary fallthrough

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-10-12 21:23:18 +03:00
Donatas Abraitis a5c9e190be ldpd: Stop and free synchronous Zebra client on destroy
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-06-27 11:47:50 +03:00
sri-mohan1 8443d112b3 ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-06-14 16:42:26 +05:30
sri-mohan1 b0eea1202c ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-06-06 14:37:59 +05:30
sri-mohan1 4e60d88ee1 ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-06-06 00:58:49 +05:30
sri-mohan1 233b5d0f2e ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-06-05 10:53:27 +05:30
sri-mohan1 a3b7872c66 ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-06-01 13:30:35 +05:30
sri-mohan1 bcffa75902 ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-05-23 23:20:01 +05:30
sri-mohan1 badb1dad2e ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-05-09 18:45:27 +05:30
sri-mohan1 0352223846 ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-05-08 15:28:50 +05:30
sri-mohan1 e75e1553fa ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-05-07 21:00:52 +05:30
sri-mohan1 91cde6087d ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-05-06 19:52:34 +05:30
sri-mohan1 849d8f2bbd ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-05-05 23:41:01 +05:30
Donatas Abraitis 9b00c0a165
Merge pull request #13113 from sri-mohan1/sri-mohan-ldp
ldpd: changes for code maintainability
2023-03-28 19:14:27 +03:00
sri-mohan1 248d33434e ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-03-27 12:27:01 +05:30
Donald Sharp 24a58196dd *: Convert event.h to frrevent.h
We should probably prevent any type of namespace collision
with something else.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp cd9d053741 *: Convert struct event_master to struct event_loop
Let's find a better name for it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp e16d030c65 *: Convert THREAD_XXX macros to EVENT_XXX macros
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp 2453d15dbf *: Convert struct thread_master to struct event_master and it's ilk
Convert the `struct thread_master` to `struct event_master`
across the code base.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp 4f830a0799 *: Convert thread_timer_remain_XXX to event_timer_remain_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp de2754be3a *: Convert thread_fetch and thread_call to event_fetch and event_call
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp 907a2395f4 *: Convert thread_add_XXX functions to event_add_XXX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp e6685141aa *: Rename struct thread to struct event
Effectively a massive search and replace of
`struct thread` to `struct event`.  Using the
term `thread` gives people the thought that
this event system is a pthread when it is not

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp cb37cb336a *: Rename thread.[ch] to event.[ch]
This is a first in a series of commits, whose goal is to rename
the thread system in FRR to an event system.  There is a continual
problem where people are confusing `struct thread` with a true
pthread.  In reality, our entire thread.c is an event system.

In this commit rename the thread.[ch] files to event.[ch].

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:16 -04:00
mobash-rasool 32701c48d8
Merge pull request #12920 from sri-mohan1/sri-mohan-ldp
ldpd: changes for code maintainability
2023-03-02 00:40:26 +05:30
sri-mohan1 2073f92908 ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-03-01 17:24:54 +05:30
Donald Sharp 941778e854
Merge pull request #12863 from sri-mohan1/sri-mohan-ldp
ldpd: changes for code maintainability
2023-02-22 12:14:23 -05:00
sri-mohan1 575f30cea0 ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-02-22 15:08:50 +05:30
Russ White ba6db59781
Merge pull request #12851 from sri-mohan1/sri-mohan-ldp
ldpd: changes for code maintainability
2023-02-21 08:28:28 -05:00