]> git.proxmox.com Git - mirror_frr.git/blobdiff - isisd/isis_sr.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / isisd / isis_sr.c
index 18a727adde431144597c0aafd3e0f34e070f4aba..429399165487213acdf1bdb7cd33a71a61acee3a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of Segment Routing for IS-IS as per RFC 8667
  *
@@ -5,20 +6,6 @@
  *
  * Author: Olivier Dugeon <olivier.dugeon@orange.com>
  * Contributor: Renato Westphal <renato@opensourcerouting.org> for NetDEF
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -1057,8 +1044,9 @@ static void show_node(struct vty *vty, struct isis_area *area, int level)
 }
 
 DEFUN(show_sr_node, show_sr_node_cmd,
-      "show isis segment-routing node",
-      SHOW_STR PROTO_HELP
+      "show " PROTO_NAME " segment-routing node",
+      SHOW_STR
+      PROTO_HELP
       "Segment-Routing\n"
       "Segment-Routing node\n")
 {
@@ -1070,7 +1058,10 @@ DEFUN(show_sr_node, show_sr_node_cmd,
                for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
                        vty_out(vty, "Area %s:\n",
                                area->area_tag ? area->area_tag : "null");
-
+                       if (!area->srdb.enabled) {
+                               vty_out(vty, " Segment Routing is disabled\n");
+                               continue;
+                       }
                        for (int level = ISIS_LEVEL1; level <= ISIS_LEVELS;
                             level++)
                                show_node(vty, area, level);
@@ -1090,7 +1081,7 @@ DEFUN(show_sr_node, show_sr_node_cmd,
  *
  * @return             1 on success
  */
-static int sr_start_label_manager(struct thread *start)
+static void sr_start_label_manager(struct thread *start)
 {
        struct isis_area *area;
 
@@ -1098,8 +1089,6 @@ static int sr_start_label_manager(struct thread *start)
 
        /* re-attempt to start SR & Label Manager connection */
        isis_sr_start(area);
-
-       return 1;
 }
 
 /**
@@ -1179,7 +1168,7 @@ void isis_sr_stop(struct isis_area *area)
                 area->area_tag);
 
        /* Disable any re-attempt to connect to Label Manager */
-       thread_cancel(&srdb->t_start_lm);
+       THREAD_OFF(srdb->t_start_lm);
 
        /* Uninstall all local Adjacency-SIDs. */
        for (ALL_LIST_ELEMENTS(area->srdb.adj_sids, node, nnode, sra))
@@ -1252,6 +1241,9 @@ void isis_sr_area_term(struct isis_area *area)
        if (area->srdb.enabled)
                isis_sr_stop(area);
 
+       /* Free Adjacency SID list */
+       list_delete(&srdb->adj_sids);
+
        /* Clear Prefix-SID configuration. */
        while (srdb_prefix_cfg_count(&srdb->config.prefix_sids) > 0) {
                struct sr_prefix_cfg *pcfg;