Commit Graph

37295 Commits

Author SHA1 Message Date
Donald Sharp
11fe070e43
Merge pull request #15915 from opensourcerouting/build-format-suseconds
lib, gcc-plugin: fix 64-bit time_t prints
2024-05-06 10:26:46 -04:00
Donatas Abraitis
af6eeccd75
Merge pull request #15924 from chiragshah6/fdev5
bgpd: [GR] fix mode change vtysh return code
2024-05-06 10:12:27 +03:00
Alexander Rose
84d1285fc2 ospf6d: Redistribute metric for AS-external route
When ospf6d originates an AS-external route that has been read from a kernel
routing table, then the metric of that route was ignored until now.
If a routemap is configured, then this metric will be redistributed from
now on.

Using metric increment and decrement in routemaps is supported by ospf6d now.

Signed-off-by: Alexander Rose <alexander.rose@secunet.com>
2024-05-06 08:51:27 +02:00
Donatas Abraitis
d81740eccd
Merge pull request #15921 from cscarpitta/bgp-fix-srv6-locator-delete-crash
bgpd: Fix crash when deleting the SRv6 locator
2024-05-06 08:51:24 +03:00
anlan_cs
563fa1fdc4 isisd: remove unnecessary check for vrf
The `vrf_name` is always non-NULL in `isisd` code, so remove the
unnecesary check to make it clear.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-05-05 19:08:43 +08:00
Carmine Scarpitta
bdc2c7bc54 bgpd: Fix the order of NULL check and ZAPI decode
When BGP receives an SRV6_LOCATOR_ADD message from zebra, it calls the
`bgp_zebra_process_srv6_locator_add()` function to process the message.
`bgp_zebra_process_srv6_locator_add()` decodes the message first, and
then if the pointer to the default BGP instance is NULL (i.e. the
default BGP instance is not configured yet), it returns early without
doing anything and without using the decoded message information.

This commit fixes the order of the operations executed by
`bgp_zebra_process_srv6_locator_add()`. We first ensure that the default
BGP instance is ready and we return early if it is not. Then, we decode
the message and do something with the information contained in it.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-05-05 07:25:57 +02:00
Chirag Shah
0a8d85aacf bgpd: [GR] fix mode change vtysh return code
When a bgp neighbor graceful-restart config mode change
is applied, after accepting the config if it does not
take effect instead of throwing vtysh error code,
return the success to vtysh and warn the user.
The debug log is already present at critical code point
where GR failure is seen during config apply.

Ticket: #3761481
Testing Done:

root@tor-1:# vtysh -c 'config t' -c 'router bgp 65564
vrf VRF2' -c 'neighbor 20.1.1.1 graceful-restart'
As part of configuring graceful-restart, capability send to zebra failed
root@tor-1:# echo $?
0

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2024-05-04 20:33:49 -07:00
Donatas Abraitis
f34ecf1f8f
Merge pull request #15917 from anlancs/isisd/fix-display-route
isisd: adjust the format of display command
2024-05-04 12:30:17 +03:00
Donatas Abraitis
d0401cb0dc
Merge pull request #15607 from chiragshah6/evpn_dev4
zebra: bridge flap handle vlan membership update
2024-05-04 09:08:04 +03:00
Carmine Scarpitta
ae3241b96d bgpd: Fix crash when deleting the SRv6 locator
When BGP receives a `SRV6_LOCATOR_DEL` from zebra, it invokes
`bgp_zebra_process_srv6_locator_delete` to process the message.

`bgp_zebra_process_srv6_locator_delete` obtains a pointer to the default
BGP instance and then dereferences this pointer.

If the default BGP instance is not ready / not configured yet, this
pointer this pointer is `NULL` and dereferencing it causes BGP to crash.

This commit fix the issue by adding a a check to verify if the pointer
is `NULL` and returning early if it is.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-05-03 23:40:29 +02:00
Chirag Shah
fde6dd7bb9 zebra: fix EVPN svd based remote nh neigh del
In the context of SVD (Single VxLAN Device) for L3VNI,
the remote VTEP's nexthop is programmed neighbor entry against
SVD along with neighbor entry against SVI.

However, when L3VNI is removed or the VRF is disabled, all SVI
based remote nexthop neighbors are uninstalled and deleted.
The SVD based neigh entries remains in Zebra and the Kernel.
Subsequently, when reconfiguring L3VNI and relearning the same nexthop,
the neighbor entry is not programmed is because it is not removed
from Zebra SVD neighbor hash table, leading to the failure to
reprogram the entry.

With this fix, the SVD nexthop neigh entry is uninstalled
and deleted from Zebra and Kernel.

