]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
9 months agozebra: fix missing static routes
anlan_cs [Fri, 12 Jul 2024 09:03:03 +0000 (17:03 +0800)]
zebra: fix missing static routes

Use `vtysh` with this input file:
```
ip route A nh1
ip route A nh2
ip route B nh1
ip route B nh2
```

When running "ip route B" with "nh1" and "nh2", the procedure maybe is:
1) Create the two nexthops: "nh1" and "nh2".
2) Register "nh1" with `static_zebra_nht_register()`, then the states of both
   "nh1" and "nht2" are set to "STATIC_SENT_TO_ZEBRA".
3) Register "nh2" with `static_zebra_nht_register()`, then only the routes with
   nexthop of "STATIC_START" will be sent to zebra.

So, send the routes with the nexthop of "STATIC_SENT_TO_ZEBRA" to zebra.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
9 months agoMerge pull request #16140 from donaldsharp/linklist_discouragement
David Lamparter [Wed, 10 Jul 2024 07:08:21 +0000 (09:08 +0200)]
Merge pull request #16140 from donaldsharp/linklist_discouragement

9 months agoMerge pull request #16229 from anlancs/ripd/fix-header-show
Russ White [Tue, 9 Jul 2024 20:12:30 +0000 (16:12 -0400)]
Merge pull request #16229 from anlancs/ripd/fix-header-show

ripd/ripngd: use common header for display command

9 months agoMerge pull request #16342 from pguibert6WIND/duplicate_fib_proposal
Mark Stapp [Tue, 9 Jul 2024 17:48:37 +0000 (13:48 -0400)]
Merge pull request #16342 from pguibert6WIND/duplicate_fib_proposal

Duplicate fib proposal

9 months agoMerge pull request #16241 from zhou-run/202406191740
Russ White [Tue, 9 Jul 2024 15:40:26 +0000 (11:40 -0400)]
Merge pull request #16241 from zhou-run/202406191740

isisd: The neighbor entry still displays the deleted hostname of the neighbor.

9 months agoMerge pull request #16258 from opensourcerouting/tsan-20240620
Russ White [Tue, 9 Jul 2024 15:36:24 +0000 (11:36 -0400)]
Merge pull request #16258 from opensourcerouting/tsan-20240620

lib, tests: fix some b0rked tests, then fix TSAN warnings

9 months agoMerge pull request #16353 from opensourcerouting/fix/print_table_id
Russ White [Tue, 9 Jul 2024 03:17:20 +0000 (23:17 -0400)]
Merge pull request #16353 from opensourcerouting/fix/print_table_id

bgpd: Print tableid when sending (add/remove) routes to Zebra

9 months agoMerge pull request #16352 from opensourcerouting/fix/rename_test
Russ White [Tue, 9 Jul 2024 03:16:20 +0000 (23:16 -0400)]
Merge pull request #16352 from opensourcerouting/fix/rename_test

tests: Rename BGP OAD test function

9 months agoMerge pull request #16351 from LabNConsulting/aceelindem/ospf-ls-ack-improve
Russ White [Tue, 9 Jul 2024 03:15:54 +0000 (23:15 -0400)]
Merge pull request #16351 from LabNConsulting/aceelindem/ospf-ls-ack-improve

ospfd: Fix several problems with direct and delayed acknowledgments

9 months agoMerge pull request #16348 from opensourcerouting/feature/test_bgp_remote_as_unnumberred
Russ White [Tue, 9 Jul 2024 03:15:04 +0000 (23:15 -0400)]
Merge pull request #16348 from opensourcerouting/feature/test_bgp_remote_as_unnumberred

tests: Extended bgp_remote_as_auto topotest with unnumbered case

9 months agoMerge pull request #16090 from zhou-run/202405271057
Russ White [Tue, 9 Jul 2024 03:00:35 +0000 (23:00 -0400)]
Merge pull request #16090 from zhou-run/202405271057

isisd: When operating multiple areas, the system ID behaves abnormally.

9 months agozebra, topotests: do not set nexthop's FIB flag when DUPLICATE present
Philippe Guibert [Wed, 3 Jul 2024 06:51:51 +0000 (08:51 +0200)]
zebra, topotests: do not set nexthop's FIB flag when DUPLICATE present

The bgp_duplicate_nexthop test installs routes with nexthop's
flags set to both DUPLICATE and FIB: this should not happen.

The DUPLICATE flag of a nexthop indicates this nexthop is already
used in the same nexthop-group, and there is no need to install it
twice in the system; having the FIB flag set indicates that the
nexthop is installed in the system. This is why both flags should
not be set on the same nexthop.

This case happens at installation time, but can also happen
at update time.
- Fix this by not setting the FIB flag value when the DUPLICATE
flag is present.
- Modify the bgp_duplicate_test to check that the FIB flag is not
present on duplicated nexthops.
- Modify the bgp_peer_type_multipath_relax test.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
9 months agotopotests: bgp_peer_type_multipath_relax, adds the duplicate flag
Philippe Guibert [Wed, 3 Jul 2024 12:37:52 +0000 (14:37 +0200)]
topotests: bgp_peer_type_multipath_relax, adds the duplicate flag

During the bgp_peer_type_multipath_relax_test, the test does not
check the 'duplicate' flag value of the duplicate nexthop.

Fix this by adding the duplicate value in the expected json files.

Fixes: ee88563ac2ea ("bgpd: Add 'bgp bestpath peer-type multipath-relax'")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
9 months agoisisd: The neighbor entry still displays the deleted hostname of the neighbor
zhou-run [Fri, 21 Jun 2024 06:26:44 +0000 (14:26 +0800)]
isisd: The neighbor entry still displays the deleted hostname of the neighbor

1. The lsp_update_data() function will check for the presence of the ISIS_TLV_DYNAMIC_HOSTNAME in the LSP, and then call isis_dynhn_insert() to add a hostname entry corresponding to the LSP ID. However, when the ISIS_TLV_DYNAMIC_HOSTNAME is not present in the LSP, the hostname entry corresponding to the LSP ID should also be deleted.
2. The command “show isis neighbor” invokes isis_adj_name() to display the System ID or hostname, but it does not check the area->dynhostname flag.
3. When the LSP expires and is removed, the corresponding hostname entry should also be deleted.
4. The TLV for LSP fragmentation will not contain the hostname and should be skipped.

Signed-off-by: zhou-run <zhou.run@h3c.com>
9 months agobgpd: Print tableid when sending (add/remove) routes to Zebra
Donatas Abraitis [Sun, 7 Jul 2024 15:49:05 +0000 (18:49 +0300)]
bgpd: Print tableid when sending (add/remove) routes to Zebra

In case this is used under `set table X` via route-maps, it's good to know
in debugs the table id.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
9 months agobgpd: Drop unnecessary is_add check for bgp_zebra_announce_actual()
Donatas Abraitis [Sun, 7 Jul 2024 15:42:08 +0000 (18:42 +0300)]
bgpd: Drop unnecessary is_add check for bgp_zebra_announce_actual()

