Commit Graph

35617 Commits

Author SHA1 Message Date
Igor Ryzhov
4c500d6952 bgpd: fix missing list add in dampening
One more crash in dampening code...

When bgp_damp_withdraw is called, if there's already a BDI structure,
bgp_damp_info_claim is called to re-assign the bdi->config in case it
was changed. The problem is that bgp_damp_info_claim actually removes
the BDI from the reuse list of the old config and never adds it to the
reuse list of the new config. We must do this to prevent the crash
because all the code assumes that BDI is always in some list.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-05-03 09:29:40 +03:00
Donatas Abraitis
391b4fa7a6 bgpd: Drop double-pointer for bgp_damp_info_free()
This causes a crash using `clear ip bgp dampening <prefix>`.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-03 09:29:40 +03:00
Igor Ryzhov
a1e49ec2c9 bgpd: fix double free in dampening code
bgp_damp_info_unclaim already calls bgp_reuselist_del. We must not call
it again here.

Fixes #9046.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-05-03 09:29:40 +03:00
Donatas Abraitis
6b3486be11 bgpd: Remove useless reuselist_node assignment before while loop
Seems really not necessary pointing to initial value before while loop, where
it's assigned anyway.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2024-05-03 09:29:40 +03:00
sudhanshukumar22
debe0f528c bgpd: clear ip bgp dampening was not triggering the route calculation for the prefix
Description:
    clear ip bgp dampening was not triggering the route
    calculation for the prefix, Due to this prefix are not install in
    RIB(Zebra) and not adv to neighbor

Problem Description/Summary :
    clear ip bgp dampening was not triggering the route
    calculation for the prefix, Due to this prefix are not install in
    RIB(Zebra) and not adv to neighbor

    Fix: When clear ip bgp dampening, route are put for route-calculation as
    that it is install in the Zebra and adv to neighbor.

Signed-off-by: sudhanshukumar22 <sudhanshu.kumar@broadcom.com>
2024-05-03 09:29:40 +03:00
Donald Sharp
b29ef1082d bgpd: Do not output peer doppleganger dampened output
When we are cycling through all peers and looking for
dampening data to dump, do not consider non-configed
peers( dopplegangers ).

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-05-03 09:29:40 +03:00
David Schweizer
22473c4014 bgpd: peer / peer group dampening profiles
Changes implement dampening profiles for peers and peer groups. This is
achieved by introducing the possibility to have multible existing
dampening configurations with their own sets of parameters and lists of
associated paths.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2024-05-03 09:29:38 +03:00
David Schweizer
255b392093 bgpd: vtysh commands for peer/group dampening profiles
Additional cli commands to add dampening profiles to peers / peer groups
and functions to save dampening configurations.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2024-05-03 09:16:30 +03:00
Donatas Abraitis
e411988a86 bgpd: Allow using optional table id for negative no set table X command
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-03 08:58:21 +03:00
David Lamparter
2e84c37460 build: hppa is weird
hppa (yes, HP PA-RISC) apparently creates relocations that refer to
".init+0x12345" for everything, referencing way past the end of the
.init section.  While this is only fallback code hit when XREF_SETUP()
is missing (i.e. the FRRouting.XREF ELF note is absent), try to make it
work anyway.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-05-02 23:03:08 +02:00
David Lamparter
85b09765c4 build: warn/fail on missing XREF_SETUP()
While clippy tries really, really hard to work under adverse conditions,
and this catches missing XREF_SETUP() on almost all CPU architectures,
this doesn't quite work on hppa.  So, make it a warning on *all*
platforms (or error for --enable-dev-build) in order to catch it before
shipping off to Debian's buildd and blowing up there...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-05-02 23:03:08 +02:00
David Lamparter
3ca60d00b1 *: add XREF_SETUP() to libraries and utilites
This is theoretically not needed if neither DEFUNs nor zlog_* calls are
used, except I'm about to turn it into a build error to catch the cases
where it _is_ necessary.  Which is libmgmt_be_nb.la in this case, where
it causes build failures on hppa.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-05-02 23:03:08 +02:00
Donatas Abraitis
e069a1c8d5 bgpd: Fix no set as-path prepend ASNUM...
If entering `no set as-path prepend 1 2 3`, it's warned as unknown command.

Now fixed, and the following combinations work fine:

```
no set as-path prepend
no set as-path prepend last-as
no set as-path prepend last-as 1
no set as-path prepend 1
no set as-path prepend 1 2
```

