]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Some fixes to isisd done by me and Cougar in the spring of 2003. See
authorhasso <hasso>
Tue, 23 Dec 2003 11:51:08 +0000 (11:51 +0000)
committerhasso <hasso>
Tue, 23 Dec 2003 11:51:08 +0000 (11:51 +0000)
changelog for details.

isisd/ChangeLog
isisd/isis_adjacency.c
isisd/isis_circuit.c
isisd/isis_constants.h
isisd/isis_lsp.c
isisd/isis_misc.c
isisd/isis_spf.c
isisd/isis_tlv.c
isisd/isis_zebra.c
isisd/isisd.c

index 78580ea1c2421c147eb0bccf4ad74ce7a013a415..5f4eabe2a187b8064850e08999032c492cd2efc6 100644 (file)
@@ -1,3 +1,19 @@
+2003-12-23 Hasso Tepper <hasso@estpak.ee>
+  Some fixes done by me and Cougar <cougar@random.ee>.
+  * isis_adjacency.c: Two bugfixes by Cougar:
+    After down state neigbour was deleted but not removed from neighbours list.
+    Don't show random expire time during neighbour initialisation.
+  * isis_circuit.c: Don't show interface addresses in config by Cougar.
+  * isis_constants.h, isis_misc.c: Show other well-known NLPID names as well
+    by Cougar.
+  * isisd.c: Two tiny CLI fixes by me.
+  * isis_lsp.c: Bugfix in lsp_print_detail() by Cougar.
+    Show IPv4 external and IPv6 TLV's in "show isis database detail" by me.
+  * isis_misc.c: Net address format fix by Cougar.
+  * isis_spf.c: Dead loop fix in isis_spf_preload_tent() by Cougar
+  * isis_zebra.c: Ignore distance when adding route to zebra for now by me.
+  * isis_tlv.c: Parse external IPv4 TLV's correctly by me.
+
 Version 0.0.7 to 0.0.8
 ======================
 
index 8079bd17b5f71abf13967008fc43629c2f1bd839..de7476927c9e902c1d6251374dd52b134a9eb285 100644 (file)
@@ -146,7 +146,7 @@ isis_delete_adj (struct isis_adjacency *adj, struct list *adjdb)
       if (adj2 == adj)
         break;
     }
-    listnode_delete (adjdb, node);
+    listnode_delete (adjdb, adj);
   }
   
   if (adj->ipv4_addrs)
@@ -336,7 +336,10 @@ isis_adj_print_vty2 (struct isis_adjacency *adj, struct vty *vty, char detail)
     vty_out (vty, "%-3u", adj->level); /* level */
     vty_out (vty, "%-13s", adj_state2string (adj->adj_state));
     now = time (NULL);
-    vty_out (vty, "%-9lu", adj->last_upd + adj->hold_time - now);
+    if (adj->last_upd)
+      vty_out (vty, "%-9lu", adj->last_upd + adj->hold_time - now);
+    else
+      vty_out (vty, "-        ");
     vty_out (vty, "%-10s", snpa_print (adj->snpa)); 
     vty_out (vty, "%s", VTY_NEWLINE);
   }
@@ -352,8 +355,12 @@ isis_adj_print_vty2 (struct isis_adjacency *adj, struct vty *vty, char detail)
     vty_out (vty, ", Level: %u", adj->level); /* level */
     vty_out (vty, ", State: %s", adj_state2string (adj->adj_state));
     now = time (NULL);
-    vty_out (vty, ", Expires in %s", 
-             time2string (adj->last_upd + adj->hold_time - now));
+    if (adj->last_upd)
+      vty_out (vty, ", Expires in %s", 
+               time2string (adj->last_upd + adj->hold_time - now));
+    else
+      vty_out (vty, ", Expires in %s", 
+               time2string (adj->hold_time));
     vty_out (vty, "%s    Adjacency flaps: %u",
             VTY_NEWLINE,
             adj->flaps);
index f37c314e15f0dc09e0b75a3823b86d225162678b..53a341f747a9beee97599523177368a3ef90d99a 100644 (file)
@@ -553,35 +553,6 @@ isis_interface_config_write (struct vty *vty)
           write++;
         }
 #endif /* HAVE_IPV6 */
-        /* ipv4 addresses - FIXME: those should be related to interface*/
-        if (c->ip_addrs) {LIST_LOOP (c->ip_addrs,ip, node3)
-        {
-           vty_out (vty, " ip%s address %s/%d%s",
-           ip->family == AF_INET ? "" : "v6",
-           inet_ntop (ip->family, &ip->prefix, buf, BUFSIZ), ip->prefixlen, 
-                   VTY_NEWLINE);
-           write++;
-        }}
-
-        /* ipv6 addresses - FIXME: those should be related to interface*/
-#ifdef HAVE_IPV6
-        if (c->ipv6_link) {LIST_LOOP (c->ipv6_link, ipv6, node3)
-          {
-            vty_out (vty, " ip%s address %s/%d%s",
-                     ipv6->family == AF_INET ? "" : "v6",
-                     inet_ntop (ipv6->family, &ipv6->prefix, buf, BUFSIZ),
-                     ipv6->prefixlen,VTY_NEWLINE);
-            write++;
-          }}
-        if (c->ipv6_non_link) {LIST_LOOP (c->ipv6_non_link, ipv6, node3)
-          {
-            vty_out (vty, " ip%s address %s/%d%s",
-                     ipv6->family == AF_INET ? "" : "v6",
-                     inet_ntop (ipv6->family, &ipv6->prefix, buf, BUFSIZ),
-                     ipv6->prefixlen, VTY_NEWLINE);
-            write++;
-          }}        
-#endif /* HAVE_IPV6 */
 
         /* ISIS - circuit type */
         if (c->circuit_is_type  == IS_LEVEL_1) {
@@ -690,6 +661,7 @@ isis_interface_config_write (struct vty *vty)
 
       }
     }