Ticket: #3729045

Testing:

borderleaf:# ip neigh show 2.2.2.2
2.2.2.2 dev vlan2560_l3 lladdr 00:01:00:00:1d:09 extern_learn NOARP proto zebra
2.2.2.2 dev vxlan99 lladdr 00:01:00:00:1d:09 extern_learn NOARP proto zebra

With the fix:

Zebra log shows both enties SVD (vxlan99) and SVI (vlan2560_l3)
neighbor entries are deleted.

2024/05/03 18:41:33.527125 ZEBRA: [NH6N7-54CD1] Tx RTM_DELNEIGH family
ipv4 IF vxlan99(16) Neigh 2.2.2.2 MAC  null flags 0x10 state 0x0
ext_flags 0x0
2024/05/03 18:41:33.527128 ZEBRA: [NH6N7-54CD1] Tx RTM_DELNEIGH family
ipv4 IF vlan2560_l3(18) Neigh 2.2.2.2 MAC  null flags 0x10 state 0x0
ext_flags 0x0

borderleaf:# ip neigh show 2.2.2.2
borderleaf:#

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2024-05-03 12:43:01 -07:00
Chirag Shah
07005288c2 zebra: bridge flap handle vlan membership update
Upon bridge flap, the associated SVD case,
VLAN membership is not updated correctly.
When SVI comes up, the VNI could not associate
with it as bridge VLAN membership was not updated.

Ticket: #3821632

Testing:

Before fix:
-----------
tor-1:#ifdown br_l3vni ; sleep 1 ; ifup br_l3vni
tor-1:# vtysh -c 'show evpn vni 8888'
VNI: 8888
  Type: L3
  Tenant VRF: sym_1
  Vlan: 490
  Bridge: br_l3vni
  Local Vtep Ip: 27.0.0.9
  Vxlan-Intf: vxlan99
  SVI-If: None    <<<<<< SVI not found
  State: Down     <<<<<< status remained in down BGP is not informed
  VNI Filter: none
  System MAC: None
  Router MAC: None
  L2 VNIs: 1800 1801 1900 1901

After fix:
----------

tor-1:# ifdown br_l3vni; sleep 1; ifup br_l3vni
tor-1:# vtysh

Hello, this is FRRouting (version 8.4.3).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

tor-1# show evpn vni 8888
VNI: 8888
  Type: L3
  Tenant VRF: sym_1
  Vlan: 490
  Bridge: br_l3vni
  Local Vtep Ip: 27.0.0.9
  Vxlan-Intf: vxlan99
  SVI-If: vlan490_l3 <<<<<<
  State: Up          <<<<<<
  VNI Filter: none
  System MAC: 44:38:39:ff:ff:29
  Router MAC: 44:38:39:ff:ff:29
  L2 VNIs: 1800 1801 1900 1901

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2024-05-03 10:52:33 -07:00
anlan_cs
fa4ad1f347 isisd: adjust the format of display command
Before:
```
anlan# show isis neighbor
Area xx:
  System Id           Interface   L  State        Holdtime SNPA
 0023.0000.0000      enp1s0      2  Down          Expiring2c53.4a30.0820
```

After:
```
anlan# show isis neighbor
Area xx:
 System Id           Interface   L  State         Holdtime SNPA
 0023.0000.0000      enp1s0      2  Down          Expiring 2c53.4a30.0820
```

The `-` display format caused by no hello packet in `isis_adj_print_vty()`
is same as that of above "Expiring".

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-05-03 23:41:36 +08:00
Donald Sharp
53820a5753
Merge pull request #15914 from opensourcerouting/build-deprecated-no-error
build: exclude deprecated decls from -Werror
2024-05-03 10:48:20 -04:00
Donald Sharp
46d7e082d9
Merge pull request #15904 from LabNConsulting/chopps/remsleep
tests: remove reliance on time.sleep
2024-05-03 10:37:47 -04:00
David Lamparter
b4eb7a0374 build: get rid of "unrecognized … anon-tag"
GCC only errors out on unrecognized _positive_ `-Wsomething` flags,
negative ones it ignores... but then prints a "note" about whenever an
unrelated(!) warning/error occurs.  This is both annoying and confusing,
since we now get a lot of:

```
cc1: note: unrecognized command-line option ‘-Wno-microsoft-anon-tag’ may have been intended to silence earlier diagnostics
```