Fixes: ccfe452763d16c432fa81fd20e805bec819b345e ("bgpd : backpressure - Handle BGP-Zebra Install evt Creation")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
9 months agotests: Rename BGP OAD test function
Donatas Abraitis [Sun, 7 Jul 2024 15:26:30 +0000 (18:26 +0300)]
tests: Rename BGP OAD test function

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
9 months agoospfd: Fix several problems with direct acknowledgments and improved delay acks.
Acee Lindem [Fri, 5 Jul 2024 20:44:30 +0000 (20:44 +0000)]
ospfd: Fix several problems with direct acknowledgments and improved delay acks.

   1. On P2MP interfaces, direct ack would include the same LSA multiple times
      multiple packets are processed before the OSPF interfae direct LSA
      acknowledgment event is processed. Now duplicates LSA in the same event
      are suppressed.
   2. On non-broadcast interfaces, direct acks for multiple neighbors would be
      unicast to the same neighbor due to the multiple OSPF LS Update packets
      being process prior to the OSPF interface direct ack event. Now, separate
      direct acks are unicast to the neighbors requiring them.
   3. The interface delayed acknowledgment timer runs would run continously
      (every second as long as the interace is up). Now, the timer is set
      when delayed acknowledgments are queued and all queued delayed
      acknowledges are sent when it fires.
   4. For non-broadcast interface delayed acknowledgments, the logic to send
      to multiple neighbors wasn't working because the list was emptied while
      building the packet for the first neighbor.

Signed-off-by: Acee Lindem <acee@lindem.com>
9 months agoMerge pull request #16346 from pguibert6WIND/sharp_zapi_nexthop_only
Donald Sharp [Fri, 5 Jul 2024 14:15:03 +0000 (10:15 -0400)]
Merge pull request #16346 from pguibert6WIND/sharp_zapi_nexthop_only

sharpd: fix set ZAPI_MESSAGE_NEXTHOP in nhg only when nexthops used

9 months agotests: Extended bgp_remote_as_auto topotest with unnumbered case
Donatas Abraitis [Fri, 5 Jul 2024 12:57:52 +0000 (15:57 +0300)]
tests: Extended bgp_remote_as_auto topotest with unnumbered case

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
9 months agoMerge pull request #16345 from opensourcerouting/feature/bgp_remote-as_auto
Donald Sharp [Fri, 5 Jul 2024 12:43:32 +0000 (08:43 -0400)]
Merge pull request #16345 from opensourcerouting/feature/bgp_remote-as_auto

bgpd: Implement `neighbor X remote-as auto`

9 months agoMerge pull request #16334 from opensourcerouting/fix/move_sticky_default_gw_to_evpn_flags
Donald Sharp [Fri, 5 Jul 2024 12:41:31 +0000 (08:41 -0400)]
Merge pull request #16334 from opensourcerouting/fix/move_sticky_default_gw_to_evpn_flags

bgpd: Move sticky, default_gw, router_flag into a single flags variable

9 months agotests: update tests for ripd and ripngd
anlan_cs [Thu, 4 Jul 2024 13:23:08 +0000 (21:23 +0800)]
tests: update tests for ripd and ripngd

Since the displayed header of "show ip rip" and "show ipv6 ripng" are changed,
we should update tests of ripd and ripngd.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
9 months agoripd: adjust header for display command
anlan_cs [Tue, 25 Jun 2024 06:32:44 +0000 (14:32 +0800)]
ripd: adjust header for display command

Continue to adjust `show ip rip` 's header for display comand.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
9 months agoripngd: adjust header for display command
anlan_cs [Sun, 16 Jun 2024 05:20:00 +0000 (13:20 +0800)]
ripngd: adjust header for display command

Both rip and ripng can import routes from other protocols, e.g. ISIS.
But their header doesn't list the description for these abbreviations.

Adjust `show ipv6 ripng` 's header for display command.

Before:
```
Codes: R - RIPng, C - connected, S - Static, O - OSPF, B - BGP
Sub-codes:
```

After:
```
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIPng, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct
Sub-codes:
```

Signed-off-by: anlan_cs <vic.lan@pica8.com>
9 months agobgpd: Convert int to enum peer_asn_type
Donatas Abraitis [Thu, 4 Jul 2024 20:07:01 +0000 (23:07 +0300)]
bgpd: Convert int to enum peer_asn_type

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
9 months agoMerge pull request #16339 from y-bharath14/srib-topotest-g
Donatas Abraitis [Thu, 4 Jul 2024 19:33:07 +0000 (22:33 +0300)]
Merge pull request #16339 from y-bharath14/srib-topotest-g

yang: Corrected typo at yang file

9 months agosharpd: fix set ZAPI_MESSAGE_NEXTHOP in nhg only when nexthops used
Philippe Guibert [Tue, 18 Jun 2024 15:40:08 +0000 (17:40 +0200)]
sharpd: fix set ZAPI_MESSAGE_NEXTHOP in nhg only when nexthops used

The ZAPI_MESSAGE_NEXTHOP flag is systematically set, even if the
route message does not include any nexthops. Limit the usage of this
value only when nexthops are present.

Fixes: 8a71d93d85a6 ("sharpd: Add Super Happy Advanced Routing Protocol")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
9 months agobgpd: Implement `neighbor X remote-as auto`
Donatas Abraitis [Thu, 4 Jul 2024 11:42:19 +0000 (14:42 +0300)]
bgpd: Implement `neighbor X remote-as auto`

In some cases (large scale) it's desired to avoid changing configurations, but
let the BGP to automatically handle ASN changes.

`auto` means the peering can be iBGP or eBGP. It will be automatically detected
and adjusted from the OPEN message.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
9 months agobgpd: Move sticky, default_gw, router_flag into a single flags variable
Donatas Abraitis [Tue, 2 Jul 2024 16:31:14 +0000 (19:31 +0300)]
bgpd: Move sticky, default_gw, router_flag into a single flags variable

Instead of using 3 uint8_t variables under struct attr, let's use a single
uint8_t as the flags. Saving 2-bytes. Not a big deal, but it's even easier to
track EVPN-related flags/variables.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
9 months agoMerge pull request #16333 from opensourcerouting/fix/nits
Donald Sharp [Wed, 3 Jul 2024 12:43:23 +0000 (08:43 -0400)]
Merge pull request #16333 from opensourcerouting/fix/nits

bgpd: Drop memset() before encoding EVPN extended communities

9 months agoMerge pull request #16331 from opensourcerouting/feature/bgp_dampening_topotests
Russ White [Wed, 3 Jul 2024 11:23:09 +0000 (07:23 -0400)]
Merge pull request #16331 from opensourcerouting/feature/bgp_dampening_topotests

tests: Add basic BGP per-safi dampening topotest

9 months agoyang: Corrected typo at yang file
Y Bharath [Wed, 3 Jul 2024 10:27:01 +0000 (15:57 +0530)]
yang: Corrected typo at yang file

Corrected typo at yang file

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
9 months agoMerge pull request #16226 from anlancs/ldpd/fix-gtsm
Russ White [Tue, 2 Jul 2024 17:49:12 +0000 (13:49 -0400)]
Merge pull request #16226 from anlancs/ldpd/fix-gtsm

ldpd: fix wrong gtsm count

9 months agobgpd: Drop memset() before encoding EVPN extended communities
Donatas Abraitis [Tue, 2 Jul 2024 15:35:48 +0000 (18:35 +0300)]
bgpd: Drop memset() before encoding EVPN extended communities

