summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_sr.c
diff options
context:
space:
mode:
authorOlivier Dugeon <olivier.dugeon@orange.com>2020-10-23 17:39:53 +0200
committerOlivier Dugeon <olivier.dugeon@orange.com>2020-10-23 19:01:15 +0200
commita351b3e4d29478a9d617145f79e8594945484edc (patch)
tree10dcee8e801d2f80b1b64cac91a970d403b23dd5 /ospfd/ospf_sr.c
parentMerge pull request #7345 from opensourcerouting/bgp-aggr-suppress (diff)
downloadfrr-a351b3e4d29478a9d617145f79e8594945484edc.tar.xz
frr-a351b3e4d29478a9d617145f79e8594945484edc.zip
ospfd: Add more Segment Routing controls
When Segment Routing is not enabled, some related output messages are printed on the console especially when Segment Routing Debug is enabled. This patch adds additional controls to check whether segment routing is enabled or not. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Diffstat (limited to 'ospfd/ospf_sr.c')
-rw-r--r--ospfd/ospf_sr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c
index 4e32732c8..e3b8f2f46 100644
--- a/ospfd/ospf_sr.c
+++ b/ospfd/ospf_sr.c
@@ -516,6 +516,9 @@ static int ospf_sr_start(struct ospf *ospf)
static void ospf_sr_stop(void)
{
+ if (OspfSR.status == SR_OFF)
+ return;
+
osr_debug("SR (%s): Stop Segment Routing", __func__);
/* Disable any re-attempt to connect to Label Manager */
@@ -1883,7 +1886,8 @@ void ospf_sr_update_task(struct ospf *ospf)
struct timeval start_time, stop_time;
- if (ospf == NULL)
+ /* Check ospf and SR status */
+ if ((ospf == NULL) || (OspfSR.status != SR_UP))
return;
monotime(&start_time);