Commit graph

37 commits

Author SHA1 Message Date
Carmine Scarpitta 6037ea350c staticd: Fix crash that occurs when modifying an SRv6 SID
When the user modifies an SRv6 SID and then removes all SIDs, staticd
crashes:

```
2025/03/23 08:37:22.691860 STATIC: lib/memory.c:74: mt_count_free(): assertion (mt->n_alloc) failed
STATIC: Received signal 6 at 1742715442 (si_addr 0x8200007cf0); aborting...
STATIC: zlog_signal+0x390                  fcc704a844b8     ffffd7450390 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: core_handler+0x1f8                 fcc704b79990     ffffd7450590 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC:     ---- signal ----
STATIC: ?                                  fcc705c008f8     ffffd74507a0 linux-vdso.so.1 (mapped at 0xfcc705c00000)
STATIC: pthread_key_delete+0x1a0           fcc70458f1f0     ffffd7451a00 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: raise+0x1c                         fcc70454a67c     ffffd7451ad0 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: abort+0xe4                         fcc704537130     ffffd7451af0 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: _zlog_assert_failed+0x3c4          fcc704c407c8     ffffd7451c40 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: mt_count_free+0x12c                fcc704a93c74     ffffd7451dc0 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: qfree+0x28                         fcc704a93fa0     ffffd7451e70 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: static_srv6_sid_free+0x1c          adc1df8fa544     ffffd7451e90 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: delete_static_srv6_sid+0x14        adc1df8faafc     ffffd7451eb0 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: list_delete_all_node+0x104         fcc704a60eec     ffffd7451ed0 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: list_delete+0x8c                   fcc704a61054     ffffd7451f00 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: static_srv6_cleanup+0x20           adc1df8fabdc     ffffd7451f20 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: sigint+0x40                        adc1df8be544     ffffd7451f30 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: frr_sigevent_process+0x148         fcc704b79460     ffffd7451f40 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: event_fetch+0x1c4                  fcc704bc0834     ffffd7451f60 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: frr_run+0x650                      fcc704a5d230     ffffd7452080 /usr/lib/frr/libfrr.so.0 (mapped at 0xfcc704800000)
STATIC: main+0x1d0                         adc1df8be75c     ffffd7452270 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
STATIC: __libc_init_first+0x7c             fcc7045373fc     ffffd74522b0 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: __libc_start_main+0x98             fcc7045374cc     ffffd74523c0 /lib/aarch64-linux-gnu/libc.so.6 (mapped at 0xfcc704510000)
STATIC: _start+0x30                        adc1df8be0f0     ffffd7452420 /usr/lib/frr/staticd (mapped at 0xadc1df8a0000)
```

Tracking this down, the crash occurs because every time we modify a
SID, staticd executes some callbacks to modify the SID and finally it
calls `apply_finish`, which re-adds the SID to the list `srv6_sids`.

This leads to having the same SID multiple times in the `srv6_sids`
list. When we delete all SIDs, staticd attempts to deallocate the same
SID multiple times, which leads to the crash.

This commit fixes the issue by moving the code that adds the SID to the
list from the `apply_finish` callback to the `create` callback.
This ensures that the SID is inserted into the list only once, when it
is created. For all subsequent modifications, the SID is modified but
not added to the list.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-03-23 18:46:45 +01:00
Carmine Scarpitta a138ce525d staticd: Do not log uninitialized nexthop variable
When running valgrind, the following error is observed.