memset() is already handled inside the helpers for a particular extended
community.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
9 months agotests: Add basic BGP per-safi dampening topotest
Donatas Abraitis [Tue, 2 Jul 2024 14:57:06 +0000 (17:57 +0300)]
tests: Add basic BGP per-safi dampening topotest

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
9 months agoMerge pull request #16099 from Pdoijode/pdoijode/bgp-gr2
Donatas Abraitis [Tue, 2 Jul 2024 14:40:29 +0000 (16:40 +0200)]
Merge pull request #16099 from Pdoijode/pdoijode/bgp-gr2

Implement BGP-wide configuration for graceful restart

9 months agoMerge pull request #15677 from cscarpitta/isis-srv6-sid-manager
Russ White [Tue, 2 Jul 2024 12:32:05 +0000 (08:32 -0400)]
Merge pull request #15677 from cscarpitta/isis-srv6-sid-manager

isisd: Extend IS-IS to communicate with the SRv6 SID Manager to allocate/release SRv6 SIDs

9 months agoMerge pull request #16303 from zhou-run/202406271017
Russ White [Tue, 2 Jul 2024 12:01:25 +0000 (08:01 -0400)]
Merge pull request #16303 from zhou-run/202406271017

isisd: fix crash when obtaining the next hop to calculate LFA on LAN links

9 months agoMerge pull request #16094 from opensourcerouting/pkgs-with-grpc
Russ White [Tue, 2 Jul 2024 11:36:50 +0000 (07:36 -0400)]
Merge pull request #16094 from opensourcerouting/pkgs-with-grpc

Add option to build pkg with grpc support

9 months agoMerge pull request #15716 from zhou-run/202404092101
Russ White [Tue, 2 Jul 2024 11:25:51 +0000 (07:25 -0400)]
Merge pull request #15716 from zhou-run/202404092101

isisd: Fix memory leaks when the transition of neighbor state from non-UP to DOWN

9 months ago*: Add and use option for graceful (re)start
vivek [Wed, 26 Jun 2024 22:49:45 +0000 (15:49 -0700)]
*: Add and use option for graceful (re)start

Add a new start option "-K" to libfrr to denote a graceful start,
and use it in zebra and bgpd.

zebra will use this option to denote a planned FRR graceful restart
(supporting only bgpd currently) to wait for a route sync completion
from bgpd before cleaning up old stale routes from the FIB. An optional
timer provides an upper-bounds for this cleanup.

bgpd will use this option to denote either a planned FRR graceful
restart or a bgpd-only graceful restart, and this will drive the BGP
GR restarting router procedures.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
9 months agotests: Updated topotest and documentation
Pooja Jagadeesh Doijode [Thu, 27 Jun 2024 00:34:44 +0000 (17:34 -0700)]
tests: Updated topotest and documentation

Added topotest and documentation for BGP wide GR configurations

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
9 months agobgpd: Refine debug logs for zebra GR registration
vivek [Mon, 26 Oct 2020 04:54:13 +0000 (21:54 -0700)]
bgpd: Refine debug logs for zebra GR registration

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
9 months agobgpd: Enhance OPEN Tx debug log
vivek [Mon, 26 Oct 2020 04:21:55 +0000 (21:21 -0700)]
bgpd: Enhance OPEN Tx debug log

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
9 months agobgpd: Refine OPEN debug logs for graceful restart
vivek [Mon, 26 Oct 2020 04:16:32 +0000 (21:16 -0700)]
bgpd: Refine OPEN debug logs for graceful restart

This also fixes Rx F-bit log which was incorrect.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
9 months agobgpd: Refine restarter operation - R-bit & F-bit
vivek [Mon, 26 Oct 2020 00:05:48 +0000 (17:05 -0700)]
bgpd: Refine restarter operation - R-bit & F-bit

Introduce BGP-wide flags to denote if BGP has started gracefully
and GR is in progress or not. Use this for setting of the R-bit in
the GR capability, and not a timer which is set for any new
instance creation. Mark graceful restart is complete when the
deferred path selection has been done and route sync with zebra as
well as deferred EOR advertisement has been initiated.

Introduce a function to check on F-bit setting rather than just
base it on configuration.

Subsequent commits will extend these functionalities.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
9 months agoMerge pull request #16233 from T-Nicolas/patch-1
Donatas Abraitis [Mon, 1 Jul 2024 17:36:57 +0000 (19:36 +0200)]
Merge pull request #16233 from T-Nicolas/patch-1

ripd/ripd.c - rip_auth_md5 : Change the start value of sequence 1 to 0

9 months agoMerge pull request #16305 from opensourcerouting/fix/bgp_confederation_rfc8212
Donald Sharp [Mon, 1 Jul 2024 14:18:10 +0000 (10:18 -0400)]
Merge pull request #16305 from opensourcerouting/fix/bgp_confederation_rfc8212

bgpd: Ignore RFC8212 for BGP Confederations

10 months agoMerge pull request #16068 from piotrsuchy/unknown_VRF
Donatas Abraitis [Fri, 28 Jun 2024 08:33:40 +0000 (10:33 +0200)]
Merge pull request #16068 from piotrsuchy/unknown_VRF

bgpd: Ignore routes from evpn if VRF is unknown

10 months agoMerge pull request #14509 from qlyoung/fix-clicmd-duplicates-issue
Christian Hopps [Fri, 28 Jun 2024 00:14:46 +0000 (20:14 -0400)]
Merge pull request #14509 from qlyoung/fix-clicmd-duplicates-issue

doc: add ability to disambiguate clicmds

10 months agoMerge pull request #16297 from qlyoung/doc-toc-sections
Christian Hopps [Thu, 27 Jun 2024 23:52:19 +0000 (19:52 -0400)]
Merge pull request #16297 from qlyoung/doc-toc-sections

doc: improve table-of-contents organization

10 months agotests: Test if RFC 8212 is not involved for BGP confederations
Donatas Abraitis [Thu, 27 Jun 2024 19:53:24 +0000 (22:53 +0300)]
tests: Test if RFC 8212 is not involved for BGP confederations

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
10 months agobgpd: Ignore RFC8212 for BGP Confederations
Donatas Abraitis [Thu, 27 Jun 2024 19:46:58 +0000 (22:46 +0300)]
bgpd: Ignore RFC8212 for BGP Confederations

RFC 8212 should be restricted for eBGP peers.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
10 months agodoc: do not use custom directive on old sphinx
Quentin Young [Wed, 26 Jun 2024 22:17:07 +0000 (18:17 -0400)]
doc: do not use custom directive on old sphinx

Not supported.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
10 months agodoc: add ability to disambiguate clicmds
Quentin Young [Fri, 29 Sep 2023 00:11:31 +0000 (20:11 -0400)]
doc: add ability to disambiguate clicmds

Multiple daemons have the same CLI commands defined, but the current
directive used to document CLI commands only takes the command
definition string. Since CLI command objects can be cross-referenced
using the :clicmd: directive, and are placed in the index, each object
needs to be unique.

To accomplish this, add a custom directive. This directive extends the
directive class used by sphinx's add_object_type to add a :daemon:
option. By specifying this option where needed, the object name becomes
"(<daemon>) <definition>", disambiguating it.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
10 months agobgpd: Streamline GR config, act on change immediately
vivek [Sun, 25 Oct 2020 18:31:42 +0000 (11:31 -0700)]
bgpd: Streamline GR config, act on change immediately

