]> git.puffer.fish Git - mirror/frr.git/commitdiff
Isisd is now able to remove addresses from circuit and trigger LSP updates
authorhasso <hasso>
Tue, 14 Sep 2004 13:54:30 +0000 (13:54 +0000)
committerhasso <hasso>
Tue, 14 Sep 2004 13:54:30 +0000 (13:54 +0000)
if it's done. Some random fixes as well and update to sample configuration.

isisd/ChangeLog
isisd/isis_circuit.c
isisd/isis_events.c
isisd/isis_tlv.c
isisd/isis_zebra.c
isisd/isisd.conf.sample

index 3fa9f98a49532167beadf12bbaea3aa84de8e6c5..3dc341f09763dbbf28569913d5140fbd9618b3b8 100644 (file)
@@ -1,3 +1,18 @@
+2004-09-14 Hasso Tepper <hasso at quagga.net>
+
+       * isis_circuit.c: Mostly cosmetical changes in isis_circuit_add_addr()
+         and add calls to isis_event_int_reach_change(). Implement
+         isis_circuit_del_addr(). Cancel t_run_dr threads is circuit goes
+         down.
+       * isis_events.c: Implement isis_event_int_reach_change(). I'm not sure
+         yet how this stuff should work, but it allows be to start debug
+         threads which act very weird at the moment.
+       * isis_tlv.c: Much less verbose by default.
+       * isis_zebra.c: Added extreme debugging output. Call connected_free()
+         after isis_circuit_del_addr, not before.
+       * isisd.conf.sample: Update it a little bit. 10000 seconds hello time
+         was certainly too much IMHO.
+
 2004-09-14 LIU Xin <lx at ns.6test.edu.cn>
 
        * isis_pdu.c: Update l1_desig_is only if neighbor really is DIS.
index 9a41c582cf31c1043ca0d565e44ed0f8c0cada60..eb83e98696dbaeb6a88759d905c30572bebed6a1 100644 (file)
@@ -216,64 +216,60 @@ isis_circuit_del (struct isis_circuit *circuit)
 }
 
 void
-isis_circuit_add_addr (struct isis_circuit *circuit, struct connected *conn)
+isis_circuit_add_addr (struct isis_circuit *circuit,
+                      struct connected *connected)
 {
   struct prefix_ipv4 *ipv4;
   u_char buf[BUFSIZ];
 #ifdef HAVE_IPV6
   struct prefix_ipv6 *ipv6;
 #endif /* HAVE_IPV6 */
+
   if (!circuit->ip_addrs)
-    {
-      circuit->ip_addrs = list_new ();
-    }
+    circuit->ip_addrs = list_new ();
 #ifdef HAVE_IPV6
   if (!circuit->ipv6_link)
-    {
-      circuit->ipv6_link = list_new ();
-    }
+    circuit->ipv6_link = list_new ();
   if (!circuit->ipv6_non_link)
-    {
-      circuit->ipv6_non_link = list_new ();
-    }
+    circuit->ipv6_non_link = list_new ();
 #endif /* HAVE_IPV6 */
 
   memset (&buf, 0, BUFSIZ);
-  if (conn->address->family == AF_INET)
+  if (connected->address->family == AF_INET)
     {
       ipv4 = prefix_ipv4_new ();
-      ipv4->prefixlen = conn->address->prefixlen;
-      ipv4->prefix = conn->address->u.prefix4;
+      ipv4->prefixlen = connected->address->prefixlen;
+      ipv4->prefix = connected->address->u.prefix4;
       listnode_add (circuit->ip_addrs, ipv4);
-      prefix2str (conn->address, buf, BUFSIZ);
+      isis_event_int_reach_change (circuit);
+
 #ifdef EXTREME_DEBUG
+      prefix2str (connected->address, buf, BUFSIZ);
       zlog_info ("Added IP address %s to circuit %d", buf,
                 circuit->circuit_id);
 #endif /* EXTREME_DEBUG */
     }
 #ifdef HAVE_IPV6
-  if (conn->address->family == AF_INET6)
+  if (connected->address->family == AF_INET6)
     {
       ipv6 = prefix_ipv6_new ();
-      ipv6->prefixlen = conn->address->prefixlen;
-      ipv6->prefix = conn->address->u.prefix6;
+      ipv6->prefixlen = connected->address->prefixlen;
+      ipv6->prefix = connected->address->u.prefix6;
+
       if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
-       {
-         listnode_add (circuit->ipv6_link, ipv6);
-       }
+       listnode_add (circuit->ipv6_link, ipv6);
       else
-       {
-         listnode_add (circuit->ipv6_non_link, ipv6);
-       }
-      prefix2str (conn->address, buf, BUFSIZ);
+       listnode_add (circuit->ipv6_non_link, ipv6);
+
+      isis_event_int_reach_change(circuit);
+
 #ifdef EXTREME_DEBUG
+      prefix2str (connected->address, buf, BUFSIZ);
       zlog_info ("Added IPv6 address %s to circuit %d", buf,
                 circuit->circuit_id);
 #endif /* EXTREME_DEBUG */
     }
 #endif /* HAVE_IPV6 */
-
-
   return;
 }
 
