]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_sr.c
lib: enforce vrf_name_to_id by returning default_vrf when name is null
[mirror_frr.git] / ospfd / ospf_sr.c
index d793735003b25a72d1a336d30e41989754eff783..43842e414e007e9fe5bd4d659d9c8ab8da94ca75 100644 (file)
@@ -94,7 +94,7 @@ static unsigned int sr_hash(void *p)
 }
 
 /* Compare 2 Router ID hash entries based on SR Node */
-static int sr_cmp(const void *p1, const void *p2)
+static bool sr_cmp(const void *p1, const void *p2)
 {
        const struct sr_node *srn = p1;
        const struct in_addr *rid = p2;
@@ -2053,6 +2053,9 @@ DEFUN (no_sr_prefix_sid,
        bool found = false;
        int rc;
 
+       if (!ospf_sr_enabled(vty))
+               return CMD_WARNING_CONFIG_FAILED;
+
        /* Get network prefix */
        argv_find(argv, argc, "A.B.C.D/M", &idx);
        rc = str2prefix(argv[idx]->arg, &p);