+    vty_out (vty, "!%s",VTY_NEWLINE);
   }
   
   return write;
index c5b59aa30be18dc43d4d690a1b958732b5e21b3c..852b8a1ff5461c4a27b6384cd03f4e52f93025bf 100644 (file)
@@ -82,6 +82,9 @@
  */
 #define NLPID_IP   204
 #define NLPID_IPV6 142
+#define NLPID_SNAP 128
+#define NLPID_CLNP 129
+#define NLPID_ESIS 130
 
 /*
  * Return values for functions
index f797b9e649e8b4d80bbdee36dc0c9dfd1f725415..3f6a57b939ac5491315a044b2fcbfc2ec77c444b 100644 (file)
@@ -764,7 +764,7 @@ lsp_print_detail (dnode_t *node, struct vty *vty, char dynhost)
 
   if (lsp->tlv_data.ipv4_addrs) {
     LIST_LOOP(lsp->tlv_data.ipv4_addrs, ipv4_addr, lnode) {
-      memcpy (ipv4_address, inet_ntoa (*ipv4_addr), sizeof (ipv4_addr));
+      memcpy (ipv4_address, inet_ntoa (*ipv4_addr), sizeof (ipv4_address));
       vty_out (vty, "  IP:        %s%s",
                ipv4_address,
                VTY_NEWLINE);
@@ -776,7 +776,19 @@ lsp_print_detail (dnode_t *node, struct vty *vty, char dynhost)
     LIST_LOOP(lsp->tlv_data.ipv4_int_reachs, ipv4_reach, lnode) {
       memcpy (ipv4_reach_prefix, inet_ntoa (ipv4_reach->prefix), sizeof (ipv4_reach_prefix));
       memcpy (ipv4_reach_mask, inet_ntoa (ipv4_reach->mask), sizeof (ipv4_reach_mask));
-      vty_out (vty, "  Matric: %d IP %s %s%s",
+      vty_out (vty, "  Metric: %d IP %s %s%s",
+             ipv4_reach->metrics.metric_default,
+             ipv4_reach_prefix,
+             ipv4_reach_mask,
+             VTY_NEWLINE);
+  }
+
+  /* for the external reachable tlv */
+  if (lsp->tlv_data.ipv4_ext_reachs)
+    LIST_LOOP(lsp->tlv_data.ipv4_ext_reachs, ipv4_reach, lnode) {
+      memcpy (ipv4_reach_prefix, inet_ntoa (ipv4_reach->prefix), sizeof (ipv4_reach_prefix));
+      memcpy (ipv4_reach_mask, inet_ntoa (ipv4_reach->mask), sizeof (ipv4_reach_mask));
+      vty_out (vty, "  Metric: %d IP-External %s %s%s",
              ipv4_reach->metrics.metric_default,
              ipv4_reach_prefix,
              ipv4_reach_mask,
@@ -794,6 +806,29 @@ lsp_print_detail (dnode_t *node, struct vty *vty, char dynhost)
     }
   }
 