@@ -281,7 +277,87 @@ void
 isis_circuit_del_addr (struct isis_circuit *circuit,
                       struct connected *connected)
 {
+  struct prefix_ipv4 *ipv4, *ip = NULL;
+  struct listnode *node;
+  int found = 0;
+  u_char buf[BUFSIZ];
+#ifdef HAVE_IPV6
+  struct prefix_ipv6 *ipv6, *ip6 = NULL;
+#endif /* HAVE_IPV6 */
+
+  memset (&buf, 0, BUFSIZ);
+  if (connected->address->family == AF_INET)
+    {
+      ipv4 = prefix_ipv4_new ();
+      ipv4->prefixlen = connected->address->prefixlen;
+      ipv4->prefix = connected->address->u.prefix4;
+
+      for (node = listhead (circuit->ip_addrs); node; nextnode (node))
+       {
+         ip = getdata (node);
+         if (prefix_same ((struct prefix *) ip, (struct prefix *) &ipv4))
+           break;
+       }
 
+      if (ip)
+       {
+         listnode_delete (circuit->ip_addrs, ip);
+         isis_event_int_reach_change (circuit);
+       }
+      else
+       {
+         prefix2str (connected->address, buf, BUFSIZ);
+         zlog_warn("Nonexitant ip address %s removal attempt from circuit \
+                    %d", buf, circuit->circuit_id);
+       }
+    }
+#ifdef HAVE_IPV6
+  if (connected->address->family == AF_INET6)
+    {
+      ipv6 = prefix_ipv6_new ();
+      ipv6->prefixlen = connected->address->prefixlen;
+      ipv6->prefix = connected->address->u.prefix6;
+
+      if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
+       {
+         for (node = listhead (circuit->ipv6_link); node; nextnode (node))
+           {
+             ip6 = getdata (node);
+             if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
+               break;
+           }
+         if (ip6)
+           {
+             listnode_delete (circuit->ipv6_link, ip6);
+             found = 1;
+           }
+       }
+      else
+       {
+         for (node = listhead (circuit->ipv6_non_link); node; nextnode (node))
+           {
+             ip6 = getdata (node);
+             if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
+               break;
+           }
+         if (ip6)
+           {
+             listnode_delete (circuit->ipv6_non_link, ip6);
+             found = 1;
+           }
+       }
+
+      if (!found)
+       {
+         prefix2str (connected->address, buf, BUFSIZ);
+         zlog_warn("Nonexitant ip address %s removal attempt from \
+                    circuit %d", buf, circuit->circuit_id);
+       }
+      else
+       isis_event_int_reach_change (circuit);
+    }
+#endif /* HAVE_IPV6 */
+  return;
 }
 
 void
@@ -516,6 +592,8 @@ isis_circuit_down (struct isis_circuit *circuit)
     {
       THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[0]);
       THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[1]);