Fixes: https://github.com/FRRouting/frr/issues/15912

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-02 23:29:42 +03:00
David Lamparter
da3677e719 tools/gcc-plugins: warn for suseconds_t format
The plugin was already catching attempts to print `time_t` without
casting it first (there is no valid printf specifier without a cast),
but `__suseconds64_t` needs the same treatment.  (Probably
`__suseconds_t` too, if it exists, which I'm not sure it does - but that
doesn't matter, the plugin ignores non-existing types.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-05-02 22:26:53 +02:00
David Lamparter
552a0a3a28 lib: fix time_t print without cast
The gcc plugin wasn't warning about printing `suseconds_t` (which is
`time_t`, but in `struct timeval`.)  It needs to be printed with a cast,
just like `time_t`.  Luckily there is only one such usage.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-05-02 22:26:53 +02:00
David Lamparter
afb3020e28
Merge pull request #15837 from acooks-at-bda/dev/fix-deprecated-cares-api 2024-05-02 22:26:16 +02:00
David Lamparter
e509f30510 build: exclude deprecated decls from -Werror
Other parts of the system can change (e.g. libc-ares), making things
deprecated, and then our build fails for no reason inside FRR.  This
shouldn't be an error.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-05-02 22:07:24 +02:00
Donald Sharp
54ea38819f
Merge pull request #15840 from opensourcerouting/ospf6-iftype-connected-fix
ospf6d: fix interface type vs. connected routes updates
2024-05-02 10:22:11 -04:00
Christian Hopps
727633a046 tests: remove reliance on time.sleep
Use proper retry loop to wait for state to converge, not some arbitrary delay.

fixes #15878

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-05-02 06:10:48 -04:00
anlan_cs
8a02942eda zebra: clean up one comment
With the commit `605df8d4`, all real things are moved into dplane.
So the operations mentioned in this comment have nothing to do with
this function `netlink_link_change()`.

Just remove that confusing and useless comment.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-05-02 16:36:01 +08:00
Donatas Abraitis
b469ebc703
Merge pull request #15891 from mjstapp/retry_pathd_sync_conn
pathd: retry label-manager connection asynchronously
2024-05-02 11:18:10 +03:00
David Lamparter
2130575b8c
Merge pull request #15890 from httpstorm/frr-macOS-section.2024-04-30 2024-05-01 16:55:54 +02:00
Mark Stapp
a2f50186f5
Merge pull request #15892 from donaldsharp/parse_attr_problems
zebra: Ensure proper decoding of netlink message
2024-05-01 09:43:11 -04:00
Donatas Abraitis
f58227c91e tests: Check if iBGP session can drop invalid AIGP attribute
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-01 16:33:52 +03:00
Donatas Abraitis
714e5be9a0 bgpd: Ignore validating the attribute flags if path-attribute is configured
E.g. Cisco sends AIGP attribute as transitive, but it's wrong. Hence, the session
is teared down, because of this bgp_attr_flag_invalid() test.

Relax this check if we have `neighbor X path-attribute <discard|treat-as-withdraw>`
configured.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-01 16:01:38 +03:00
Donatas Abraitis
48f5d828e3
Merge pull request #15673 from pguibert6WIND/isis_srv6_usid
lib: fix srv6 locator flags propagated to isis
2024-05-01 08:26:28 +03:00
Donatas Abraitis
b3949f4246
Merge pull request #15874 from pguibert6WIND/bgp_get_sockname_coverity_1585206
bgpd: fix covery ID 1585206
2024-05-01 08:24:31 +03:00
Donald Sharp
26595e3162 zebra: Ensure proper decoding of netlink message
As part of the kernel netlink functionality, it is
possible that a bit of nested attributes can be
passed up.  This attribute has a type value which
is stored in the lower 8 bits and in the upper 8
bits are a couple control flags that can be used.
FRR can parse this data and then just throw away
the value unless we mask off the upper 8 bits.
Let's ensure that it can be properly parsed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-30 14:46:08 -04:00
Mark Stapp
abaad07b98 pathd: clean up a log message
Clean up a typo in a log message.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-04-30 14:34:58 -04:00
Mark Stapp
7a28f78ad9 pathd: retry synchronous label-manager zapi connection
Be prepared to retry setting up pathd's synchronous zapi session
that's used for label-manager.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-04-30 14:33:13 -04:00
Ruben Kerkhof
9824f07b02
lib: fix error on MacOS
Sections use a different syntax for Mach-O executables.

Fixes:

lib/bfd.c:35:1: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment and section separated by a
      comma
DEFINE_MTYPE_STATIC(LIB, BFD_INFO, "BFD info")
^
./lib/memory.h:140:2: note: expanded from macro 'DEFINE_MTYPE_STATIC'
        DEFINE_MTYPE_ATTR(group, name, static, desc)                           \
        ^