Streamline the BGP graceful-restart configuration at the global and
peer level some more. Similar to many other neighbor capability
parameters like MP and ENHE, reset the session immediately upon a
change to the configuration. This will be more aligned with the
transactional UI model also and will not require a separate 'clear'
command to be executed.

Note: Peer-group graceful-restart configuration is not yet supported.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
10 months agobgpd: Added ! after BGP global config
Pooja Jagadeesh Doijode [Wed, 29 May 2024 21:14:20 +0000 (14:14 -0700)]
bgpd: Added ! after BGP global config

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
10 months agobgpd: Implement BGP-wide configuration for graceful restart
vivek [Sat, 24 Oct 2020 21:38:58 +0000 (14:38 -0700)]
bgpd: Implement BGP-wide configuration for graceful restart

Add support for a BGP-wide setting for graceful restart modes and
parameters. This setting will apply to all BGP peers across all BGP
instances, but per-neighbor configuration can override it.
Per-instance configuration is disallowed if the BGP-wide setting
is in effect.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
10 months agoMerge pull request #16301 from qlyoung/reformat-sphinx-config-files
Christian Hopps [Thu, 27 Jun 2024 18:39:02 +0000 (14:39 -0400)]
Merge pull request #16301 from qlyoung/reformat-sphinx-config-files

doc: reformat Sphinx conf.py files

10 months agoMerge pull request #16299 from opensourcerouting/pim-logic-braces-20240625
Donald Sharp [Thu, 27 Jun 2024 18:00:47 +0000 (14:00 -0400)]
Merge pull request #16299 from opensourcerouting/pim-logic-braces-20240625

pimd: fix misplaced braces/logic error in pim_rp_set_upstream_addr

10 months agoripd: Change the start value of sequence 1 to 0
T-Nicolas [Mon, 17 Jun 2024 13:05:58 +0000 (15:05 +0200)]
ripd: Change the start value of sequence 1 to 0

Signed-off-by: T-Nicolas <github@toselli.email>
10 months agoisisd: fix crash when obtaining the next hop to calculate LFA on LAN links
zhou-run [Thu, 27 Jun 2024 03:51:02 +0000 (11:51 +0800)]
isisd: fix crash when obtaining the next hop to calculate LFA on LAN links

When a neighbor connection is disconnected, it may trigger LSP re-generation as a timer task, but this process may be delayed. As a result, the list of neighbors in area->adjacency_list may be inconsistent with the neighbors in lsp->tlvs->oldstyle_reach/extended_reach. For example, the area->adjacency_list may lack certain neighbors even though they are present in the LSP. When computing SPF, the call to isis_spf_build_adj_list() generates the spftree->sadj_list, which reflects the real neighbors in the area->adjacency_list. However, in the case of LAN links, spftree->sadj_list may include additional pseudo neighbors.
The pre-loading of tents through the call to isis_spf_preload_tent involves two steps:
1. isis_spf_process_lsp() is called to generate real neighbor vertices based on the root LSP and pseudo LSP.
2. isis_spf_add_local() is called to add corresponding next hops to the vertex->Adj_N list for the real neighbor vertices.
In the case of LAN links, the absence of corresponding real neighbors in the spftree->sadj_list prevents the execution of the second step. Consequently, the vertex->Adj_N list for the real neighbor vertices lacks corresponding next hops. This leads to a null pointer access when isis_lfa_compute() is called to calculate LFA.
As for P2P links, since there are no pseudo neighbors, only the second step is executed, which does not create real neighbor vertices and therefore does not encounter this issue.
The backtrace is as follows:
(gdb) bt
#0  0x00007fd065277fe1 in raise () from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fd065398972 in core_handler (signo=11, siginfo=0x7ffc5c0636b0, context=0x7ffc5c063580) at ../lib/sigevent.c:261
#2  <signal handler called>
#3  0x00005564d82f8408 in isis_lfa_compute (area=0x5564d8b143f0, circuit=0x5564d8b21d10, spftree=0x5564d8b06bf0, resource=0x7ffc5c064410) at ../isisd/isis_lfa.c:2134
#4  0x00005564d82f8d78 in isis_spf_run_lfa (area=0x5564d8b143f0, spftree=0x5564d8b06bf0) at ../isisd/isis_lfa.c:2344
#5  0x00005564d8315964 in isis_run_spf_with_protection (area=0x5564d8b143f0, spftree=0x5564d8b06bf0) at ../isisd/isis_spf.c:1827
#6  0x00005564d8315c15 in isis_run_spf_cb (thread=0x7ffc5c064590) at ../isisd/isis_spf.c:1889
#7  0x00007fd0653b1f04 in thread_call (thread=0x7ffc5c064590) at ../lib/thread.c:1990
#8  0x00007fd06534a97b in frr_run (master=0x5564d88103c0) at ../lib/libfrr.c:1198
#9  0x00005564d82e7d5d in main (argc=5, argv=0x7ffc5c0647b8, envp=0x7ffc5c0647e8) at ../isisd/isis_main.c:273
(gdb) f 3
#3  0x00005564d82f8408 in isis_lfa_compute (area=0x5564d8b143f0, circuit=0x5564d8b21d10, spftree=0x5564d8b06bf0, resource=0x7ffc5c064410) at ../isisd/isis_lfa.c:2134
2134    ../isisd/isis_lfa.c: No such file or directory.
(gdb) p vadj_primary
$1 = (struct isis_vertex_adj *) 0x0
(gdb) p vertex->Adj_N->head
$2 = (struct listnode *) 0x0
(gdb) p (struct isis_vertex *)spftree->paths->l.list->head->next->next->next->next->data
$8 = (struct isis_vertex *) 0x5564d8b5b240
(gdb) p $8->type
$9 = VTYPE_NONPSEUDO_TE_IS
(gdb) p $8->N.id
$10 = "\000\000\000\000\000\002"
(gdb) p $8->Adj_N->count
$11 = 0
(gdb) p (struct isis_vertex *)spftree->paths->l.list->head->next->next->next->next->next->data
$12 = (struct isis_vertex *) 0x5564d8b73dd0
(gdb) p $12->type
$13 = VTYPE_NONPSEUDO_TE_IS
(gdb) p $12->N.id
$14 = "\000\000\000\000\000\003"
(gdb) p $12->Adj_N->count
$15 = 0
(gdb) p area->adjacency_list->count
$16 = 0
The backtrace provided above pertains to version 8.5.4, but it seems that the same issue exists in the code of the master branch as well.
The scenario where a vertex has no next hop is normal. For example, the "clear isis neighbor" command invokes isis_vertex_adj_del() to delete the next hop of a vertex. Upon reviewing all the instances where the vertex->Adj_N list is used, I found that only isis_lfa_compute() lacks a null check. Therefore, I believe that modifying this part will be sufficient. Additionally, the vertex->parents list for IP vertices is guaranteed not to be empty.
Test scenario:
Setting up LFA for LAN links and executing the "clear isis neighbor" command easily reproduces the issue.

Signed-off-by: zhou-run <zhou.run@h3c.com>
10 months agoMerge pull request #16271 from lsang6WIND/avoid-loop
Russ White [Wed, 26 Jun 2024 20:45:44 +0000 (16:45 -0400)]
Merge pull request #16271 from lsang6WIND/avoid-loop