Fix by checking for the positive flag in `AC_C_FLAG` instead, which will
error out, and therefore `-Wno-microsoft-anon-tag` won't be added for
GCC.  (It only exists on clang.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-05-03 10:53:13 +02:00
Donatas Abraitis
75131b43b4
Merge pull request #15901 from anlancs/zebra/fix-one-comment
zebra: clean up one comment
2024-05-03 11:09:29 +03:00
Martin Buck
217e505a67 tests: Modify inter-area ECMP topotest to also test redundant ABRs
So far, this test only convered redundant paths to one ABR, now it checks
redundant paths to redundant ABRs, covering both cases. Useful as a
regression test for #15777.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2024-05-03 09:49:24 +02:00
Martin Buck
b925570981 ospf6d: Fix nexthop computation for inter-area multi-ABR ECMP
Pre-b74e965, we always merged nexthops of old (existing) and new (newly
generated, based on a LSA update) routes, making it impossible to remove
individual nexthops from a route. b74e965 replaced this by copying nexthops
from the new route to the old route. This works as long as the old and new
route are derived from the same LSA (e.g. multiple ECMP paths to the same
ABR). However, in case of multiple parallel ABRs, each of them originates a
LSA and the nexthops derived from them need to be combined to get the proper
route nexthops. So instead of trying to incrementally update the route
nexthops based on the old and new route nexthops, always recompute the route
nexthops by merging all of its path nexthops (which we're already updating
based on the LSA being processed).

Fixes #15777.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2024-05-03 09:49:24 +02:00
Donatas Abraitis
bf37877103 bgpd: Reduce the nesting level for bgp_clear_damp_route()
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-03 09:30:33 +03:00
Donatas Abraitis
709bdcbb23 tests: Check if dampening per-peer works
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-03 09:30:33 +03:00
David Schweizer
b07a21dd1a doc: user doc for route-flap dampening commands
Changes update the user documentation to include a description of the
now available commands to enable/disable route-flap dampening for peers
and peer groups.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-03 09:30:33 +03:00
Donatas Abraitis
3921324346 bgpd: Put dest into work queue when the path is really withdrawn by dampening
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-03 09:30:33 +03:00
Donatas Abraitis
70ac630b39 bgpd: Pass the right reuse_list when handling it via bgp_reuse_timer thread
This fixes the crash:

```
==14759== Invalid read of size 8
==14759==    at 0x31032B: bgp_reuselist_del (bgp_damp.c:51)
==14759==    by 0x310392: bgp_damp_info_unclaim (bgp_damp.c:69)
==14759==    by 0x310CD6: bgp_damp_info_free (bgp_damp.c:387)
==14759==    by 0x311016: bgp_reuse_timer (bgp_damp.c:230)
==14759==    by 0x4F227CC: thread_call (thread.c:2008)
==14759==    by 0x4EDB7D7: frr_run (libfrr.c:1216)
==14759==    by 0x1EF748: main (bgp_main.c:525)
==14759==  Address 0x48 is not stack'd, malloc'd or (recently) free'd
==14759==
==14759==
==14759== Process terminating with default action of signal 11 (SIGSEGV)
==14759==    at 0x59CC7F5: raise (raise.c:46)
==14759==    by 0x4F10CEB: core_handler (sigevent.c:261)
==14759==    by 0x59CC97F: ??? (in /lib/x86_64-linux-gnu/libpthread-2.27.so)
==14759==    by 0x31032A: bgp_reuselist_del (bgp_damp.c:51)
==14759==    by 0x310392: bgp_damp_info_unclaim (bgp_damp.c:69)
==14759==    by 0x310CD6: bgp_damp_info_free (bgp_damp.c:387)
==14759==    by 0x311016: bgp_reuse_timer (bgp_damp.c:230)
==14759==    by 0x4F227CC: thread_call (thread.c:2008)
==14759==    by 0x4EDB7D7: frr_run (libfrr.c:1216)
==14759==    by 0x1EF748: main (bgp_main.c:525)
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-03 09:30:33 +03:00
Donatas Abraitis
f8e6b7ce45 bgpd: Use SLIST_FOREACH_SAFE when iterating over the list in bgp_reuse_timer
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-03 09:30:33 +03:00
Igor Ryzhov
471e373c17 bgpd: fix missing damp info free when cleaning bgp path
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-05-03 09:30:33 +03:00
Igor Ryzhov
ad97cd00a6 bgpd: cleanup bgp_damp_info_free
bgp_damp_config, afi and safi are never used.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-03 09:30:33 +03:00
Igor Ryzhov
1d37871588 bgpd: fix incorrect usage of slist in dampening
Current code is a complete misuse of SLIST structure. Instead of just
adding a SLIST_ENTRY to struct bgp_damp_info, it allocates a separate
structure to be a node in the list.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-05-03 09:30:32 +03:00
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