Commit Graph

35617 Commits

Author SHA1 Message Date
Philippe Guibert
ce614c2971 tools: add iproute2 alias for pathd daemon
With SRv6 traffic engineering, some ipv6 routes will
be installed by the Pathd daemon.
Populate the iproute2 aliasing table with pathd.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-29 08:20:37 +02:00
Donatas Abraitis
422e0dd256 tests: Apply black formatting from what frrbot suggested to be happy
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-28 12:51:22 +03:00
Donatas Abraitis
2ea6d2cca0 tests: Add missing check_router_status for bgp_tcp_mss test
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-28 12:51:22 +03:00
Donatas Abraitis
9ca4bbd069 tools: Add black formatting commit to .git-blame-ignore-revs
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-28 12:50:51 +03:00
Donatas Abraitis
1a1c2a9f84 tests: Apply black formatting for all tests/topotests
It's just annoying when the linter tells to apply the formatting for the code
you didn't touch.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-27 23:19:32 +03:00
Donatas Abraitis
086df4bfaa tests: Drop duplicate pytestmark per file
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-27 23:18:15 +03:00
Donatas Abraitis
ede5f5092a tests: Drop debug statements from bgp_gr_restart_retain_routes
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-27 23:09:40 +03:00
Donatas Abraitis
e41012bebe tests: Check if Graceful Restart per-neighbor works as expected
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-27 23:06:19 +03:00
Donatas Abraitis
1c1de46878 tests: Use a single frr.conf for bgp_gr_restart_retain_routes
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-27 23:00:36 +03:00
Donatas Abraitis
5f059e0c7d
Merge pull request #15854 from mjstapp/dump_outofsync_flag
lib: add ZEBRA_FLAG_OUTOFSYNC to dump_flags function
2024-04-27 21:16:49 +03:00
rathorepo
48faeafe16 bgpd : Prevent deletion of BGP peer groups associated to listen range
Description:
-----
Deleting a peer group also deletes its associated BGP listen range.
This behaviour is undesired as it could cause unintended configuration changes.

Fix :
-----
-Do not allow peer group deletion until they are no longer associated with any listen range.
-Check the count of listen ranges attached to the group.
If any listen ranges are found, returns a configuration warning, preventing the deletion.

Signed-off-by: Pooja Rathore <rathorepo@vmware.com>
2024-04-27 16:44:26 +00:00
anlan_cs
e942d1f6a2 bgpd: fix the dead code
Fixed the Coverity issue 1586018:
Control flow issues (DEADCODE) /bgpd/bgp_ecommunity.c: 1402 in ecommunity_ecom2str()

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-04-28 00:05:36 +08:00
Russ White
1a9c3a710d
Merge pull request #15782 from opensourcerouting/fix/drop_srte_color_flag
bgpd: Drop SRTE_COLOR attribute flag
2024-04-27 08:19:09 -04:00
Jafar Al-Gharaibeh
3ab578d504
Merge pull request #15848 from donaldsharp/pim_crash_dnode
pimd: fix crash unconfiguring rp keepalive timer
2024-04-26 22:28:10 -05:00
Donatas Abraitis
24a9f1c9ae
Merge pull request #15796 from LabNConsulting/aceelindem/ospf-ospfapi-options
ospfd: OSPFAPI Server options to limit to local connections and per-instance TCP
2024-04-26 23:31:38 +03:00
Donatas Abraitis
223eda3d00
Merge pull request #15759 from anlancs/doc-isisd-cleanup-1
doc: clean up a few commands for isis
2024-04-26 23:29:58 +03:00
Donatas Abraitis
524e08c4d6
Merge pull request #15737 from vjardin/cmake_install_prefix
cmake install prefix
2024-04-26 23:29:29 +03:00
Donatas Abraitis
03a4765cda
Merge pull request #15841 from pguibert6WIND/dx6_support
zebra, sharpd: add srv6 End.DX6 support
2024-04-26 23:25:34 +03:00
Donatas Abraitis
d3c556652a
Merge pull request #15845 from pguibert6WIND/bmp_improvements
Bmp improvements about statistics
2024-04-26 23:24:54 +03:00
Mark Stapp
c943b71c9f lib: add ZEBRA_FLAG_OUTOFSYNC to dump_flags function
Right where the zapi route flags are defined, there's a comment
asking that the flag-dumper-function also be updated.