+      THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[0]);
+      THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[1]);
     }
   else if (circuit->circ_type == CIRCUIT_T_P2P)
     {
index a99869b9241a9a9b84f53cf0077a622d8f40e115..16c69910c0f2bb4b3edb80f2ec91c7dc9fd4cddd 100644 (file)
@@ -303,6 +303,20 @@ isis_event_adjacency_state_change (struct isis_adjacency *adj, int newstate)
   return;
 }
 
+void
+isis_event_int_reach_change (struct isis_circuit *circuit)
+{
+  if (!circuit || !circuit->area)
+    return;
+
+  zlog_info ("ISIS-Evt (%s) Internal reachability change",
+            circuit->area->area_tag);
+
+  lsp_regenerate_schedule (circuit->area);
+
+  return;
+}
+
 /* events supporting code */
 
 int
index a35b68785bc2f2625ee16f92ddc06147cc8409c0..273d19c2235c387ccd8d5a23fe946e271946bf88 100644 (file)
@@ -437,8 +437,10 @@ parse_tlvs (char *areatag, u_char * stream, int size, u_int32_t * expected,
              while (length > value_len)
                {
                  ipv4_addr = (struct in_addr *) pnt;
+#ifdef EXTREME_TLV_DEBUG
                  zlog_info ("ISIS-TLV (%s) : IP ADDR %s, pnt %p", areatag,
                             inet_ntoa (*ipv4_addr), pnt);
+#endif /* EXTREME_TLV_DEBUG */
                  if (!tlvs->ipv4_addrs)
                    tlvs->ipv4_addrs = list_new ();
                  listnode_add (tlvs->ipv4_addrs, ipv4_addr);
index ad5a0507f0350ce653c0a5fd281240c25fa8a166..e2f1dc590e8710e514384c38684379c4b46ec4f3 100644 (file)
@@ -199,6 +199,8 @@ isis_zebra_if_address_del (int command, struct zclient *client,
 {
   struct connected *c;
   struct interface *ifp;
+  struct prefix *p;
+  u_char buf[BUFSIZ];
 
   c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_DELETE,
                                    zclient->ibuf);
@@ -208,9 +210,20 @@ isis_zebra_if_address_del (int command, struct zclient *client,
 
   ifp = c->ifp;
 
-  connected_free (c);
+#ifdef EXTREME_DEBUG
+  p = c->address;
+  prefix2str (p, buf, BUFSIZ);
+
+  if (p->family == AF_INET)
+    zlog_info ("disconnected IP address %s", buf);
+#ifdef HAVE_IPV6
+  if (p->family == AF_INET6)
+    zlog_info ("disconnected IPv6 address %s", buf);
+#endif /* HAVE_IPV6 */
+#endif /* EXTREME_DEBUG */
 
   isis_circuit_del_addr (circuit_scan_by_ifp (ifp), c);
+  connected_free (c);
 
   return 0;
 }
index 9e08778e8ff9b67d5327a84113a1d6515f15bfe7..47b15953fda609d387bd2f6fb4c8d6401aa0324c 100644 (file)
@@ -2,14 +2,11 @@
 !
 ! ISISd sample configuration file
 !
-!
-!
 hostname isisd 
 password foo
 enable password foo
-!log stdout 
-log file /tmp/isisd.log
-! 
+log stdout 
+!log file /tmp/isisd.log
 ! 
 ! 
 router isis DEAD
@@ -21,10 +18,13 @@ router isis DEAD
 !  lsp-lifetime level-2 65535
 !  lsp-lifetime 65535
 
+!  hostname isisd-router
+!  area-password foobar
+!  domain-password foobar
+
 interface eth0
  ip router isis DEAD
- ip address 10.101.43.194
- isis hello-interval 10000 
+! isis hello-interval 5
 ! isis lsp-interval 1000
 
 ! -- optional
@@ -35,5 +35,5 @@ interface eth0
 ! isis retransmit-interval 10
 ! isis retransmit-throttle-interval
 ! isis hello-multiplier 2 level-1
-!
+! isis priority 64
 !