]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: silently remove prefix sid already stored in config
authorPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 15 Feb 2022 16:18:30 +0000 (17:18 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 25 Mar 2022 14:18:34 +0000 (15:18 +0100)
There is no need to have an interface available to configure
SRGB. Conversely, it should be possible to remove the SRGB
when no interfaces are available.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
ospfd/ospf_sr.c

index e4059d05c2cc459bbe8e8a4fed592d6a8ed715db..21978d35ce268a19de422eb5035895ec5387158c 100644 (file)
@@ -2663,12 +2663,18 @@ DEFUN (no_sr_prefix_sid,
                return CMD_WARNING_CONFIG_FAILED;
        }
 
+       osr_debug("SR (%s): Remove Prefix %pFX with index %u", __func__,
+                 (struct prefix *)&srp->prefv4, srp->sid);
+
        /* Get Interface */
        ifp = if_lookup_by_index(srp->nhlfe.ifindex, VRF_DEFAULT);
        if (ifp == NULL) {
                vty_out(vty, "interface for prefix %s not found.\n",
                        argv[idx]->arg);
-               return CMD_WARNING_CONFIG_FAILED;
+               /* silently remove from list */
+               listnode_delete(OspfSR.self->ext_prefix, srp);
+               XFREE(MTYPE_OSPF_SR_PARAMS, srp);
+               return CMD_SUCCESS;
        }
 
        /* Update Extended Prefix LSA */
@@ -2677,9 +2683,6 @@ DEFUN (no_sr_prefix_sid,
                return CMD_WARNING;
        }
 
-       osr_debug("SR (%s): Remove Prefix %pFX with index %u", __func__,
-                 (struct prefix *)&srp->prefv4, srp->sid);
-
        /* Delete NHLFE if NO-PHP is set and EXPLICIT NULL not set */
        if (CHECK_FLAG(srp->flags, EXT_SUBTLV_PREFIX_SID_NPFLG)
            && !CHECK_FLAG(srp->flags, EXT_SUBTLV_PREFIX_SID_EFLG))