]> git.puffer.fish Git - mirror/frr.git/commitdiff
pathd: Ensure node_src_id is inited before usage
authorDonald Sharp <sharpd@nvidia.com>
Thu, 9 Sep 2021 13:02:12 +0000 (09:02 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 9 Sep 2021 13:02:12 +0000 (09:02 -0400)
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>
pathd/path_cli.c

index bd629a2b7048feaa4e3fdca249cdce7bbfd3be0e..46242fd05a6de8353c3566dd9cd579e616532eaf 100644 (file)
@@ -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);