```
==2474568== Memcheck, a memory error detector
==2474568== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==2474568== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==2474568== Command: /usr/lib/frr/staticd --command-log-always --log file:staticd.log --log-level debug -d
==2474568== Parent PID: 2474525
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B32A: inet_ntop (ntop.c:105)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B334: inet_ntop (ntop.c:105)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B343: inet_ntop (ntop.c:105)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B34D: inet_ntop (ntop.c:105)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B35B: inet_ntop (ntop.c:105)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B367: inet_ntop (ntop.c:105)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B6B9: inet_ntop (ntop.c:105)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B6C6: inet_ntop (ntop.c:105)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B3AA: inet_ntop (ntop.c:105)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B708: inet_ntop (ntop.c:105)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B711: inet_ntop (ntop.c:105)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B3DE: inet_ntop (ntop.c:105)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B3E8: inet_ntop (ntop.c:105)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B499: puthex (ntop.c:64)
==2474568==    by 0x490B499: inet_ntop (ntop.c:150)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B73D: puthex (ntop.c:66)
==2474568==    by 0x490B73D: inet_ntop (ntop.c:150)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Conditional jump or move depends on uninitialised value(s)
==2474568==    at 0x490B747: puthex (ntop.c:68)
==2474568==    by 0x490B747: inet_ntop (ntop.c:150)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Use of uninitialised value of size 8
==2474568==    at 0x490B4D2: puthex (ntop.c:69)
==2474568==    by 0x490B4D2: inet_ntop (ntop.c:150)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Use of uninitialised value of size 8
==2474568==    at 0x490B4DD: puthex (ntop.c:70)
==2474568==    by 0x490B4DD: inet_ntop (ntop.c:150)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Use of uninitialised value of size 8
==2474568==    at 0x490B4A8: puthex (ntop.c:65)
==2474568==    by 0x490B4A8: inet_ntop (ntop.c:150)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== Use of uninitialised value of size 8
==2474568==    at 0x490B4BC: puthex (ntop.c:67)
==2474568==    by 0x490B4BC: inet_ntop (ntop.c:150)
==2474568==    by 0x49AB9CB: printfrr_i6 (prefix.c:1614)
==2474568==    by 0x4A24B19: printfrr_extp (glue.c:220)
==2474568==    by 0x4A2286E: vbprintfrr (vfprintf.c:626)
==2474568==    by 0x4A12AE2: zlog_msg_text (zlog.c:838)
==2474568==    by 0x4A11B83: vzlog_tls (zlog.c:497)
==2474568==    by 0x4A12561: vzlogx (zlog.c:722)
==2474568==    by 0x129AE8: zlog_ref (zlog.h:84)
==2474568==    by 0x12BD35: routing_control_plane_protocols_control_plane_protocol_staticd_segment_routing_srv6_local_sids_sid_paths_next_hop_modify (static_nb_config.c:1299)
==2474568==    by 0x498ABF8: nb_callback_modify (northbound.c:1579)
==2474568==    by 0x498BB35: nb_callback_configuration (northbound.c:1930)
==2474568==    by 0x498A03C: nb_candidate_validate_code (northbound.c:1287)
==2474568==    by 0x498A2C1: nb_candidate_commit_prepare (northbound.c:1358)
==2474568==    by 0x496F414: mgmt_be_txn_cfg_prepare (mgmt_be_client.c:579)
==2474568==    by 0x496FBB8: mgmt_be_process_cfgdata_req (mgmt_be_client.c:717)
==2474568==    by 0x49703A9: mgmt_be_client_handle_msg (mgmt_be_client.c:851)
==2474568==    by 0x49718B9: mgmt_be_client_process_msg (mgmt_be_client.c:1261)
==2474568==    by 0x4976810: mgmt_msg_procbufs (mgmt_msg.c:193)
==2474568==    by 0x497771A: msg_conn_proc_msgs (mgmt_msg.c:526)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568==
==2474568== HEAP SUMMARY:
==2474568==     in use at exit: 2,098 bytes in 8 blocks
==2474568==   total heap usage: 48,668 allocs, 48,660 frees, 15,837,383 bytes allocated
==2474568==
==2474568== 69 bytes in 1 blocks are still reachable in loss record 3 of 8
==2474568==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2474568==    by 0x4D2058E: strdup (strdup.c:42)
==2474568==    by 0x496CA96: qstrdup (memory.c:118)
==2474568==    by 0x4A1DD4B: zlog_file_set_filename (zlog_targets.c:244)
==2474568==    by 0x4969ADA: set_log_file (log_vty.c:371)
==2474568==    by 0x4969CD0: command_setup_early_logging (log_vty.c:419)
==2474568==    by 0x49576FE: frr_init (libfrr.c:770)
==2474568==    by 0x1156C6: main (static_main.c:164)
==2474568==
==2474568== 69 bytes in 1 blocks are still reachable in loss record 4 of 8
==2474568==    at 0x4848899: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==2474568==    by 0x4D2058E: strdup (strdup.c:42)
==2474568==    by 0x496CA96: qstrdup (memory.c:118)
==2474568==    by 0x4A1DD4B: zlog_file_set_filename (zlog_targets.c:244)
==2474568==    by 0x4969ADA: set_log_file (log_vty.c:371)
==2474568==    by 0x496A052: config_log_file_magic (log_vty.c:542)
==2474568==    by 0x496845F: config_log_file (log_vty_clippy.c:148)
==2474568==    by 0x4915E8B: cmd_execute_command_real (command.c:1003)
==2474568==    by 0x4916004: cmd_execute_command (command.c:1062)
==2474568==    by 0x49165B4: cmd_execute (command.c:1228)
==2474568==    by 0x49EB7EA: vty_command (vty.c:626)
==2474568==    by 0x49ED70E: vty_execute (vty.c:1389)
==2474568==    by 0x49EFF39: vtysh_read (vty.c:2408)
==2474568==    by 0x49E40E2: event_call (event.c:2019)
==2474568==    by 0x4958AD9: frr_run (libfrr.c:1246)
==2474568==    by 0x11581D: main (static_main.c:193)
==2474568==
==2474568== LEAK SUMMARY:
==2474568==    definitely lost: 0 bytes in 0 blocks
==2474568==    indirectly lost: 0 bytes in 0 blocks
==2474568==      possibly lost: 0 bytes in 0 blocks
==2474568==    still reachable: 138 bytes in 2 blocks
==2474568==         suppressed: 1,960 bytes in 6 blocks
==2474568==
==2474568== Use --track-origins=yes to see where uninitialised values come from
==2474568== For lists of detected and suppressed errors, rerun with: -s
==2474568== ERROR SUMMARY: 41 errors from 20 contexts (suppressed: 0 from 0)
```