Also apply clang-format's preferences, so next person won't have
to.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-04-26 14:48:00 -04:00
Russ White
f19817f71d
Merge pull request #15723 from opensourcerouting/feature/extended_link_bw_refactored_v1
bgpd: Implement extended link-bandwidth
2024-04-26 14:41:05 -04:00
Louis Scalbert
bb46027596 zebra: fix fpm_listener compilation
I don't know why it appears only now.

> ../sdist/zebra/fpm_listener.c:420:8: error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
>                 if (!RTNH_OK(rtnh, len)) {
>                      ^~~~~~~~~~~~~~~~~~
> ../sdist/include/linux/rtnetlink.h:437:31: note: expanded from macro 'RTNH_OK'
>                            ((int)(rtnh)->rtnh_len) <= (len))

len is set with RTA_PAYLOAD and should be an integer.

> len = RTA_PAYLOAD(mpath_rtattr);
> #define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0))

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-26 17:11:53 +02:00
Louis Scalbert
efbf234510 topotests: add lower_up to expected interface flags
Add lower_up to expected interface flags.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-26 17:11:53 +02:00
Louis Scalbert
c85ce39fe0 lib: take into account the iff_lower_up flag
In Linux, a network driver can set the interface flags IFF_UP and
IFF_RUNNING although the IFF_LOWER_UP flag is down, which means the
interface is ready but the carrier is down:

> These values contain interface state:
>
> ifinfomsg::if_flags & IFF_UP:
>  Interface is admin up
> ifinfomsg::if_flags & IFF_RUNNING:
>  Interface is in RFC2863 operational state UP or UNKNOWN. This is for
>  backward compatibility, routing daemons, dhcp clients can use this
>  flag to determine whether they should use the interface.
> ifinfomsg::if_flags & IFF_LOWER_UP:
>  Driver has signaled netif_carrier_on()

However, FRR considers an interface is operational as soon it is up
(IFF_UP) and running (IFF_RUNNING), disregarding the IFF_LOWER_UP flag.
This can lead to a scenario where FRR starts adding routes through an
interface that is technically down at the carrier level, resulting in
kernel errors.

> Jan 02 18:07:18 dut-vm zebra[283731]: [WVJCK-PPMGD][EC 4043309093] netlink-dp (NS 0) error: Network is down, type=RTM_NEWNEXTHOP(104), seq=243, pid=3112881162
> Jan 02 18:07:18 dut-vm zebra[283731]: [X5XE1-RS0SW][EC 4043309074] Failed to install Nexthop (318[if 164]) into the kernel
> Jan 02 18:07:18 dut-vm zebra[283731]: [HSYZM-HV7HF] Extended Error: Carrier for nexthop device is down
> Jan 02 18:07:18 dut-vm zebra[283731]: [WVJCK-PPMGD][EC 4043309093] netlink-dp (NS 0) error: Network is down, type=RTM_NEWNEXTHOP(104), seq=245, pid=3112881162
> Jan 02 18:07:18 dut-vm zebra[283731]: [HSYZM-HV7HF] Extended Error: Nexthop id does not exist
> Jan 02 18:07:18 dut-vm zebra[283731]: [WVJCK-PPMGD][EC 4043309093] netlink-dp (NS 0) error: Invalid argument, type=RTM_NEWROUTE(24), seq=246, pid=3112881162
> Jan 02 18:07:18 dut-vm zebra[283731]: [X5XE1-RS0SW][EC 4043309074] Failed to install Nexthop (320[10.125.0.2 if 164]) into the kernel
> Jan 02 18:07:18 dut-vm zebra[283731]: [VYKYC-709DP] default(0:254):0.0.0.0/0: Route install failed

Consider an interface is operational when it has the IFF_UP, IFF_RUNNING
and IFF_LOWER_UP flags.

Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/operstates.rst?h=v6.7-rc8#n29
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/ipv4/nexthop.c?h=v6.7-rc8#n2886
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/netdevice.h?h=v6.7-rc8#n4198
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-26 17:11:53 +02:00
Louis Scalbert
57b9ecf3f9 build: include our own copy of if.h and dependencies
Import our a copy of Linux if.h and its dependencies
(compiler_types.h and libc-compat.h) from the above links. In "if.h",
"#include <linux/compiler.h>" has been replaced by
"#include <linux/compiler_types.h>". libc-compat.h is needed to avoid
conflicts with glibc.

Include "linux/if.h" in "zebra.h" when compiling on Linux. De-reference
"net/if.h" in C files.

