diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2022-02-15 17:18:30 +0100 | 
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2022-03-25 15:18:34 +0100 | 
| commit | 052a0cd0257f751cc1fec4d3972b179916ae9c63 (patch) | |
| tree | bc22e1cdab7b018c084b8c933cd6f9ddfbdfa56b /ospfd/ospf_sr.c | |
| parent | 52093e0f0e5753b753ae1b048f69b979ed3c75f6 (diff) | |
ospfd: silently remove prefix sid already stored in config
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>
Diffstat (limited to 'ospfd/ospf_sr.c')
| -rw-r--r-- | ospfd/ospf_sr.c | 11 | 
1 files changed, 7 insertions, 4 deletions
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c index e4059d05c2..21978d35ce 100644 --- a/ospfd/ospf_sr.c +++ b/ospfd/ospf_sr.c @@ -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))  | 