+  /* IPv6 tlv */
+#ifdef HAVE_IPV6
+  if (lsp->tlv_data.ipv6_reachs)
+    LIST_LOOP(lsp->tlv_data.ipv6_reachs, ipv6_reach, lnode) {
+      memset(&in6, 0, sizeof(in6));
+      memcpy (in6.s6_addr, ipv6_reach->prefix, PSIZE(ipv6_reach->prefix_len));
+      inet_ntop (AF_INET6, &in6, buff, BUFSIZ);
+      if ((ipv6_reach->control_info &&
+            CTRL_INFO_DISTRIBUTION) == DISTRIBUTION_INTERNAL)
+        vty_out (vty, "  Metric: %d IPv6-Intern %s/%d%s",
+               ntohl (ipv6_reach->metric),
+               buff,
+               ipv6_reach->prefix_len,
+               VTY_NEWLINE);
+      else
+        vty_out (vty, "  Metric: %d IPv6-Extern %s/%d%s",
+               ntohl (ipv6_reach->metric),
+               buff,
+               ipv6_reach->prefix_len,
+               VTY_NEWLINE);
+    }
+#endif
+
 /* FIXME: Other tlvs such as te or external tlv will be added later */
 #if 0  
   vty_out (vty, "%s  %s %c%s",
index cf558e83f53795e42c940d8fa415e453441ba2c7..1f19606c67852508c6fbeb060597a92b8a1a5b62 100644 (file)
@@ -63,7 +63,7 @@ char * isonet_print (u_char *from, int len) {
       sprintf ( pos, "%02x", *(from + i));
       pos += 2;
     } else {
-      if (i == 0) { /* if the area addr is just one byte, eg. 47. */
+      if (i == (len - 1)) { /* No dot at the end of address */
         sprintf ( pos, "%02x", *(from + i));
         pos += 2;
       } else {
@@ -187,6 +187,15 @@ nlpid2string (struct nlpids *nlpids) {
     case NLPID_IPV6:
       pos += sprintf (pos, "IPv6");
       break;
+    case NLPID_SNAP:
+      pos += sprintf (pos, "SNAP");
+      break;
+    case NLPID_CLNP:
+      pos += sprintf (pos, "CLNP");
+      break;
+    case NLPID_ESIS:
+      pos += sprintf (pos, "ES-IS");
+      break;
     default:
       pos += sprintf (pos, "unknown");
       break;
index d6949817ac5fb17fbfa3edc5ffa28d42945b527f..37c435e03bb050da3ef2ede1f192ad2d389b91fc 100644 (file)
@@ -743,8 +743,10 @@ isis_spf_preload_tent (struct isis_spftree *spftree,
       anode = listhead (adj_list);
       while (anode) {
         adj = getdata (anode);
-        if (!speaks (&adj->nlpids, family))
+        if (!speaks (&adj->nlpids, family)) {
+          anode = nextnode (anode); 
           continue;
+        }
         switch (adj->sys_type) {
         case ISIS_SYSTYPE_ES:
           isis_spf_add_local (spftree, VTYPE_ES, adj->sysid, adj, 
index b51cee91cf84bc0979f1e7f827beb2d5cab48e47..eb673d9fb5d9489645a97eb3d445fb0054b3f958 100644 (file)
@@ -511,16 +511,17 @@ parse_tlvs (char *areatag, u_char *stream, int size, u_int32_t *expected,
        * +---------------------------------------------------------------+
        * :                                                               :
        */
-      *found |= TLVFLAG_TE_IPV4_REACHABILITY;
+      *found |= TLVFLAG_IPV4_EXT_REACHABILITY;
 #ifdef EXTREME_TLV_DEBUG
       zlog_info ("ISIS-TLV (%s): IPv4 external Reachability length %d",
                 areatag,
                 length);
 #endif /* EXTREME_TLV_DEBUG */
-      if (*expected & TLVFLAG_TE_IPV4_REACHABILITY) {
+      if (*expected & TLVFLAG_IPV4_EXT_REACHABILITY) {
         while (length > value_len) {
           ipv4_reach = (struct ipv4_reachability*)pnt;
-          if (!tlvs->ipv4_ext_reachs) tlvs->ipv4_ext_reachs = list_new();
+          if (!tlvs->ipv4_ext_reachs) 
+            tlvs->ipv4_ext_reachs = list_new();
           listnode_add (tlvs->ipv4_ext_reachs, ipv4_reach);
           value_len += 12;
           pnt += 12;
index d9179f914424faf42d7e795ba73e7bec05a393b8..3b83e7a1b8482d24ab37ed75494869b1cacbb0c9 100644 (file)
@@ -232,7 +232,9 @@ isis_zebra_route_add_ipv4 (struct prefix *prefix,
     
     SET_FLAG (message, ZAPI_MESSAGE_NEXTHOP);
     SET_FLAG (message, ZAPI_MESSAGE_METRIC);
+#if 0
     SET_FLAG (message, ZAPI_MESSAGE_DISTANCE);
+#endif
     
     stream = zclient->obuf;
     stream_reset (stream);
@@ -265,8 +267,10 @@ isis_zebra_route_add_ipv4 (struct prefix *prefix,
         stream_putl (stream, nexthop->ifindex);
       }
     }
+#if 0
     if (CHECK_FLAG (message, ZAPI_MESSAGE_DISTANCE))
       stream_putc (stream, route_info->depth);
+#endif
     if (CHECK_FLAG (message, ZAPI_MESSAGE_METRIC))
       stream_putl (stream, route_info->cost);
     
index 3b8a0a6228acbcb02cfb40f4884ab4dd4f7e030a..135acf0ef42917450f5db4c683a69f2fb2d779ab 100644 (file)
@@ -1419,7 +1419,7 @@ DEFUN (no_dynamic_hostname,
 DEFUN (spf_interval,
        spf_interval_cmd,
        "spf-interval <1-120>",
-       "Minimum interval between SPF calculations"
+       "Minimum interval between SPF calculations\n"
        "Minimum interval between consecutive SPFs in seconds\n")
 {
   struct isis_area *area;
@@ -1936,7 +1936,7 @@ isis_config_write (struct vty *vty)
 struct cmd_node isis_node =
 {
   ISIS_NODE,
-  "%s(config_router)# ",
+  "%s(config-router)# ",
   1
 };