./lib/memory.h:110:26: note: expanded from macro 'DEFINE_MTYPE_ATTR'
                __attribute__((section(".data.mtypes"))) = { {                 \
                                       ^
1 error generated.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
2024-04-30 20:24:17 +03:00
Olivier Dugeon
8deba1e48d
Merge pull request #15791 from zhou-run/202404182042
isisd: When the ISIS instance does not exist, the default metric will not be wide.
2024-04-30 16:33:48 +02:00
Olivier Dugeon
5a373ce912
Merge pull request #15653 from pguibert6WIND/link_state_srv6_capas
Link state srv6 capas
2024-04-30 15:39:11 +02:00
David Lamparter
342400e7c6 build: link libatomic if available
It'll generally exist but be empty on systems that don't need it.
(Some 32bit platforms now need it due to 64bit time_t, and the platform
may not have 64bit atomic ops.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-30 14:31:07 +02:00
Bing Shui
d733fe2c04 ospfd:fix the bug where ip_ospf_dead-interval_minimal_hello-multiplier did not reset hello timer
Signed-off-by: Bing Shui <652023330037@smail.nju.edu.cn>
2024-04-30 12:07:11 +00:00
Donatas Abraitis
65c3b1e4c8
Merge pull request #15669 from poojarathore30/listen-limit-logging
bgpd : Ensure logging for dynamic neighbor listen limit reached
2024-04-30 14:54:19 +03:00
Donatas Abraitis
9ebdb8e80d bgpd: Apply NOOP when doing negative commands for GR operations
E.g.:

```
% The Graceful Restart command used is not valid at this moment.
zsh: exit 1     vtysh -c configure -c 'router bgp' -c 'no neighbor 127.0.0.1 graceful-restart
1
```

This does not make sense frr-reload to fail.

Instead, just ignore such requests if they are just NOOP.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-30 13:44:18 +03:00
Donatas Abraitis
7b5595b61d bgpd: Print old/new states of graceful restart FSM
To better debug what's going on before/after.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-30 13:44:17 +03:00
David Lamparter
1badd1941b python: add tool to expand typesafe definitions
This can be used to get less cryptic error/warnings from GCC when
dealing with something typesafe container related.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-29 17:37:49 +02:00
Philippe Guibert
f101108e3e bgpd: fix covery ID 1585206
The return value of bgp_getsockname() should always be
checked.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-29 15:44:24 +02:00
Donald Sharp
65c2593a12
Merge pull request #15619 from opensourcerouting/fix/memory_optimizations
bgpd: Put BGP_DEBUG/CONF_BGP_DEBUG under ulikely() optimization
2024-04-29 09:26:03 -04:00
Donald Sharp
611d6ac0d8
Merge pull request #15834 from pguibert6WIND/alias_path_iproute2
tools: add iproute2 alias for pathd daemon
2024-04-29 09:21:48 -04:00
Donald Sharp
edae839119
Merge pull request #15824 from opensourcerouting/fix/ospf_show_non_default
vtysh: Show `ip ospf network ...` even if it's not the same as the interface type
2024-04-29 09:21:09 -04:00
Donald Sharp
8421f6221a
Merge pull request #15839 from opensourcerouting/ospf6-defun-unwreck
ospf6d: fix DEFUN formatting wrecked by clang
2024-04-29 09:18:32 -04:00
Donald Sharp
edac3efdc5
Merge pull request #15864 from opensourcerouting/fix/graceful_restart_per_neighbor
tests: Check if Graceful Restart per-neighbor works as expected
2024-04-29 09:16:36 -04:00
Donald Sharp
f3720c477e
Merge pull request #15865 from opensourcerouting/fix/drop_duplicate_pytestmark
tests: A bit of housekeeping for topotests
2024-04-29 09:14:52 -04:00
rathorepo
fd8d420999 bgpd : Ensure logging for dynamic neighbor listen limit reached
Dynamic neighbors exceeding the listen limit were rejected without appropriate logging.
Previously, only rejection logs were generated, leaving users unaware of when the limit being reached.
Adding a log message for when the listen limit is reached

Signed-off-by: Pooja Rathore <rathorepo@vmware.com>
2024-04-29 08:33:04 +00:00
Donatas Abraitis
2187b82714
Merge pull request #15670 from poojarathore30/pg-deletion-with-listen-range
bgpd : Prevent deletion of BGP peer groups associated to listen range
2024-04-29 11:29:07 +03:00
Donatas Abraitis
5e9e6bf3ed
Merge pull request #15851 from chiragshah6/fdev2
tools: Handle seq num for BGP as-path in frr-reload.py
2024-04-29 11:28:03 +03:00
Donatas Abraitis
eb769bbc30
Merge pull request #15861 from anlancs/fix-bgpd-dead-code
bgpd: fix the dead code
2024-04-29 11:25:20 +03:00