bgpd: avoid clearing routes for peers that were never established

10 months agodoc: reformat Sphinx conf.py files
Quentin Young [Wed, 26 Jun 2024 19:44:08 +0000 (15:44 -0400)]
doc: reformat Sphinx conf.py files

Style checking is complaining about these, rightly so. Reformat.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
10 months agopimd: refactor `pim_rp_set_upstream_addr`
David Lamparter [Wed, 26 Jun 2024 14:13:50 +0000 (16:13 +0200)]
pimd: refactor `pim_rp_set_upstream_addr`

Somehow this tiny function ended up being written in a very convoluted
way that enabled the braces mixup in the previous commit.  Rewrite it to
be less confusing.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
10 months agopimd: fix misplaced braces/logic error
David Lamparter [Tue, 25 Jun 2024 12:37:27 +0000 (14:37 +0200)]
pimd: fix misplaced braces/logic error

The `!rp_info ||` check got added during a cleanup pass.  Unfortunately
the braces/and/or combination is not correct :(

Fixes: b1945363fbf ("pimd: Various buffer overflow reads and crashes")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
10 months agobgpd: avoid clearing routes for peers that were never established
Loïc Sang [Wed, 19 Jun 2024 14:19:22 +0000 (16:19 +0200)]
bgpd: avoid clearing routes for peers that were never established

Under heavy system load with many peers in passive mode and a large
number of routes, bgpd can enter an infinite loop. This occurs while
processing timeout BGP_OPEN messages, which prevents it from accepting
new connections. The following log entries illustrate the issue:
>bgpd[6151]: [VX6SM-8YE5W][EC 33554460] 3.3.2.224: nexthop_set failed, resetting connection - intf 0x0
>bgpd[6151]: [P790V-THJKS][EC 100663299] bgp_open_receive: bgp_getsockname() failed for peer: 3.3.2.224
>bgpd[6151]: [HTQD2-0R1WR][EC 33554451] bgp_process_packet: BGP OPEN receipt failed for peer: 3.3.2.224
... repeating

The issue occurs when bgpd handles a massive number of routes in the RIB
while receiving numerous BGP_OPEN packets. If bgpd is overloaded, it
fails to process these packets promptly, leading the remote peer to
close the connection and resend BGP_OPEN packets.

When bgpd eventually starts processing these timeout BGP_OPEN packets,
it finds the TCP connection closed by the remote peer, resulting in
"bgp_stop()" being called. For each timeout peer, bgpd must iterate
through the routing table, which is time-consuming and causes new
incoming BGP_OPEN packets to timeout, perpetuating the infinite loop.

To address this issue, the code is modified to check if the peer has
been established at least once before calling "bgp_clear_route_all()".
This ensures that routes are only cleared for peers that had a
successful session, preventing unnecessary iterations over the routing
table for peers that never established a connection.

With this change, BGP_OPEN timeout messages may still occur, but in the
worst case, bgpd will stabilize. Before this patch, bgpd could enter a
loop where it was unable to accpet any new connections.

Signed-off-by: Loïc Sang <loic.sang@6wind.com>
10 months agodoc: improve table-of-contents organization
Quentin Young [Tue, 25 Jun 2024 17:48:33 +0000 (13:48 -0400)]
doc: improve table-of-contents organization

The current TOC organization is not really following Sphinx best
practices and is resulting in a jumble of articles showing up in the
sidebar.

This change primarily organizes existing articles into three major
sections:

* Introduction
  - Contains system requirements, architecture & design, installation,
    basic setup
* Basics
  - Covers basic commands, concepts, and some random things that don't
    fit elsewhere
* Protocols
  - Contains all protocol documentation, and other miscellaneous daemon
    docs such as those on Zebra, watchfrr, mgmtd, etc.

The appendix has been left as is, but the TOC now has a caption which
has the effect of adding a section separator in the nav sidebar.

In order to make the new structure make sense:

* Some content has been lifted up from the "Overview" page into the
  index page
* Most content has been pushed down from the "Overview" page into the
  "About" page (new)
* BFD's page is now titled "BFD" for consistencty; it was the only one
  that had the full protocol name written out in the title

And a couple drivebys:
* BFD's intro description paragraph was rewritten to make more sense
* Old language stating that we publish platform packages on the Github
  releases page was removed
* References to source building instructions were consolidated into that
  section

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
10 months agoMerge pull request #16182 from pguibert6WIND/isis_show_route_paths_json
Russ White [Tue, 25 Jun 2024 15:57:15 +0000 (11:57 -0400)]
Merge pull request #16182 from pguibert6WIND/isis_show_route_paths_json

Isis show route paths json

10 months agoMerge pull request #16214 from opensourcerouting/fix/attr_encap_handling
Russ White [Tue, 25 Jun 2024 11:26:38 +0000 (07:26 -0400)]
Merge pull request #16214 from opensourcerouting/fix/attr_encap_handling

bgpd: A couple more fixes for Tunnel encapsulation handling

10 months agoMerge pull request #16273 from opensourcerouting/fix/bgpd_oad_rfc8212
Russ White [Tue, 25 Jun 2024 11:24:42 +0000 (07:24 -0400)]
Merge pull request #16273 from opensourcerouting/fix/bgpd_oad_rfc8212

bgpd: Relax OAD (One-Administration-Domain) for RFC8212

10 months agoMerge pull request #16270 from cscarpitta/fix/fix-coverity-issues
Donatas Abraitis [Tue, 25 Jun 2024 05:53:13 +0000 (08:53 +0300)]
Merge pull request #16270 from cscarpitta/fix/fix-coverity-issues

zebra: Fix coverity issues

10 months agoMerge pull request #16261 from chiragshah6/evpn_dev4
Donatas Abraitis [Tue, 25 Jun 2024 05:07:17 +0000 (08:07 +0300)]
Merge pull request #16261 from chiragshah6/evpn_dev4

zebra: clear evpn dup-addr return error-msg when there is no vni

10 months agoMerge pull request #16267 from louis-6wind/fix-isis-srv6-json
Russ White [Mon, 24 Jun 2024 21:18:03 +0000 (17:18 -0400)]
Merge pull request #16267 from louis-6wind/fix-isis-srv6-json

isisd: fix crash in display srv6 sid structure in json

10 months agoMerge pull request #16222 from opensourcerouting/fix/docker_alpine_no_grpc
Russ White [Mon, 24 Jun 2024 21:16:51 +0000 (17:16 -0400)]
Merge pull request #16222 from opensourcerouting/fix/docker_alpine_no_grpc

docker: Adopt for Alpine Linux 3.20

10 months agoMerge pull request #15838 from fdumontet6WIND/fix_regexx_exclude
Russ White [Mon, 24 Jun 2024 21:08:17 +0000 (17:08 -0400)]
Merge pull request #15838 from fdumontet6WIND/fix_regexx_exclude

 bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issue

10 months agoMerge pull request #16213 from opensourcerouting/fix/fqdn_capability_parsing_for_dyna...
Russ White [Mon, 24 Jun 2024 20:38:58 +0000 (16:38 -0400)]
Merge pull request #16213 from opensourcerouting/fix/fqdn_capability_parsing_for_dynamic_capability

bgpd: Check if we have really enough data before doing memcpy for FQDN capability

10 months agoMerge pull request #16211 from opensourcerouting/fix/dynamic_software_version_sanity_...
Russ White [Mon, 24 Jun 2024 20:38:50 +0000 (16:38 -0400)]
Merge pull request #16211 from opensourcerouting/fix/dynamic_software_version_sanity_check

bgpd: Check if we have really enough data before doing memcpy for software version

10 months agobgpd: Ignore routes from evpn if VRF is unknown
Piotr Suchy [Wed, 22 May 2024 08:41:52 +0000 (10:41 +0200)]
bgpd: Ignore routes from evpn if VRF is unknown

Fix for a bug, where FRR fails to install route received for an unknown but later-created VRF - detailed description can be found here https://github.com/FRRouting/frr/issues/13708

Signed-off-by: Piotr Suchy <psuchy@akamai.com>
10 months agoMerge pull request #16242 from opensourcerouting/fix/shutdown_peer_last_reset
Russ White [Mon, 24 Jun 2024 19:40:49 +0000 (15:40 -0400)]
Merge pull request #16242 from opensourcerouting/fix/shutdown_peer_last_reset

bgpd: Set last reset reason to admin shutdown if it was manually

10 months agobgpd: Relax OAD (One-Administration-Domain) for RFC8212
Donatas Abraitis [Mon, 24 Jun 2024 17:16:16 +0000 (20:16 +0300)]
bgpd: Relax OAD (One-Administration-Domain) for RFC8212

RFC 8212 defines leak prevention for eBGP peers, but BGP-OAD defines a new
peering type One Administrative Domain (OAD), where multiple ASNs could be used
inside a single administrative domain. OAD allows sending non-transitive attributes,
so this prevention should be relaxed too.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
10 months agoMerge pull request #16259 from opensourcerouting/pim-20240620-cand-rp-bsr-prep
Jafar Al-Gharaibeh [Mon, 24 Jun 2024 15:39:41 +0000 (11:39 -0400)]
Merge pull request #16259 from opensourcerouting/pim-20240620-cand-rp-bsr-prep

pimd: Candidate RP/BSR preparation

10 months agoisisd: fix srv6 endx sid key name
Louis Scalbert [Mon, 24 Jun 2024 11:38:37 +0000 (13:38 +0200)]
isisd: fix srv6 endx sid key name

srv6EndSID is actually srv6EndXSID.

Fixes: d5879267aa ("isisd: fix show database json format")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
10 months agoisisd: fix neighbor id json key
Louis Scalbert [Fri, 21 Jun 2024 09:18:59 +0000 (11:18 +0200)]
isisd: fix neighbor id json key

d5879267aa ("isisd: fix show database json format") renamed JSON keys to
a standard format but forgot to rename the neighbor-id key.

Fixes: d5879267aa ("isisd: fix show database json format")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
10 months agoisisd: remane flags_json variable
Louis Scalbert [Fri, 21 Jun 2024 09:17:32 +0000 (11:17 +0200)]
isisd: remane flags_json variable

The variable flags_json was incorrectly named, leading to confusion and
causing the bug fixed in the previous commit.

Rename the variable to refer to SRv6 End SID instead. Cosmetic change.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
10 months agoMerge pull request #16128 from LabNConsulting/aceelindem/ospf-ls-retrans-improve
Russ White [Mon, 24 Jun 2024 11:17:27 +0000 (07:17 -0400)]
Merge pull request #16128 from LabNConsulting/aceelindem/ospf-ls-retrans-improve

ospfd: Improve OSPF neighbor retransmission list granularity and pacing

10 months agozebra: Fix NULL pointer dereference
Carmine Scarpitta [Fri, 21 Jun 2024 15:47:46 +0000 (17:47 +0200)]
zebra: Fix NULL pointer dereference

The `locator` pointer is dereferenced before ensuring it is not NULL.
Fix the issue by checking that the pointer is not NULL before
dereferencing it.

Fixes 1594013

** CID 1594013:  Null pointer dereferences  (REVERSE_INULL)
/zebra/zebra_srv6.c: 961 in zebra_srv6_sid_compose()

________________________________________________________________________________________________________
*** CID 1594013:  Null pointer dereferences  (REVERSE_INULL)
/zebra/zebra_srv6.c: 961 in zebra_srv6_sid_compose()
955         struct srv6_locator *locator,
956         uint32_t sid_func)
957     {
958      uint8_t offset, func_len;
959      struct srv6_sid_format *format = locator->sid_format;
960
     CID 1594013:  Null pointer dereferences  (REVERSE_INULL)
     Null-checking "locator" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
961      if (!sid_value || !locator)
962      return false;
963
964      if (format) {
965      offset = format->block_len + format->node_len;
966      func_len = format->function_len;

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
10 months agozebra: Fix wrong variable used in `for` loop
Carmine Scarpitta [Fri, 21 Jun 2024 15:41:34 +0000 (17:41 +0200)]
zebra: Fix wrong variable used in `for` loop

The `for` loop starting at line 1848 searches the `func_allocated` array
for a pointer that points to a specific `sid_wide_func` element.

The loop should iterate over all the elements of the `func_allocated`
array and dereference each element to see if it is the one we are
looking for.

Currently, the loop is using the wrong variable to iterate over the
array.

Let's fix this issue by using the correct variable in the loop.

Fixes CID 1594014
Fixes CID 1594016

** CID 1594014:  Null pointer dereferences  (FORWARD_NULL)
/zebra/zebra_srv6.c: 1860 in release_srv6_sid_func_explicit()

________________________________________________________________________________________________________
*** CID 1594014:  Null pointer dereferences  (FORWARD_NULL)
/zebra/zebra_srv6.c: 1860 in release_srv6_sid_func_explicit()
1854
1855      /* Lookup SID function in the functions allocated list of EWLIB range */
1856      for (ALL_LIST_ELEMENTS_RO(block->u.usid
1857        .wide_lib[sid_func]
1858        .func_allocated,
1859        node, sid_func_ptr))
     CID 1594014:  Null pointer dereferences  (FORWARD_NULL)
     Dereferencing null pointer "sid_wide_func_ptr".
1860      if (*sid_wide_func_ptr == sid_wide_func)
1861      break;
1862
1863      /* Ensure that the SID function is allocated */
1864      if (!sid_wide_func_ptr) {
1865      zlog_warn("%s: failed to release wide SID function %u, function is not allocated",

** CID 1594016:  Possible Control flow issues  (DEADCODE)
/zebra/zebra_srv6.c: 1871 in release_srv6_sid_func_explicit()

________________________________________________________________________________________________________
*** CID 1594016:  Possible Control flow issues  (DEADCODE)
/zebra/zebra_srv6.c: 1871 in release_srv6_sid_func_explicit()
1865      zlog_warn("%s: failed to release wide SID function %u, function is not allocated",
1866        __func__, sid_wide_func);
1867      return -1;
1868      }
1869
1870      /* Release the SID function from the EWLIB range */
     CID 1594016:  Possible Control flow issues  (DEADCODE)
     Execution cannot reach this statement: "listnode_delete(block->u.us...".
1871      listnode_delete(block->u.usid.wide_lib[sid_func]
1872      .func_allocated,
1873      sid_wide_func_ptr);
1874      zebra_srv6_sid_func_free(sid_wide_func_ptr);
1875      } else {
1876      zlog_warn("%s: function %u is outside ELIB [%u/%u] and EWLIB alloc ranges [%u/%u]",

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
10 months agozebra: Remove dead SRv6 code
Carmine Scarpitta [Fri, 21 Jun 2024 15:01:49 +0000 (17:01 +0200)]
zebra: Remove dead SRv6 code

At line 1736, `alloc_mode` is set to `SRV6_SID_ALLOC_MODE_EXPLICIT` or
`SRV6_SID_ALLOC_MODE_DYNAMIC` depending on the `sid_value` variable.

There will never be a case where alloc_mode will be `SRV6_SID_ALLOC_MODE_MAX`
or `SRV6_SID_ALLOC_MODE_UNSPEC`.

Let's replace the `switch(alloc_mode) {...}` with an if-else.

Fixes CID 1594015.

** CID 1594015:    (DEADCODE)
/zebra/zebra_srv6.c: 1782 in get_srv6_sid()
/zebra/zebra_srv6.c: 1781 in get_srv6_sid()

________________________________________________________________________________________________________
*** CID 1594015:    (DEADCODE)
/zebra/zebra_srv6.c: 1782 in get_srv6_sid()
1776      }
1777
1778      ret = get_srv6_sid_dynamic(sid, ctx, locator);
1779
1780      break;
1781      case SRV6_SID_ALLOC_MODE_MAX:
     CID 1594015:    (DEADCODE)
     Execution cannot reach this statement: "case SRV6_SID_ALLOC_MODE_UN...".
1782      case SRV6_SID_ALLOC_MODE_UNSPEC:
1783      default:
1784      flog_err(EC_ZEBRA_SM_CANNOT_ASSIGN_SID,
1785       "%s: SRv6 Manager: Unrecognized alloc mode %u",
1786       __func__, alloc_mode);
1787      /* We should never arrive here */
/zebra/zebra_srv6.c: 1781 in get_srv6_sid()
1775      return -1;
1776      }
1777
1778      ret = get_srv6_sid_dynamic(sid, ctx, locator);
1779
1780      break;
     CID 1594015:    (DEADCODE)
     Execution cannot reach this statement: "case SRV6_SID_ALLOC_MODE_MAX:".
1781      case SRV6_SID_ALLOC_MODE_MAX:
1782      case SRV6_SID_ALLOC_MODE_UNSPEC:
1783      default:
1784      flog_err(EC_ZEBRA_SM_CANNOT_ASSIGN_SID,
1785       "%s: SRv6 Manager: Unrecognized alloc mode %u",
1786       __func__, alloc_mode);

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
10 months agoisisd: fix display crash srv6 sid structure in json
Louis Scalbert [Fri, 21 Jun 2024 08:59:43 +0000 (10:59 +0200)]
isisd: fix display crash srv6 sid structure in json

Fix a crash when doing "show isis database detail json" in
isis_srv6_topo1 topotest.

> #0  raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50
> #1  0x00007fad89524e2c in core_handler (signo=6, siginfo=0x7ffe86a4b8b0, context=0x7ffe86a4b780) at lib/sigevent.c:258
> #2  <signal handler called>
> #3  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
> #4  0x00007fad8904e537 in __GI_abort () at abort.c:79
> #5  0x00007fad8904e40f in __assert_fail_base (fmt=0x7fad891c5688 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7fad8a3e70e8 "json_object_get_type(jso) == json_type_object",
>     file=0x7fad8a3e7064 "./json_object.c", line=590, function=<optimized out>) at assert.c:92
> #6  0x00007fad8905d662 in __GI___assert_fail (assertion=0x7fad8a3e70e8 "json_object_get_type(jso) == json_type_object", file=0x7fad8a3e7064 "./json_object.c", line=590,
>     function=0x7fad8a3e7440 "json_object_object_add_ex") at assert.c:101
> #7  0x00007fad8a3dfe93 in json_object_object_add_ex () from /lib/x86_64-linux-gnu/libjson-c.so.5
> #8  0x000055708e3f8f7f in format_subsubtlv_srv6_sid_structure (sid_struct=0x602000172b70, buf=0x0, json=0x6040000a21d0, indent=6) at isisd/isis_tlvs.c:2880
> #9  0x000055708e3f9acb in isis_format_subsubtlvs (subsubtlvs=0x602000172b50, buf=0x0, json=0x6040000a21d0, indent=6) at isisd/isis_tlvs.c:3022
> #10 0x000055708e3eefb0 in format_item_ext_subtlvs (exts=0x614000047440, buf=0x0, json=0x6040000a2190, indent=2, mtid=2) at isisd/isis_tlvs.c:1313
> #11 0x000055708e3fd599 in format_item_extended_reach (mtid=2, i=0x60300015aed0, buf=0x0, json=0x6040000a1bd0, indent=0) at isisd/isis_tlvs.c:3763
> #12 0x000055708e40d46a in format_item (mtid=2, context=ISIS_CONTEXT_LSP, type=ISIS_TLV_MT_REACH, i=0x60300015aed0, buf=0x0, json=0x6040000a1bd0, indent=0) at isisd/isis_tlvs.c:6789
> #13 0x000055708e40d4fc in format_items_ (mtid=2, context=ISIS_CONTEXT_LSP, type=ISIS_TLV_MT_REACH, items=0x60600021d160, buf=0x0, json=0x6040000a1bd0, indent=0) at isisd/isis_tlvs.c:6804
> #14 0x000055708e40edbc in format_mt_items (context=ISIS_CONTEXT_LSP, type=ISIS_TLV_MT_REACH, m=0x6180000845d8, buf=0x0, json=0x6040000a1bd0, indent=0) at isisd/isis_tlvs.c:7147
> #15 0x000055708e4111e9 in format_tlvs (tlvs=0x618000084480, buf=0x0, json=0x6040000a1bd0, indent=0) at isisd/isis_tlvs.c:7572
> #16 0x000055708e4114ce in isis_format_tlvs (tlvs=0x618000084480, json=0x6040000a1bd0) at isisd/isis_tlvs.c:7613
> #17 0x000055708e36f167 in lsp_print_detail (lsp=0x612000058b40, vty=0x0, json=0x6040000a1bd0, dynhost=1 '\001', isis=0x60d00001f800) at isisd/isis_lsp.c:785
> #18 0x000055708e36f31f in lsp_print_all (vty=0x0, json=0x6040000a0490, head=0x61f000005488, detail=1 '\001', dynhost=1 '\001', isis=0x60d00001f800) at isisd/isis_lsp.c:820
> #19 0x000055708e4379fc in show_isis_database_lspdb_json (json=0x6040000a0450, area=0x61f000005480, level=0, lspdb=0x61f000005488, sysid_str=0x0, ui_level=1) at isisd/isisd.c:2683
> #20 0x000055708e437ef9 in show_isis_database_json (json=0x6040000a0310, sysid_str=0x0, ui_level=1, isis=0x60d00001f800) at isisd/isisd.c:2754
> #21 0x000055708e438357 in show_isis_database_common (vty=0x62e000060400, json=0x6040000a0310, sysid_str=0x0, ui_level=1, isis=0x60d00001f800) at isisd/isisd.c:2788
> #22 0x000055708e438591 in show_isis_database (vty=0x62e000060400, json=0x6040000a0310, sysid_str=0x0, ui_level=1, vrf_name=0x7fad89806300 <vrf_default_name> "default", all_vrf=false)
>     at isisd/isisd.c:2825
> #23 0x000055708e43891d in show_database (self=0x55708e5519c0 <show_database_cmd>, vty=0x62e000060400, argc=5, argv=0x6040000a02d0) at isisd/isisd.c:2855
> #24 0x00007fad893a9767 in cmd_execute_command_real (vline=0x60300015f220, vty=0x62e000060400, cmd=0x0, up_level=0) at lib/command.c:1002
> #25 0x00007fad893a9adc in cmd_execute_command (vline=0x60300015f220, vty=0x62e000060400, cmd=0x0, vtysh=0) at lib/command.c:1061
> #26 0x00007fad893aa728 in cmd_execute (vty=0x62e000060400, cmd=0x621000025900 "show isis database detail json ", matched=0x0, vtysh=0) at lib/command.c:1227

