summaryrefslogtreecommitdiffstats
path: root/pathd/path_cli.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-09-09 15:02:12 +0200
committerDonald Sharp <sharpd@nvidia.com>2021-09-09 15:02:12 +0200
commite81a74a64255913e529455ff16ab1f64ea1cca39 (patch)
treedcbb1782debf41fd47e3070c7175d413f407907b /pathd/path_cli.c
parenttests: We follow strict prototyping rules (diff)
downloadfrr-e81a74a64255913e529455ff16ab1f64ea1cca39.tar.xz
frr-e81a74a64255913e529455ff16ab1f64ea1cca39.zip
pathd: Ensure node_src_id is inited before usage
Compiler is warning that node_src_id may be used uninited we know this is not possible but the compiler doesn't. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'pathd/path_cli.c')
-rw-r--r--pathd/path_cli.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/pathd/path_cli.c b/pathd/path_cli.c
index bd629a2b7..46242fd05 100644
--- a/pathd/path_cli.c
+++ b/pathd/path_cli.c
@@ -352,7 +352,16 @@ static int segment_list_has_src_dst(
nb_cli_enqueue_change(vty, xpath, NB_OP_MODIFY,
"ipv6_adjacency");
node_src_id = adj_src_ipv6_str;
+ } else {
+ /*
+ * This is just to make the compiler happy about
+ * node_src_id not being initialized. This
+ * should never happen unless we change the cli
+ * function.
+ */
+ assert(!"We must have a adj_src_ipv4_str or a adj_src_ipv6_str");
}
+
/* addresses */
snprintf(xpath, XPATH_MAXLEN, "./segment[index='%s']/nai/local-address",
index_str);