The error is caused by staticd attempting to log the `nexthop` variable
before it is initialized.

Since logging that variable currently does not work and would not
provide any useful information anyway, this commit fixes the problem by
changing the staticd code to not log that variable.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-27 09:35:28 +01:00
Carmine Scarpitta 646c4f95d9 staticd: Add nb callbacks to configure a nexthop for SRv6 uA behavior
An SRv6 uA SID is associated with the interface and (optionally) the
IPv6 address of the nexthop.

This commit adds the modify and destroy nortbound callbacks required to
set the nexthop.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:51 +01:00
Carmine Scarpitta 7438a94eeb staticd: Add nb callbacks to configure an interface for SRv6 uA behavior
An SRv6 uA SID is associated with the interface and (optionally) the
IPv6 address of the nexthop.

This commit adds the modify and destroy nortbound callbacks required to
set the interface.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-26 07:19:51 +01:00
David Lamparter 3671ce36fd staticd: fix botched staticd YANG for dst-src
The staticd YANG conversion completely f*cked up dst-src routes.
Stupidly enough, the correct thing is much simpler as seen by the amount
of deletes in this commit.

This does, unfortunately, involve a rather annoying YANG edge case with
what should reasonably be an optional leaf as part of a list key, which
is not possible.  It uses `::/0` as unconditional filler instead, since
that is semantically correct.

The `test_yang_mgmt` topotest needed to be adjusted after this to add
`src-prefix='::/0'`.

Fixes: 88fa5104a0 ("staticd : Configuration northbound implementation")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-01-28 15:40:17 +01:00
Yuqing Zhao 07ba1cd8b8 staticd: Add Northbound APIs for SRv6
Add Northbound APIs to create/modify/destroy an SRv6 SID

Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
2025-01-18 10:28:49 +00:00
Igor Ryzhov cb781f6097 staticd: fix NB dependency hack
Currently, staticd configuration is tightly coupled with VRF existence.
Because of that, it has to use a hack in NB infrastructure to create a
VRF configuration when at least one static route is configured for this
VRF. This hack is incompatible with mgmtd, because mgmtd doesn't execute
configuration callbacks. Because of that, the configuration may become
out of sync between mgmtd and staticd. There are two main cases:

1. Create static route in a VRF. The VRF data node will be created
   automatically in staticd by the NB hack, but not in mgmtd.
2. Delete VRF which has some static routes configured. The static route
   configuration will be deleted from staticd by the NB hack, but not
   from mgmtd.

To fix the problem, decouple configuration of static routes from VRF
configuration. Now it is possible to configure static routes even if the
VRF doesn't exist yet. Once the VRF is created, staticd applies all the
preconfigured routes.

This change also fixes the problem with static routes being preserved in
the system when staticd "control-plane-protocol" container is deleted
but the VRF is still configured.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-02-02 00:57:59 +02:00
Igor Ryzhov 5dfa36b6a7 staticd: fix nexthops without interface
When interface is not set in "ip route" command, CLI passes "(null)" as
an interface name instead of an empty string. The actual code in turn
uses "nh->ifname[0] != 0" to check if the interface name was set. Fix
the problem by changing the "(null)" string into an empty string when
populating the nexthop structure.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-02-02 00:25:15 +02:00
Igor Ryzhov d205208f57 Revert "staticd: Accept full blackhole typed keywords for ip_route_cmd"
This reverts commit 76b2bc97e7.

This change is wrong for several reasons:
- it is backwards incompatible - previously it was always possible to
  create blackhole/reject routes using shortened versions of the words
  and it suddenly became impossible if there's an interface in the
  system with the same name
- it uses operational data for validation which is prohibited
- it doesn't really solve the problem with inability to create routes
  using interface names like `bla` or `rej`
2024-02-02 00:25:15 +02:00
Rafael Zalamena cad5ee56be
Merge pull request #14922 from louis-6wind/fix-bfd-static-source
staticd: fix changing to source auto in bfd monitor
2023-12-06 09:51:32 -03:00
Louis Scalbert 580c605194 staticd: fix changing to source auto in bfd monitor
When monitoring a static route with BFD multi-hop, the source IP can be
either configured or retrieved from NextHop-Tracking (NHT). After
removing a configured source, the source is supposed to be retrieved
from NHT but it remains to the previous value. This is problematic if
the user desires to fix the configuration of a incorrect source IP.

For example, theses two commands results in the incorrect state:

> ip route 10.0.0.0/24 10.1.0.1 bfd multi-hop source 10.2.2.2
> ip route 10.0.0.0/24 10.1.0.1 bfd multi-hop

When removing the source, BFD is unable to find the source from NHT via
bfd_nht_update() were called.

Force zebra to resend the information to BFD by unregistering and
registering again NHT. The (...)/frr-nexthops/nexthop northbound
apply_finish function will trigger a call to static_install_nexthop()
that does a call to static_zebra_nht_register(nh, true);

Fixes: b7ca809d1c ("lib: BFD automatic source selection")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2023-12-01 14:08:57 +01:00
Christian Hopps 2c01083d35 lib: all: remove './' from xpath 22% speedup
fixes #8299

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-29 14:37:23 -05:00
Russ White 90d19d1489
Merge pull request #14089 from dmytroshytyi-6WIND/srv6_multiple_segs_sids
bgpd,doc,lib,sharpd,staticd,yang,zebra: SRv6 multiple segs SIDs
2023-09-20 23:09:35 -04:00
Dmytro Shytyi b13b5f85f9 staticd: northbound srv6 hooks for segs stack yang model
Provive hooks for srv6 segs SIDs stack yang model.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
2023-09-20 15:07:15 +02:00
Donatas Abraitis a914bd1643 staticd: Check against NULL before dereferencing vrf
If VRF is not found by the given name, validate it and return an error.

