summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_lsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd/ospf_lsa.c')
-rw-r--r--ospfd/ospf_lsa.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index 70504692..25bd754d 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -527,9 +527,16 @@ lsa_link_ptop_set (struct stream *s, struct ospf_interface *oi)
{
/* For unnumbered point-to-point networks, the Link Data field
should specify the interface's MIB-II ifIndex value. */
- links += link_info_set (s, nbr->router_id, oi->address->u.prefix4,
+ if (CHECK_FLAG(oi->ifp->status, ZEBRA_INTERFACE_UNNUMBERED))
+ id.s_addr = htonl(oi->ifp->ifindex);
+ else
+ id = oi->address->u.prefix4;
+
+ links += link_info_set (s, nbr->router_id, id,
LSA_LINK_TYPE_POINTOPOINT, 0, cost);
}
+ if (CHECK_FLAG(oi->ifp->status, ZEBRA_INTERFACE_UNNUMBERED))
+ return links;
/* Regardless of the state of the neighboring router, we must
add a Type 3 link (stub network).
@@ -651,9 +658,11 @@ lsa_link_ptomp_set (struct stream *s, struct ospf_interface *oi)
static int
router_lsa_link_set (struct stream *s, struct ospf_area *area)
{
+ struct ospf_host_route *host;
+ struct in_addr host_mask = {~0}; /* All ones */
struct listnode *node;
struct ospf_interface *oi;
- int links = 0;
+ int links = 0, old_links;
for (ALL_LIST_ELEMENTS_RO (area->oiflist, node, oi))
{
@@ -664,6 +673,7 @@ router_lsa_link_set (struct stream *s, struct ospf_area *area)
{
if (oi->state != ISM_Down)
{
+ old_links = links;
/* Describe each link. */
switch (oi->type)
{
@@ -685,10 +695,14 @@ router_lsa_link_set (struct stream *s, struct ospf_area *area)
case OSPF_IFTYPE_LOOPBACK:
links += lsa_link_loopback_set (s, oi);
}
+ ospf_lsa_pos_set(old_links, links, oi);
}
}
}
-
+ for (ALL_LIST_ELEMENTS_RO (area->ospf->hostlist, node, host))
+ if (host->area == NULL || host->area == area)
+ links += link_info_set (s, host->host_addr, host_mask,
+ LSA_LINK_TYPE_STUB, 0, host->cost);
return links;
}
@@ -2900,6 +2914,10 @@ ospf_maxage_lsa_remover (struct thread *thread)
continue;
}
+ /* TODO: maybe convert this function to a work-queue */
+ if (thread_should_yield (thread))
+ OSPF_TIMER_ON (ospf->t_maxage, ospf_maxage_lsa_remover, 0);
+
/* Remove LSA from the LSDB */
if (CHECK_FLAG (lsa->flags, OSPF_LSA_SELF))
if (IS_DEBUG_OSPF (lsa, LSA_FLOODING))