Note that prior to 2e670cd779, there was no crash but only the last
"srv6-sid-structure" was displayed. A "srv6-sid-structure" should be
displayed for each "sid". This commit also fix this.

Was:

> "srv6-lan-endx-sid": [
>   {
>     "sid": "fc00:0:1:1::",
>     "weight": 0,
>     "algorithm": "SPF",
>     "neighbor-id": "0000.0000.0002"
>   },
>   {
>     "sid": "fc00:0:1:2::",
>     "weight": 0,
>     "algorithm": "SPF",
>     "neighbor-id": "0000.0000.0003"
>   }
> ],
> "srv6-sid-structure": {
>   "loc-block-len": 32,
>   "loc-node-len": 16,
>   "func-len": 16,
>   "arg-len": 0
> },

Now (srv6-sid-structure are identical but they are not always):

> "srv6-lan-endx-sid": [
>   {
>     "sid": "fc00:0:1:1::",
>     "algorithm": "SPF",
>     "neighbor-id": "0000.0000.0002",
>     "srv6-sid-structure": {
>       "loc-block-len": 32,
>       "loc-node-len": 16,
>       "func-len": 8,
>       "arg-len": 0
>     },
>   },
>   {
>     "sid": "fc00:0:1:2::",
>     "algorithm": "SPF",
>     "neighbor-id": "0000.0000.0003",
>     "srv6-sid-structure": {
>       "loc-block-len": 32,
>       "loc-node-len": 16,
>       "func-len": 16,
>       "arg-len": 0
>     },
>   }
> ],