Fixes: 76b2bc97e7 ("staticd: Accept full blackhole typed keywords for ip_route_cmd")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-20 15:25:29 +03:00
Donatas Abraitis 76b2bc97e7 staticd: Accept full blackhole typed keywords for ip_route_cmd
Before this patch we allow entering next-hop interface address as any string.

Like, we can type: `ip route 10.10.10.10/32 bla`, but this will create a blackhole
route instead of using an interface `bla`.

The same is with reject.

After the patch:

```
$ vtysh -c 'con' -c 'ip route 10.10.10.100/32 bla'
ERROR: SET_CONFIG request failed, Error: nexthop interface name must be (reject, blackhole)

$ ip link show dev bla
472: bla: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether fa:45:bd:f1:f8:f0 brd ff:ff:ff:ff:ff:ff

$ vtysh -c 'sh run | include ip route'
$ vtysh -c 'con' -c 'ip route 10.10.10.100/32 blac'
$ vtysh -c 'sh run | include ip route'
ip route 10.10.10.100/32 blackhole

$ vtysh -c 'con' -c 'no ip route 10.10.10.100/32 blac'
$ vtysh -c 'sh run | include ip route'
$ vtysh -c 'con' -c 'ip route 10.10.10.100/32 blackhole'
$ vtysh -c 'sh run | include ip route'
ip route 10.10.10.100/32 blackhole

$ vtysh -c 'con' -c 'no ip route 10.10.10.100/32 blackhole'
$ vtysh -c 'sh run | include ip route'
$ vtysh -c 'con' -c 'ip route 10.10.10.100/32 Null0'
$ vtysh -c 'sh run | include ip route'
ip route 10.10.10.100/32 Null0

$ vtysh -c 'con' -c 'no ip route 10.10.10.100/32 Null0'
$ vtysh -c 'sh run | include ip route'
$
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-08-25 12:00:33 +03:00
David Lamparter acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Rafael Zalamena 351ad68405 staticd: BFD integration northbound support
Implement all BFD integration northbound callbacks and integrate BFD
with `staticd` route installation procedure.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2023-01-13 15:32:12 -03:00
Donatas Abraitis 3278956b17 staticd: Do not crash when modifying an existing static route with color
```
$ vtysh -c 'conf' -c 'ip route 192.168.0.0/32 192.168.10.65 color 123'
$ vtysh -c 'show ip route 192.168.0.0/32 json' | jq '."192.168.0.0/32"[0].nexthops[0].srteColor'
123
$ vtysh -c 'conf' -c 'ip route 192.168.0.0/32 192.168.10.65'
$ vtysh -c 'show ip route 192.168.0.0/32 json' | jq '."192.168.0.0/32"[0].nexthops[0].srteColor'
0
```

Before this patch:
```
STATIC: Received signal 6 at 1666938633 (si_addr 0x4e1a, PC 0x7f295139c438); aborting...
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(zlog_backtrace_sigsafe+0x70) [0x7f29519ef0a0]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(zlog_signal+0xec) [0x7f29519ef28c]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xccee2) [0x7f2951a1aee2]
STATIC: /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390) [0x7f2951742390]
STATIC: /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38) [0x7f295139c438]
STATIC: /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f295139e03a]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(_zlog_assert_failed+0xe6) [0x7f2951a46766]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xae7ee) [0x7f29519fc7ee]
STATIC: /home/u1/mGIT/frr-master/staticd/.libs/lt-staticd(routing_control_plane_protocols_control_plane_protocol_staticd_route_list_src_
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xaf264) [0x7f29519fd264]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xafb4f) [0x7f29519fdb4f]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(nb_candidate_commit_apply+0x33) [0x7f29519fde33]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(nb_candidate_commit+0x9e) [0x7f29519fdf6e]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xb0469) [0x7f29519fe469]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xb3055) [0x7f2951a01055]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(nb_cli_apply_changes+0xd8) [0x7f2951a01358]
STATIC: /home/u1/mGIT/frr-master/staticd/.libs/lt-staticd() [0x407ec2]
STATIC: /home/u1/mGIT/frr-master/staticd/.libs/lt-staticd() [0x40a307]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0x74923) [0x7f29519c2923]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(cmd_execute_command+0xe4) [0x7f29519c2aa4]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(cmd_execute+0xc9) [0x7f29519c2c49]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xe4184) [0x7f2951a32184]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xe4436) [0x7f2951a32436]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(+0xe6fcc) [0x7f2951a34fcc]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(thread_call+0x98) [0x7f2951a2cc28]
STATIC: /home/u1/mGIT/frr-master/lib/.libs/libfrr.so.0(frr_run+0xe8) [0x7f29519e7518]
STATIC: /home/u1/mGIT/frr-master/staticd/.libs/lt-staticd(main+0xda) [0x40572a]
STATIC: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f2951387840]
STATIC: /home/u1/mGIT/frr-master/staticd/.libs/lt-staticd(_start+0x29) [0x4058e9]
STATIC: in thread vtysh_read scheduled from lib/vty.c:2710 vty_event()
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-11-25 16:22:34 +02:00
Donald Sharp eb6249d27d staticd: When changing the underlying nh ensure it is reinstalled
There exists some nexthop attributes that are not the unique
part of the nexthop and if you change the static route
with those values then the route is not being updated
in zebra with the new values:

Example of brokenness:

eva# conf
eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
  Known via "static", distance 1, metric 0, best
  Last update 00:00:05 ago
  * 192.168.119.1, via enp39s0, label 16020, weight 1

eva(config)# ip route 1.2.3.9/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.9
Routing entry for 1.2.3.9/32
  Known via "static", distance 1, metric 0, best
  Last update 00:00:12 ago
  * 192.168.119.1, via enp39s0, label 16020, weight 1

Fixed behavior:

eva# conf
eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16020
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
  Known via "static", distance 1, metric 0, best
  Last update 00:00:04 ago
  * 192.168.119.1, via enp39s0, label 16020, weight 1

eva(config)# ip route 1.2.3.10/32 192.168.119.1 enp39s0 label 16040
eva(config)# do show ip route 1.2.3.10
Routing entry for 1.2.3.10/32
  Known via "static", distance 1, metric 0, best
  Last update 00:00:01 ago
  * 192.168.119.1, via enp39s0, label 16040, weight 1

I've gone through most of the items in staticd that can change
the nexthop
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-08 16:02:40 -04:00
Mark Stapp 1f7ab1a2cc staticd: reject route config with too many nexthops
Restrict the number of nexthops for a route to the compiled-in
limit. Be careful with the zapi route struct's array of nexthops
too.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-02-17 09:56:40 -05:00
Mark Stapp 423e32cb01 staticd: fix spelling in an error message
whitespace change to fix a typo.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-02-17 09:48:07 -05:00
Igor Ryzhov 9ccaa12da6 staticd: convert typedef to enum
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-31 17:58:30 +03:00
Igor Ryzhov aaddf974c5 staticd: replace NB checks with assert
If there's no route table in a VRF, it's a hard bug - staticd will crash
on any subsequent action with this route anyway. So let's assert the
existence of a route table instead of returning an unrecoverable error.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-09 12:48:38 +03:00
Igor Ryzhov 4067e95140 staticd: simplify the northbound code
Add a couple of back pointers to static route/path/nexthop structures to
simplify the NB code and save ~200 lines.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-07-09 22:58:45 +03:00
Christian Hopps 3bb513c399 lib: adapt to version 2 of libyang
Compile with v2.0.0 tag of `libyang2` branch of:
https://github.com/CESNET/libyang

staticd init load time of 10k routes now 6s vs ly1 time of 150s

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-05-13 16:24:48 -04:00
David Lamparter 1f8031f79a *: make sure config.h or zebra.h is first
`config.h` has all the defines from autoconf, which may include things
that switch behavior of other included headers (e.g. _GNU_SOURCE
enabling prototypes for additional functions.)