Note that "net/if.h" is still needed. It is even included in many Linux
kernel files. "linux/if.h" provides additional definitions.

Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/include/uapi/linux/if.h?h=v5.5
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/include/uapi/linux/libc-compat.h?h=v5.5
Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/include/linux/compiler_types.h?h=v5.5
Link: https://patchwork.ozlabs.org/project/glibc/patch/1461512707-23058-1-git-send-email-mikko.rapeli@iki.fi/
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-26 17:11:53 +02:00
Donald Sharp
6a7fadaecc
Merge pull request #15588 from opensourcerouting/sqlite-filename-size
lib: fix SQLite dbfile path length
2024-04-26 10:19:05 -04:00
Vijayalaxmi Basavaraj
0c4b7c1f1f pimd: fix crash unconfiguring rp keepalive timer
pimd crashs while unconfigure of rp ka timer as we are trying to access
a yand dnode(suppress timer) which does not exist at the moment.

User just configured rp keepalive timer and not suppress timer,
the yang dnode would not be present. Instead of directly accessing
yang_dnode_get_unit16, first check the yang node exist using
the xpath.

Ticket: #3874971

Testing:

Before:
------
tor-11(config)# no ip pim rp keep-alive-timer 3000
vtysh: error reading from pimd: Success (0)Warning: closing connection to pimd because of an I/O error!

Broadcast message from root@tor-11 (somewhere) (Mon Apr 22 17:29:12 2024):

cumulus-core: Running cl-support for core files "pimd.25467.1713806952.core"

After:
-----
tor-11(config)# no ip pim rp keep-alive-timer 3000
tor-11(config)#

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Vijayalaxmi Basavaraj <vbasavaraj@nvidia.com>
2024-04-26 10:14:24 -04:00
Mark Stapp
76dbfc148c
Merge pull request #15843 from opensourcerouting/yang-link-netconf-acm
yang: ietf-netconf-acm needs to be in libfrr
2024-04-26 09:31:44 -04:00
Mark Stapp
8d2c255d26
Merge pull request #15850 from donaldsharp/sa_clang_15_some_problems
bgpd: Remove unused addition found in clang
2024-04-26 08:01:26 -04:00
Donald Sharp
f8e9f7fb0e
Merge pull request #15744 from pguibert6WIND/snmp_oid_line73_error
topotests: lib, fix filter out "At line 73 in /usr/share/snmp/mibs/ie…
2024-04-26 07:38:42 -04:00
Donatas Abraitis
d42c4c08e8
Merge pull request #15849 from donaldsharp/redistibute_doc_change
bgpd: Explain Better admin w/ redistribution a bit better.
2024-04-26 12:52:37 +03:00
Philippe Guibert
500227ae76 bgpd: add bmp loc-rib 64 bit gauge value
There is no support for option 8, as per RFC7854.
Add the 64 bit counter in the peer structure.
Add the missing per peer statistic.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-26 08:12:41 +02:00
Philippe Guibert
7ba991cf96 bgpd: add 'bmp stat send-experimental' command
Some wireshark versions can not decode the experimental
bmp stat code. This may also be the case for some collectors.
Add a vty command to be able to disable bmp to sending
those values.

> [no] bmp stat send-experimental

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-26 08:12:38 +02:00
Philippe Guibert
e6374a20f3 bgpd: add bmp adj-rib-in 64 bit gauge value
There is no support for option 7, as per RFC7854.
Add the 64 bit counter in the peer structure.
Add the 64 bit bmp value write api.
Add the missing per peer statistic.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-26 08:11:44 +02:00
Chirag Shah
439c6f70b5 tools: Handle seq num for BGP as-path in frr-reload.py
If frr.conf has bgp as-path access-list clause without sequence number
then upon performing frr-rleoad, the running config clause with sequence
number will always be deleted and the new ones without sequence will
be re-added.
This could lead to blackholing until the config gets reapplied.

Testing:

frr.conf:
bgp as-path access-list important_internet_bgp_as_numbers permit _16509_

Running config:
bgp as-path access-list important_internet_bgp_as_numbers seq 5 permit
_16509_
!

Before fix
Upon frr-reload it deletes and readd line as without seq

2024-04-26 03:16:45,772  INFO: Executed "no bgp as-path access-list
important_internet_bgp_as_numbers seq 5 permit _16509_"

'bgp as-path access-list important_internet_bgp_as_numbers permit
_16509_\n'

After fix:
no form is not executed and no delta determine between frr.conf
and running-config.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2024-04-25 20:30:12 -07:00
Andrew Cooks
89a2e4d825 lib: replace deprecated ares_gethostbyname
c-ares has deprecated ares_gethostbyname() in version 1.28.0
Replace it with ares_getaddrinfo().