Fixes: 2e670cd779 ("isisd: fix display of srv6 subsubtlvs")
Fixes: 648a158802 ("isisd: Add SRv6 End.X SID to Sub-TLV format func")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
10 months agoisisd: change the json output for isis routes
Philippe Guibert [Wed, 19 Jun 2024 14:10:48 +0000 (16:10 +0200)]
isisd: change the json output for isis routes

The json format for json routes should be compliant with caml format.

Before:

> "Prefix|Metric|Interface|Nexthop|SID|LabelOp|Algo":
> "Prefix|Metric|Interface|Nexthop|Label(s)");

After:

> "prefix|metric|interface|nextHop|segmentIdentifier|labelOperation|Algorithm":
> "prefix|metric|interface|nextHop|label(s)");

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agoisisd: override json fields for monitored paths
Philippe Guibert [Wed, 19 Jun 2024 14:05:33 +0000 (16:05 +0200)]
isisd: override json fields for monitored paths

The json output for isis route paths should use caml format.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agotopotests: isis_topo1_vrf, align json support on 'show isis topology' command
Philippe Guibert [Fri, 14 Jun 2024 14:22:56 +0000 (16:22 +0200)]
topotests: isis_topo1_vrf, align json support on 'show isis topology' command

Add the json support from ISIS vty command.
> show isis vrf vrf1 topology json

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agotopotests: isis_topo1, use 'show isis topology json' command
Philippe Guibert [Fri, 14 Jun 2024 08:18:15 +0000 (10:18 +0200)]
topotests: isis_topo1, use 'show isis topology json' command

