]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospf_spf_process_stubs: use LSA pos to find OSFP interface
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Sat, 7 Jul 2012 15:06:12 +0000 (17:06 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Wed, 25 Jul 2012 16:07:37 +0000 (18:07 +0200)
This is better than a prefix lookup as prefixes may not be
unique, that is, the same prefix can exist on several interfaces.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
ospfd/ospf_route.c
ospfd/ospf_route.h
ospfd/ospf_spf.c

index d2e5e1e7d00e19fa16fe01c4afb493f9d8adf17d..a5d6d18c9385361d957643421bb8151f44532865 100644 (file)
@@ -429,7 +429,7 @@ ospf_intra_add_transit (struct route_table *rt, struct vertex *v,
 void
 ospf_intra_add_stub (struct route_table *rt, struct router_lsa_link *link,
                     struct vertex *v, struct ospf_area *area,
-                    int parent_is_root)
+                    int parent_is_root, int lsa_pos)
 {
   u_int32_t cost;
   struct route_node *rn;
@@ -577,7 +577,7 @@ ospf_intra_add_stub (struct route_table *rt, struct router_lsa_link *link,
       if (IS_DEBUG_OSPF_EVENT)
        zlog_debug ("ospf_intra_add_stub(): this network is on this router");
 
-      if ((oi = ospf_if_lookup_by_prefix (area->ospf, &p)))
+      if ((oi = ospf_if_lookup_by_lsa_pos (area, lsa_pos)))
        {
          if (IS_DEBUG_OSPF_EVENT)
            zlog_debug ("ospf_intra_add_stub(): the interface is %s",
index 17ab68e5d63d8941d6fded86c2b88b4a60e757fc..5742b462c33710eb3dd3544361b08bb3f1231a82 100644 (file)
@@ -141,7 +141,7 @@ extern void ospf_intra_add_transit (struct route_table *, struct vertex *,
 extern void ospf_intra_add_stub (struct route_table *,
                                 struct router_lsa_link *, struct vertex *,
                                 struct ospf_area *,
-                                int parent_is_root);
+                                int parent_is_root, int);
 
 extern int ospf_route_cmp (struct ospf *, struct ospf_route *,
                           struct ospf_route *);
index 26fe4851b38454cfe5fafefb657e7d1a7d7462a8..6682951195907c8631cc985e94832c2037522d6f 100644 (file)
@@ -973,6 +973,7 @@ ospf_spf_process_stubs (struct ospf_area *area, struct vertex *v,
       u_char *lim;
       struct router_lsa_link *l;
       struct router_lsa *rlsa;
+      int lsa_pos = 0;
 
       if (IS_DEBUG_OSPF_EVENT)
         zlog_debug ("ospf_process_stubs():processing router LSA, id: %s",
@@ -994,7 +995,8 @@ ospf_spf_process_stubs (struct ospf_area *area, struct vertex *v,
                 (l->m[0].tos_count * OSPF_ROUTER_LSA_TOS_SIZE));
 
           if (l->m[0].type == LSA_LINK_TYPE_STUB)
-            ospf_intra_add_stub (rt, l, v, area, parent_is_root);
+           ospf_intra_add_stub (rt, l, v, area, parent_is_root, lsa_pos);
+         lsa_pos++;
         }
     }