]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: initialize circuit to match area is_type
authorChristian Franke <chris@opensourcerouting.org>
Tue, 10 Nov 2015 17:04:48 +0000 (18:04 +0100)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 30 Mar 2016 00:26:17 +0000 (20:26 -0400)
New circuits should be initialized to match the is_type
of their area. Also add an additional check to make sure
that no IIHs are sent for levels which are not enabled.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
isisd/isis_circuit.c
isisd/isis_pdu.c

index d1eaa8a17c2872cab8dc5754ae500f6d6a9eb94f..9f597368d47ccf136f67a003390dc4f7111c5f59 100644 (file)
@@ -122,13 +122,13 @@ isis_circuit_configure (struct isis_circuit *circuit, struct isis_area *area)
   circuit->area = area;
 
   /*
-   * The level for the circuit is same as for the area, unless configured
-   * otherwise.
+   * Whenever the is-type of an area is changed, the is-type of each circuit
+   * in that area is updated to a non-empty subset of the area is-type.
+   * Inversely, when configuring a new circuit, this property should be
+   * ensured as well.
    */
-  if (area->is_type != IS_LEVEL_1_AND_2 && area->is_type != circuit->is_type)
-    zlog_warn ("circut %s is_type %d mismatch with area %s is_type %d",
-               circuit->interface->name, circuit->is_type,
-               circuit->area->area_tag, area->is_type);
+  if (area->is_type != IS_LEVEL_1_AND_2)
+    circuit->is_type = area->is_type;
 
   /*
    * Add the circuit into area
index 3db57bca8df7f07cf5f2f9900cc2bbcf3fd73499..d9e98f268365e688fc233f43b2cc3d5755f45efa 100644 (file)
@@ -2420,6 +2420,13 @@ send_lan_l1_hello (struct thread *thread)
   assert (circuit);
   circuit->u.bc.t_send_lan_hello[0] = NULL;
 
+  if (!(circuit->area->is_type & IS_LEVEL_1))
+    {
+      zlog_warn ("ISIS-Hello (%s): Trying to send L1 IIH in L2-only area",
+                circuit->area->area_tag);
+      return 1;
+    }
+
   if (circuit->u.bc.run_dr_elect[0])
     retval = isis_dr_elect (circuit, 1);
 
@@ -2443,6 +2450,13 @@ send_lan_l2_hello (struct thread *thread)
   assert (circuit);
   circuit->u.bc.t_send_lan_hello[1] = NULL;
 
+  if (!(circuit->area->is_type & IS_LEVEL_2))
+    {
+      zlog_warn ("ISIS-Hello (%s): Trying to send L2 IIH in L1 area",
+                circuit->area->area_tag);
+      return 1;
+    }
+
   if (circuit->u.bc.run_dr_elect[1])
     retval = isis_dr_elect (circuit, 2);