So, the first include in any `.c` file must be either `config.h` (with
the appropriate guard) or `zebra.h` (which includes `config.h` first
thing.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-23 12:06:35 +02:00
Igor Ryzhov cd07806b29 staticd: forbid blackhole and non-blackhole nexthops in a single route
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-03-03 18:06:42 +03:00
Igor Ryzhov eec2baa01a staticd: fix nexthop creation and installation
Currently, staticd creates a VRF for the nexthop it is trying to install.
Later, when this nexthop is deleted, the VRF stays in the system and can
not be deleted by the user because "no vrf" command doesn't work for this
VRF because it was not created through northbound code.

There is no need to create the VRF. Just set nh_vrf_id to VRF_UNKNOWN
when the VRF doesn't exist.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-02-17 14:19:40 +03:00
Igor Ryzhov ddd455157e staticd: fix nexthop validation
When checking for local connected address used as a nexthop gateway, we
should check nexthop VRF, not route VRF.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-02-17 14:17:25 +03:00
Russ White 21a7815dc1
Merge pull request #7863 from chiragshah6/mdev
[yang,staticd]: remove when condition from static nexthop om
2021-01-19 07:48:28 -05:00
Chirag Shah 6dfc022ff2 staticd: handle when condition check in nb callbacks
At present, libyang validate api takes longer time to complete
for a transaction to complete if the same config is re-applied.
For instance if set of static routes are reapplied the config
completion takes longer than it took initial time.

One of the solution is to remove when statement from staticd nexthop yang OM.
When condition adds peformance toll on libyang's validate api.
The same when condition checks are done in frr northbound
validation phase (which are must faster).

With this change, if the same static routes are configured
agian and again, the time to completion does not go up and
perfomance does not degrade.

Ticket:CM-32530
Testing Done:

Configure 400 static routes across two vrfs and keep re-applying them.
The time to complete the config remains in few seconds.

Before:
root@bharat:~/stash/frr4# time vtysh -f static_route_cfg

real    0m19.877s
user    0m0.263s
sys 0m0.014s

After:
root@bharat:~/stash/frr4# time vtysh -f static_route_cfg

real    0m3.857s
user    0m0.239s
sys 0m0.034s

Co-developed-by: VishalDhingra <vdhingra@vmware.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
2021-01-13 09:24:25 -08:00
vdhingra ef4b6b2230 staticd: Backend cofiguration code to fix table-id problem
problem: table-id gets overwritten for a given route.

RCA: table-id was getting overwritten from the NB layer,
     So route was getting installed with the latest table-id.

Fix: make the table-id as the key in the NB layer.
     This will program the route in zebra correctly.

- Removed the table-id modify callbacks.
- Moved the validate and apply table-id changes to path-list creation

issue #7347

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2021-01-12 07:55:16 -08:00
vdhingra b2f6ab679c staticd : Added the warning log for route when VRF is not ready.
During the yangification of staticd, refactoring of code
around static_hold_route data struct has been done, In this
context warning log message when VRF is not ready had been
removed. This should not be removed, adding it back.

I have missed one MPLS validation too, adding it back.

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2020-08-31 21:12:21 -07:00
Sebastien Merle 065276ae1f staticd: add support for SR Policies
Configuration example:

    ip route 9.9.9.9/32 6.6.6.6 color 123

The SR Policy to be chosen is uniquely identified by the policy
endpoint (6.6.6.6) and the SR-TE color (123). Traffic will be
augmented with an MPLS label stack according to the active
candidate path of that particular policy.

Co-authored-by: GalaxyGorilla <sascha@netdef.org>
Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2020-08-12 13:28:48 +02:00
vdhingra 314825ff91 staticd: Added afi-safi as a key in route-list
To address the ip mroute command there is a need to add
safi as a key. So adding the afi-safi-type identityref
as a key.

Signed-off-by: VishalDhingra <vdhingra@vmware.com>
2020-07-16 08:40:45 -07:00
vdhingra 88fa5104a0 staticd : Configuration northbound implementation
1. Modifies the data structs to make the distance, tag and table-id
   property of a route, i.e created a hireachical data struct to save
   route and nexthop information.
2. Backend northbound implementation

Signed-off-by: VishalDhingra <vdhingra@vmware.com>
2020-07-16 08:33:00 -07:00