]> git.puffer.fish Git - mirror/frr.git/commitdiff
[ospfd] Squash another ospf_lookup call
authorPaul Jakma <paul.jakma@sun.com>
Fri, 12 May 2006 22:55:41 +0000 (22:55 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Fri, 12 May 2006 22:55:41 +0000 (22:55 +0000)
2006-05-11 Paul Jakma <paul.jakma@sun.com>

* ospf_lsa.c: (ospf_default_originate_timer) Let the thread
  take (struct ospf *) as thread argument, rather than (struct
  ospf *)->default_originate, thus avoiding having to call
  ospf_lookup.
* ospf_zebra.c: (ospf_redistribute_default_set) change setup
  of ospf_default_originate_timer thread to match.
* ospfd.c: (ospf_router_id_update) ditto.

ospfd/ChangeLog
ospfd/ospf_lsa.c
ospfd/ospf_zebra.c
ospfd/ospfd.c

index 480e54e35ebf0424c970b7fc8e7c1e28c22f76a6..dabef49e20d1585e7b724583a50df8e01ee1d4d7 100644 (file)
        * ospf_abr.c: (ospf_area_range_cost_set) Shouldn't create a new
          range, should just lookup to see if one exists, the new range
          is just leaked. Fixes CID #46.
+       * ospf_lsa.c: (ospf_default_originate_timer) Let the thread
+         take (struct ospf *) as thread argument, rather than (struct
+         ospf *)->default_originate, thus avoiding having to call
+         ospf_lookup.
+       * ospf_zebra.c: (ospf_redistribute_default_set) change setup
+         of ospf_default_originate_timer thread to match.
+       * ospfd.c: (ospf_router_id_update) ditto.
 
 2006-04-24 Paul Jakma <paul.jakma@sun.com>
 
index faae4376d2c66025b7d634564c382f3aeb979ff0..9a8874592bd6dd5ac3ff1a72d6be4257fcd941bf 100644 (file)
@@ -2243,22 +2243,18 @@ ospf_default_external_info (struct ospf *ospf)
 int
 ospf_default_originate_timer (struct thread *thread)
 {
-  int *origin;
   struct prefix_ipv4 p;
   struct in_addr nexthop;
   struct external_info *ei;
   struct ospf *ospf;
   
-  ospf = ospf_lookup ();
-
-  /* Get originate flags. */
-  origin = THREAD_ARG (thread);
+  ospf = THREAD_ARG (thread);
 
   p.family = AF_INET;
   p.prefix.s_addr = 0;
   p.prefixlen = 0;
 
-  if (*origin == DEFAULT_ORIGINATE_ALWAYS)
+  if (ospf->default_originate == DEFAULT_ORIGINATE_ALWAYS)
     {
       /* If there is no default route via redistribute,
         then originate AS-external-LSA with nexthop 0 (self). */
index 494f63cef9caf8b3a0c5d8d349d9fb6acf7c7cb8..11c4d99b0ab329b60c70137c9d60c3370c44f4ca 100644 (file)
@@ -615,8 +615,7 @@ ospf_redistribute_default_set (struct ospf *ospf, int originate,
   if (ospf->router_id.s_addr == 0)
     ospf->external_origin |= (1 << DEFAULT_ROUTE);
   else
-    thread_add_timer (master, ospf_default_originate_timer,
-                      &ospf->default_originate, 1);
+    thread_add_timer (master, ospf_default_originate_timer, ospf, 1);
 
   ospf_asbr_status_update (ospf, ++ospf->redistribute);
 
index 680a5006848ae991348f528e9ae9101a70642af4..79c4543f4757423b1edad462ec51c2464c776281 100644 (file)
@@ -111,8 +111,7 @@ ospf_router_id_update (struct ospf *ospf)
                                ospf, type);
          /* Originate Deafult. */
          if (ospf->external_origin & (1 << ZEBRA_ROUTE_MAX))
-           thread_add_event (master, ospf_default_originate_timer,
-                             &ospf->default_originate, 0);
+           thread_add_event (master, ospf_default_originate_timer, ospf, 0);
 
          ospf->external_origin = 0;
        }