Add the json support from ISIS vty command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agoisisd: add json support for 'show isis topology' command
Philippe Guibert [Fri, 14 Jun 2024 06:57:16 +0000 (08:57 +0200)]
isisd: add json support for 'show isis topology' command

Add the json keyword for dumping isis topology.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agoisisd: add json support to display spf paths in 'show isis route'
Philippe Guibert [Thu, 6 Jun 2024 15:08:56 +0000 (17:08 +0200)]
isisd: add json support to display spf paths in 'show isis route'

The 'show isis route json' command never displays the list of
paths. Add the json support for this sub-part.

> # show isis route json
> [..]
> "ipv6-paths":[
>  {
>   "Vertex":"rt1",
>   "Type":"",
>   "Metric":0,
>   "Next-Hop":"",
>   "Interface":"",
>   "Parent":""
>  },
>  {
>    "Vertex":"2001:db8:1000::1\/128",
>    "Type":"IP6 internal",
>    "Metric":0,
>    "Next-Hop":"",
>    "Interface":"",
>    "Parent":"rt1(4)"
>  },

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agoisisd: show isis route uses ttable for paths
Philippe Guibert [Thu, 6 Jun 2024 16:03:24 +0000 (18:03 +0200)]
isisd: show isis route uses ttable for paths

This is a preliminary commit, so that route paths are visible from json.

Before:
> IS-IS paths to level-1 routers that speak IPv6
> Vertex               Type         Metric Next-Hop             Interface Parent
> rt1
> 2001:db8:1000::1/128 IP6 internal 0                                     rt1(4)
> rt2                  TE-IS        10     rt2                  eth-rt2   rt1(4)
> rt3                  TE-IS        10     rt3                  eth-rt3   rt1(4)
> 2001:db8:1000::2/128 IP6 internal 20     rt2                  eth-rt2   rt2(4)
> 2001:db8:1000::3/128 IP6 internal 20     rt3                  eth-rt3   rt3(4)

After:
> Vertex                Type          Metric  Next-Hop  Interface  Parent
>  -------------------------------------------------------------------------
>  rt1
>  2001:db8:1000::1/128  IP6 internal  0                            rt1(4)
>  rt2                   TE-IS         10      rt2       eth-rt2    rt1(4)
>  rt3                   TE-IS         10      rt3       eth-rt3    rt1(4)
>  2001:db8:1000::2/128  IP6 internal  20      rt2       eth-rt2    rt2(4)
>  2001:db8:1000::3/128  IP6 internal  20      rt3       eth-rt3    rt3(4)

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
10 months agotools/checkpatch: accept pim_* typedefs
David Lamparter [Fri, 21 Jun 2024 09:32:05 +0000 (11:32 +0200)]
tools/checkpatch: accept pim_* typedefs

pimd uses "v4/v6 dispatch" typedefs.  Don't complain about those in
checkpatch.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
10 months agoMerge pull request #16252 from chiragshah6/evpn_dev1
Donatas Abraitis [Fri, 21 Jun 2024 06:46:07 +0000 (09:46 +0300)]
Merge pull request #16252 from chiragshah6/evpn_dev1

zebra: fix evpn mh bond member proto reinstall