]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: unexpected kernel routing table (BZ#544)
authorFritz Reichmann <fritz@reichmann.nl>
Sat, 1 Oct 2011 13:43:12 +0000 (17:43 +0400)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 13 Feb 2012 23:06:29 +0000 (03:06 +0400)
Fix bug 544: isisd produces an unexpected routing table for wide-metric.

* isis_spf.c: Accept VTYPE_PSEUDO_TE_IS and VTYPE_NONPSEUDO_TE_IS
  vertex types for SPF calculation
* isis_pdu.c: Change order of TLVs to match Cisco to make bitwise
  comparison easier for Wireshark
* isis_tlv.c: EXTREME_TLV_DEBUG for TLV debugging instead of
  EXTREME_DEBUG

isisd/isis_pdu.c
isisd/isis_spf.c
isisd/isis_tlv.c

index e55d33658bfcec2c49b1248ca7144d6535bb901f..dfc613cf2e4b30920eb64c608e67227824bafb14 100644 (file)
@@ -1992,29 +1992,18 @@ send_hello (struct isis_circuit *circuit, int level)
     if (tlv_add_authinfo (circuit->passwd.type, circuit->passwd.len,
                          circuit->passwd.passwd, circuit->snd_stream))
       return ISIS_WARNING;
+
+  /* Protocols Supported TLV */
+  if (circuit->nlpids.count > 0)
+    if (tlv_add_nlpid (&circuit->nlpids, circuit->snd_stream))
+      return ISIS_WARNING;
+
   /*  Area Addresses TLV */
   assert (circuit->area);
   if (circuit->area->area_addrs && circuit->area->area_addrs->count > 0)
     if (tlv_add_area_addrs (circuit->area->area_addrs, circuit->snd_stream))
       return ISIS_WARNING;
 
-  /*  LAN Neighbors TLV */
-  if (circuit->circ_type == CIRCUIT_T_BROADCAST)
-    {
-      if (level == 1 && circuit->u.bc.lan_neighs[0]->count > 0)
-       if (tlv_add_lan_neighs (circuit->u.bc.lan_neighs[0],
-                               circuit->snd_stream))
-         return ISIS_WARNING;
-      if (level == 2 && circuit->u.bc.lan_neighs[1]->count > 0)
-       if (tlv_add_lan_neighs (circuit->u.bc.lan_neighs[1],
-                               circuit->snd_stream))
-         return ISIS_WARNING;
-    }
-
-  /* Protocols Supported TLV */
-  if (circuit->nlpids.count > 0)
-    if (tlv_add_nlpid (&circuit->nlpids, circuit->snd_stream))
-      return ISIS_WARNING;
   /* IP interface Address TLV */
   if (circuit->ip_router && circuit->ip_addrs && circuit->ip_addrs->count > 0)
     if (tlv_add_ip_addrs (circuit->ip_addrs, circuit->snd_stream))
@@ -2028,6 +2017,22 @@ send_hello (struct isis_circuit *circuit, int level)
       return ISIS_WARNING;
 #endif /* HAVE_IPV6 */
 
+  /* Restart signaling, vendor C sends it too */
+  retval = add_tlv (211, 3, 0, circuit->snd_stream);
+
+  /*  LAN Neighbors TLV */
+  if (circuit->circ_type == CIRCUIT_T_BROADCAST)
+    {
+      if (level == 1 && circuit->u.bc.lan_neighs[0]->count > 0)
+       if (tlv_add_lan_neighs (circuit->u.bc.lan_neighs[0],
+                               circuit->snd_stream))
+         return ISIS_WARNING;
+      if (level == 2 && circuit->u.bc.lan_neighs[1]->count > 0)
+       if (tlv_add_lan_neighs (circuit->u.bc.lan_neighs[1],
+                               circuit->snd_stream))
+         return ISIS_WARNING;
+    }
+
   if (circuit->u.bc.pad_hellos)
     if (tlv_add_padding (circuit->snd_stream))
       return ISIS_WARNING;
@@ -2284,9 +2289,7 @@ send_l1_csnp (struct thread *thread)
   circuit->t_send_csnp[0] = NULL;
 
   if (circuit->circ_type == CIRCUIT_T_BROADCAST && circuit->u.bc.is_dr[0])
-    {
       send_csnp (circuit, 1);
-    }
   /* set next timer thread */
   THREAD_TIMER_ON (master, circuit->t_send_csnp[0], send_l1_csnp, circuit,
                   isis_jitter (circuit->csnp_interval[0], CSNP_JITTER));
@@ -2306,9 +2309,7 @@ send_l2_csnp (struct thread *thread)
   circuit->t_send_csnp[1] = NULL;
 
   if (circuit->circ_type == CIRCUIT_T_BROADCAST && circuit->u.bc.is_dr[1])
-    {
       send_csnp (circuit, 2);
-    }
   /* set next timer thread */
   THREAD_TIMER_ON (master, circuit->t_send_csnp[1], send_l2_csnp, circuit,
                   isis_jitter (circuit->csnp_interval[1], CSNP_JITTER));
index b6178e3a29df43ce59793cebb153ccbb243d78a0..5d0b161f4755672ea05326011fbd4030588482c4 100644 (file)
@@ -1030,15 +1030,22 @@ isis_run_spf (struct isis_area *area, int level, int family)
 
   while (listcount (spftree->tents) > 0)
     {
+      /* C.2.7 a) 1) */
       node = listhead (spftree->tents);
       vertex = listgetdata (node);
-      /* Remove from tent list */
+
+      /* C.2.7 a) 2) */
       list_delete_node (spftree->tents, node);
+
+      /* C.2.7 a) 3) */
       if (isis_find_vertex (spftree->paths, vertex->N.id, vertex->type))
        continue;
       add_to_paths (spftree, vertex, area, level);
+
       if (vertex->type == VTYPE_PSEUDO_IS ||
-         vertex->type == VTYPE_NONPSEUDO_IS)
+         vertex->type == VTYPE_NONPSEUDO_IS ||
+         vertex->type == VTYPE_PSEUDO_TE_IS ||
+         vertex->type == VTYPE_NONPSEUDO_TE_IS )
        {
          if (listcount(vertex->Adj_N) == 0) {
            continue;
@@ -1054,7 +1061,6 @@ isis_run_spf (struct isis_area *area, int level, int family)
                {
                  isis_spf_process_pseudo_lsp (spftree, lsp, vertex->d_N,
                                               vertex->depth, family, adj);
-
                }
              else
                {
index 94fa65ed32936ebaef4d77f87262c62e858aad07..9fffef5131b936ffd87e7e8c311151131f28b2fc 100644 (file)
@@ -741,7 +741,7 @@ add_tlv (u_char tag, u_char len, u_char * value, struct stream *stream)
   stream_putc (stream, len);   /* LENGTH */
   stream_put (stream, value, (int) len);       /* VALUE */
 
-#ifdef EXTREME_DEBUG
+#ifdef EXTREME_TLV_DEBUG
   zlog_debug ("Added TLV %d len %d", tag, len);
 #endif /* EXTREME DEBUG */
   return ISIS_OK;