This fixes a build error on Fedora 40.

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
2024-04-26 06:28:44 +10:00
Donald Sharp
b4c64b3a39 bgpd: Remove unused addition found in clang
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-25 14:45:32 -04:00
Donald Sharp
6214396306 bgpd: Explain Better admin w/ redistribution a bit better.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-25 14:17:46 -04:00
Acee Lindem
3b75723061 ospfd: OSPFAPI Server options to limit to local connections and per-instance TCP
This commit include OSPFAPI Server options to:

 1. Allow specification of the OSPFAPI server local address.
 2. Allow different OSPFAPI server TCP ports to be specified for different
    OSPF instances in /etc/services.

Signed-off-by: Acee Lindem <acee@lindem.com>
2024-04-25 16:20:50 +00:00
David Lamparter
b472b024ea yang: ietf-netconf-acm needs to be in libfrr
ietf-key-chain depends on ietf-netconf-acm, and lib/ code sets up the
former, so ietf-netconf-acm needs to be embedded in the libfrr too.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-25 15:06:14 +02:00
Philippe Guibert
f6e58d26f6 zebra, sharpd: add srv6 End.DX6 support
Add the support for adding DX6 behavior into netlink layer of zebra.
Add the necessary test in sharpd.

> ubuntu2204# sharp install seg6local-routes 1:1::1:2 nexthop-seg6local loop1 End_DX6 4:4::4:6 1
> ubuntu2204# do show ipv6 route
> [..]
> D>* 1:1::1:2/128 [150/0] is directly connected, loop1, seg6local End.DX6 nh6 4:4::4:6, weight 1, 00:00:03

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-25 13:54:25 +02:00
David Lamparter
a6040ba1f5
Merge pull request #15833 from mjstapp/fix_vtysh_bgp_defs 2024-04-25 13:10:43 +02:00
David Lamparter
52734fc8e5 ospf6d: accept CLI no for point-to-multipoint
`point-to-multipoint` was missing on the removal variant of this CLI
command.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-25 12:20:27 +02:00
David Lamparter
d7f54c4d56 ospf6d: force recalculate on interface_up
interface_up also handles changes to the interface type, i.e. broadcast
to ptp to ptmp.  Connected routes for these are different and must be
readvertised, which is done in ospf6_interface_recalculate_cost() - but
only if the cost changed.  Use the force variant here.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-25 12:18:08 +02:00
David Lamparter
4aa200c7c5 ospf6d: fix loopback/ptp/ptmp conn. route checks
The code emitting connected routes was checking against the interface
state (which can also be lo/ptp/ptmp) rather than the interface type.
This was causing wrong IA prefixes for connected routes getting put up
out if the interface was down intermittently.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-25 12:16:35 +02:00
David Lamparter
b47657600b ospf6d: fix DEFUN formatting wrecked by clang
clang-format doesn't understand `DEFUN` and formats it rather ugly.
Standard approach was to skip these in clang-format, which hasn't
happened here sadly.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-04-25 11:45:19 +02:00
Andrew Cooks
4540fa0a3e lib: replace deprecated ares_process()
ares_process(...) has been deprecated.
Replace it with ares_process_fd(...)

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
2024-04-25 17:54:51 +10:00
Vincent JARDIN
f30275d05b docs: libs install-prefix since cmake 3.21
use the new recommendation from cmake:
  --install-prefix <directory>
     New in version 3.21.

     Specify the installation directory, used by the
     CMAKE_INSTALL_PREFIX variable. Must be an
     absolute path.

reminder: the default path is /usr/local instead of /usr

Signed-off-by: Vincent Jardin <vjardin@free.fr>
2024-04-25 09:52:05 +02:00
Vincent JARDIN
b9161936af docs: sysrepo install-prefix since cmake 3.21
use the new recommendation from cmake:
  --install-prefix <directory>
     New in version 3.21.

     Specify the installation directory, used by the
     CMAKE_INSTALL_PREFIX variable. Must be an
     absolute path.

reminder: the default path is /usr/local instead of /usr

Signed-off-by: Vincent Jardin <vjardin@free.fr>
2024-04-25 09:52:05 +02:00
Vincent JARDIN
e779a5fd7e docs: libyang install-prefix since cmake 3.21
use the new recommendation from cmake:
  --install-prefix <directory>
     New in version 3.21.

     Specify the installation directory, used by the
     CMAKE_INSTALL_PREFIX variable. Must be an
     absolute path.

reminder: the default path is /usr/local instead of /usr

Signed-off-by: Vincent Jardin <vjardin@free.fr>
2024-04-25 09:52:05 +02:00