Commit Graph

35399 Commits

Author SHA1 Message Date
Christian Hopps
c54bc7a8dd
Merge pull request #15594 from idryzhov/mgmt-rpc
mgmtd: implement YANG RPC/action support
2024-05-06 16:05:50 -04:00
Donald Sharp
216bac2826
Merge pull request #15902 from opensourcerouting/build-xref-setup-hppa
build: fix missing `XREF_SETUP` (and HP PA-RISC build failure)
2024-05-06 10:29:05 -04:00
Donald Sharp
9de2f138f0
Merge pull request #15889 from opensourcerouting/build-libatomic
build: link libatomic if available
2024-05-06 10:27:33 -04:00
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
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
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
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
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
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
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
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
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
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