A user can configure static SIDs as follows:
[...]
segment-routing
srv6
static-sids
sid fcbb:bbbb:1::/48 locator MAIN behavior uN
sid fcbb:bbbb:1:fe00::/64 locator MAIN behavior uDT46
[...]
When the user runs vtysh and executes the `no srv6` command, the
expectation is that staticd will deallocate all SIDs.
However, currently FRR does not behaves as expected. After the user
executes `no srv6`, the SIDs are still present.
The problem is that vtysh does not forward the `no srv6` command to
mgmtd/staticd.
The `no srv6` command is defined using the `DEFUN_YANG_NOSH` macro,
which instructs `xref2vtysh.py` to skip the `no srv6` command during
the generation of `vtysh_cmd.c`. As a result, vtysh is unaware that it
should forward the `no srv6` command to mgmtd/staticd.
This commit fixes the issue by replacing `DEFUN_YANG_NOSH` with
`DEFUN_YANG`. This change ensures that `xref2vtysh.py` includes the
`no srv6` command when generating `vtysh_cmd.c` and makes vtysh forward
the `no srv6` command to mgmtd/staticd.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Currently, when the user tries to delete all static SIDs with the
`no static-sids` command, staticd returns an error.
```
router# config
router(config)# segment-routing
router(sr)# srv6
router(srv6)# no static-sids
% Unknown command: no static-sids
```
The problem is the `static-sids` command does not support the `no` form.
This PR enables the `no` form for the `static-sids` command.
```
router# config
router(config)# segment-routing
router(sr)# srv6
router(srv6)# no static-sids
```
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
This commit converts the `static-sids` command from `DEFUN` to `DEFPY`
to simplify the parsing of the command string definition.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
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>
This commit extends the SRv6 SIDs show CLI to display the configured
SRv6 uA SIDs.
```
segment-routing
srv6
static-sids
sid fcbb:bbbb:1:fe40::/64 locator MAIN behavior uA interface sr0 nexthop 2001::2
!
!
!
```
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
This commit extends the STATIC CLI to support the deletion of uA SIDs.
```
router(config)# no sid fcbb:bbbb:1:fe00::/64 locator MAIN behavior uA interface sr0 nexthop 2001::2
```
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
This commit extends the STATIC CLI to support the configuration of uA
SIDs.
```
router(config)# sid fcbb:bbbb:1:fe00::/64 locator MAIN behavior uA interface sr0 nexthop 2001::2
```
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
This commit extends the `static_zebra_srv6_sid_uninstall` function to
allow staticd to remove SRv6 uA SIDs from the zebra RIB.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
This commit extends the `static_zebra_srv6_sid_install` function to
allow staticd to install SRv6 uA SIDs into the zebra RIB.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
When removing an SRv6 uA SID, staticd should ask SRv6 SID Manager to
release the SID.
Currently, `static_zebra_release_srv6_sid` does not allow to release uA
SIDs.
This commit extends `static_zebra_release_srv6_sid` to allow staticd to
release SRv6 uA SIDs.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
In order to configure an SRv6 uA SID in staticd, staticd should request
SRv6 SID Manager to allocate a SID bound to the uA behavior.
Currently, `static_zebra_request_srv6_sid` does not support requesting
SIDs bound to the uA behavior.
This commit extends the `static_zebra_request_srv6_sid` function to
enable staticd to request SIDs bound to the uA behavior.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
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>
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>
With recent commit:
c1adc8f1d6 staticd has started to crash
aproximately 1/10 of the tine in the static_vrf topotest
(gdb) bt
0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=140400982256064) at ./nptl/pthread_kill.c:44
1 __pthread_kill_internal (signo=6, threadid=140400982256064) at ./nptl/pthread_kill.c:78
2 __GI___pthread_kill (threadid=140400982256064, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
3 0x00007fb1a6442476 in __GI_raise (sig=6) at ../sysdeps/posix/raise.c:26
4 0x00007fb1a6950823 in core_handler (signo=6, siginfo=0x7ffd6d832ff0, context=0x7ffd6d832ec0) at lib/sigevent.c:268
5 <signal handler called>
6 __pthread_kill_implementation (no_tid=0, signo=6, threadid=140400982256064) at ./nptl/pthread_kill.c:44
7 __pthread_kill_internal (signo=6, threadid=140400982256064) at ./nptl/pthread_kill.c:78
8 __GI___pthread_kill (threadid=140400982256064, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
9 0x00007fb1a6442476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
10 0x00007fb1a64287f3 in __GI_abort () at ./stdlib/abort.c:79
11 0x00007fb1a699a422 in _zlog_assert_failed (xref=0x55f7dfd3dac0 <_xref.117>,
extra=0x55f7dfd30c30 "BUG: NH %pFX registered but not in hashtable") at lib/zlog.c:789
12 0x000055f7dfd1201f in static_zebra_nht_register (nh=0x55f7fd2ecd80, reg=true) at staticd/static_zebra.c:333
13 0x000055f7dfd29c9d in static_install_nexthop (nh=0x55f7fd2ecd80) at staticd/static_routes.c:299
14 0x000055f7dfd2a126 in static_fixup_vrf (vrf=0x55f7fd2333a0, stable=0x55f7fd271030, afi=AFI_IP, safi=SAFI_UNICAST)
at staticd/static_routes.c:441
15 0x000055f7dfd2a2be in static_fixup_vrf_ids (vrf=0x55f7fd2333a0) at staticd/static_routes.c:494
16 0x000055f7dfd15b53 in static_vrf_enable (vrf=0x55f7fd2333a0) at staticd/static_vrf.c:124
17 0x00007fb1a696ffa5 in vrf_enable (vrf=0x55f7fd2333a0) at lib/vrf.c:325
18 0x00007fb1a6991c87 in zclient_vrf_add (cmd=33, zclient=0x55f7fd29f740, length=76, vrf_id=8) at lib/zclient.c:2701
19 0x00007fb1a6996cba in zclient_read (thread=0x7ffd6d834230) at lib/zclient.c:4764
20 0x00007fb1a696bd9b in event_call (thread=0x7ffd6d834230) at lib/event.c:2019
21 0x00007fb1a68e1a3a in frr_run (master=0x55f7fd102e10) at lib/libfrr.c:1246
22 0x000055f7dfd1081e in main (argc=7, argv=0x7ffd6d834478, envp=0x7ffd6d8344b8) at staticd/static_main.c:193
Tracking this down, the crash is because the nh believes that is already
registered but lookup fails, causing this assert. Looking at the code
static_fixup_vrf is changing the vrf_id. I put a zlog_debug right
before the change of the nh vrf_id and noticed that the vrf id was
UNKNOWN. So, the code is attempting to register into zebra the nexthop
with a vrf unknown( which will be ignored ).
Modify the code in the registration process to notice that the nh is
still UNKNOWN and as such nothing should be done.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Problem:
After networking restart, staticd unregistered the nexthop
but failed to register the nexthop again, which caused the
nexthop to remain inactive in zebra for static route.
Fix:
Call to static_zebra_nht_register() from static_install_path() was
removed in 3c05d53bf8. Adding it back
so that staticd can register the nexthop for static routes.
Testing:
After networking restart trigger on h1:
Before fix:
```
h1# show ipv6 route vrf vrf1012
Codes: K - kernel route, C - connected, L - local, S - static,
R - RIPng, O - OSPFv3, I - IS-IS, B - BGP, N - NHRP,
T - Table, A - Babel, D - SHARP, F - PBR, f - OpenFabric,
t - Table-Direct, Z - FRR,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
VRF vrf1012:
S ::/0 [1/0] via 2003:7:2::1, swp1.2 inactive, weight 1, 00:00:39
K>* ::/0 [255/8192] unreachable (ICMP unreachable) (vrf default), 00:00:39
L * 2000:9:12::3/128 is directly connected, vrf1012, 00:00:39
C>* 2000:9:12::3/128 is directly connected, vrf1012, 00:00:39
C>* 2003:7:2::/125 is directly connected, swp1.2, 00:00:37
L>* 2003:7:2::3/128 is directly connected, swp1.2, 00:00:37
C>* fe80::/64 is directly connected, swp1.2, 00:00:37
h1#
```
After fix:
```
h1# show ipv6 route vrf vrf1012
Codes: K - kernel route, C - connected, L - local, S - static,
R - RIPng, O - OSPFv3, I - IS-IS, B - BGP, N - NHRP,
T - Table, A - Babel, D - SHARP, F - PBR, f - OpenFabric,
t - Table-Direct, Z - FRR,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
VRF vrf1012:
S>* ::/0 [1/0] via 2003:7:2::1, swp1.2, weight 1, 00:00:15
K * ::/0 [255/8192] unreachable (ICMP unreachable) (vrf default), 00:00:17
L * 2000:9:12::3/128 is directly connected, vrf1012, 00:00:17
C>* 2000:9:12::3/128 is directly connected, vrf1012, 00:00:17
C>* 2003:7:2::/125 is directly connected, swp1.2, 00:00:15
L>* 2003:7:2::3/128 is directly connected, swp1.2, 00:00:15
```
Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
Some codepoints can not be read by interoperating with CISCO.
This is because PSP/USP flavor are used by default, and the display of
the isis output has to be adapted.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
The SRv6 support in staticd (PR #16894) does not set the correct SID
parameters (block length, node length, function length).
This commit fixes the issue and computes the correct parameters.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
When a user wants to delete a specific SRv6 SID, he executes the
`no sid X:X::X:X/M` command.
However, by mistake, in addition to deleting the SID requested by the
user, this command also removes all other SIDs.
This happens because `no sid X:X::X:X/M` triggers a destroy operation
on the wrong xpath `frr-staticd:staticd/segment-routing/srv6`.
This commit fixes the issue by replacing the wrong xpath
`frr-staticd:staticd/segment-routing/srv6` with the correct xpath
`frr-staticd:staticd/segment-routing/srv6/static-sids/sid[sid='%s']`.
This ensures that the `no sid X:X::X:X/M` command only deletes the SID
that was requested by the user.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
staticd already has a CLI to steer IPv6 traffic over a given SRv6 SID
list:
```
vrf vrf10
ipv6 route 2001:db8:1:1::/64 sr0 segments fcbb:bbbb:1:2:3:fe00::
```
This PR extends the existing CLI `ip route` to support steering of IPv4
traffic over an SRv6 SID list.
```
vrf vrf10
ip route 10.0.0.0/24 sr0 segments fcbb:bbbb:1:2:3:fe00::
```
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
staticd already has a CLI to steer IPv6 traffic over a given SRv6 SID
list:
```
ipv6 route 2001:db8:1:1::/64 sr0 segments fcbb:bbbb:1:2:3:fe00::
```
This PR extends the existing CLI `ip route` to support steering of IPv4
traffic over an SRv6 SID list.
```
ip route 10.0.0.0/24 sr0 segments fcbb:bbbb:1:2:3:fe00::
```
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
staticd already has a CLI to steer IPv6 traffic over a given SRv6 SID
list:
```
vrf vrf10
ipv6 route 2001:db8:1:1::/64 sr0 segments fcbb:bbbb:1:2:3:fe00::
```
This PR extends the existing CLI `ip route` to support steering of IPv4
traffic over an SRv6 SID list.
```
vrf vrf10
ip route 10.0.0.0/24 sr0 segments fcbb:bbbb:1:2:3:fe00::
```
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
staticd already has a CLI to steer IPv6 traffic over a given SRv6 SID
list:
```
ipv6 route 2001:db8:1:1::/64 sr0 segments fcbb:bbbb:1:2:3:fe00::
```
This PR extends the existing CLI `ip route` to support steering of IPv4
traffic over an SRv6 SID list.
```
ip route 10.0.0.0/24 sr0 segments fcbb:bbbb:1:2:3:fe00::
```
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
When staticd receives a `ZAPI_SRV6_SID_RELEASED` notification from SRv6
SID Manager, it tries to unset the validity flag of `sid`. But since
the `sid` variable is NULL, we get a NULL pointer dereference.
```
=================================================================
==13815==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000060 (pc 0xc14b813d9eac bp 0xffffcb135a40 sp 0xffffcb135a40 T0)
==13815==The signal is caused by a READ memory access.
==13815==Hint: address points to the zero page.
#0 0xc14b813d9eac in static_zebra_srv6_sid_notify staticd/static_zebra.c:1172
#1 0xe44e7aa2c194 in zclient_read lib/zclient.c:4746
#2 0xe44e7a9b69d8 in event_call lib/event.c:1984
#3 0xe44e7a85ac28 in frr_run lib/libfrr.c:1246
#4 0xc14b813ccf98 in main staticd/static_main.c:193
#5 0xe44e7a4773f8 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
#6 0xe44e7a4774c8 in __libc_start_main_impl ../csu/libc-start.c:392
#7 0xc14b813cc92c in _start (/usr/lib/frr/staticd+0x1c92c)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV staticd/static_zebra.c:1172 in static_zebra_srv6_sid_notify
==13815==ABORTING
```
This commit fixes the problem by doing a SID lookup first. If the SID
can't be found, we log an error and return. If the SID is found, we go
ahead and unset the validity flag.
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
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>
This commit adds datastructures and helper functions required to support SRv6 in staticd.
* List of locators
* List of SIDs
* Data structure to represent an SRv6 SID
* Functions to allocate/deallocate an SRv6 SID
* Functions to allocate, deallocate and lookup a locator
* Function to initialize/Cleanup SRv6
Signed-off-by: Yuqing Zhao <galadriel.zyq@alibaba-inc.com>
Currently FRR needs to send a uint16_t value for the number
of nexthops as well it needs the ability to properly decode
all of this. Find and handle all the places that this happens.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Implement common code for debug status output and remove daemon-specific
code that is duplicated everywhere.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Implement common code for debug config output and remove daemon-specific
code that is duplicated everywhere.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
The debug library allows to register a `debug_set_all` callback which
should enable all debugs in a daemon. This callback is implemented
exactly the same in each daemon. Instead of duplicating the code, rework
the lib to allow registration of each debug type, and implement the
common code only once in the lib.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
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>
When a static route with a gateway nexthop is created, the nexthop is
sent to zebra for NHT, and added to a local hash. When the nexthop's VRF
is deleted from kernel, nexthop still stays in the hash. This is a
memory leak, because it is never deleted from there. Even if the VRF is
recreated in kernel, it is assigned with a new `vrf_id` so the old hash
entry is not reused, and a new one is created. To fix the issue, remove
all nexthops from the hash when the corresponding VRF is deleted, do not
add nexthops to the hash if their corresponding VRF doesn't exist in
kernel and don't add the same nexthop to the hash multiple times.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
When processing an NHT update, we should go though all `static_vrf`
structures instead of regualar `vrf`, because some of `static_vrf` may
not have corresponding `vrf` and will miss the update.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>