]> git.proxmox.com Git - mirror_frr.git/blobdiff - isisd/isis_mt.c
*: auto-convert to SPDX License IDs
[mirror_frr.git] / isisd / isis_mt.c
index c024549fccfb71389f33fe01a40170d8ba523956..fcc0f53815edd8d07a80ac708ac060c7e1d6875d 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * IS-IS Rout(e)ing protocol - Multi Topology Support
  *
  * Copyright (C) 2017 Christian Franke
  *
  * This file is part of FRRouting (FRR)
- *
- * FRR 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, or (at your option) any
- * later version.
- *
- * FRR 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>
 #include "isisd/isisd.h"
@@ -56,8 +43,8 @@ const char *isis_mtid2str(uint16_t mtid)
        static char buf[sizeof("65535")];
 
        switch (mtid) {
-       case ISIS_MT_IPV4_UNICAST:
-               return "ipv4-unicast";
+       case ISIS_MT_STANDARD:
+               return "standard";
        case ISIS_MT_IPV4_MGMT:
                return "ipv4-mgmt";
        case ISIS_MT_IPV6_UNICAST:
@@ -80,6 +67,8 @@ uint16_t isis_str2mtid(const char *name)
 {
        if (!strcmp(name, "ipv4-unicast"))
                return ISIS_MT_IPV4_UNICAST;
+       if (!strcmp(name, "standard"))
+               return ISIS_MT_STANDARD;
        if (!strcmp(name, "ipv4-mgmt"))
                return ISIS_MT_IPV4_MGMT;
        if (!strcmp(name, "ipv6-unicast"))
@@ -515,6 +504,17 @@ static void tlvs_add_mt_set(struct isis_area *area, struct isis_tlvs *tlvs,
                            uint8_t *id, uint32_t metric,
                            struct isis_ext_subtlvs *ext)
 {
+       /* Check if MT is enable for this area */
+       if (!area_is_mt(area)) {
+               lsp_debug(
+                       "ISIS (%s): Adding %s.%02x as te-style neighbor (MT disable)",
+                       area->area_tag, sysid_print(id), LSP_PSEUDO_ID(id));
+               isis_tlvs_add_extended_reach(tlvs, ISIS_MT_DISABLE, id, metric,
+                                            ext);
+               return;
+       }
+
+       /* Process Multi-Topology */
        for (unsigned int i = 0; i < mt_count; i++) {
                uint16_t mtid = mt_set[i];
                if (mt_set[i] == ISIS_MT_IPV4_UNICAST) {