/* If none is found -- look through all. */
if (listcount(chosen) == 0) {
- list_delete_and_null(&chosen);
+ list_delete(&chosen);
chosen = rn->info;
}
}
if (chosen != rn->info)
- list_delete_and_null(&chosen);
+ list_delete(&chosen);
return best;
}
zlog_debug ("ospf_ase_calculate(): Originating router is not an ASBR");
return NULL;
}
-
+
if (al->e[0].fwd_addr.s_addr != 0)
{
if (IS_DEBUG_OSPF (lsa, LSA))
asbr.prefixlen = IPV4_MAX_BITLEN;
rn = route_node_match (rt_network, (struct prefix *) &asbr);
-
+
if (rn == NULL)
{
if (IS_DEBUG_OSPF (lsa, LSA))
static struct ospf_route *
ospf_ase_calculate_new_route(struct ospf_lsa *lsa,
- struct ospf_route *asbr_route, u_int32_t metric)
+ struct ospf_route *asbr_route, uint32_t metric)
{
struct as_external_lsa *al;
struct ospf_route *new;
int ospf_ase_calculate_route(struct ospf *ospf, struct ospf_lsa *lsa)
{
- u_int32_t metric;
+ uint32_t metric;
struct as_external_lsa *al;
struct ospf_route *asbr_route;
struct prefix_ipv4 asbr, p;
struct route_node *rn;
struct ospf_route *new, * or ;
+ char buf1[INET_ADDRSTRLEN];
int ret;
assert(lsa);
return 0;
}
- if (IS_DEBUG_OSPF(lsa, LSA))
+ if (IS_DEBUG_OSPF(lsa, LSA)) {
+ snprintf(buf1, INET_ADDRSTRLEN, "%s",
+ inet_ntoa(al->header.adv_router));
zlog_debug(
- "Route[External]: Calculate AS-external-LSA to %s/%d",
- inet_ntoa(al->header.id), ip_masklen(al->mask));
+ "Route[External]: Calculate AS-external-LSA to %s/%d adv_router %s",
+ inet_ntoa(al->header.id), ip_masklen(al->mask), buf1);
+ }
+
/* (1) If the cost specified by the LSA is LSInfinity, or if the
LSA's LS age is equal to MaxAge, then examine the next LSA. */
if ((metric = GET_METRIC(al->e[0].metric)) >= OSPF_LS_INFINITY) {
if (!rn || (or = rn->info) == NULL) {
if (IS_DEBUG_OSPF(lsa, LSA))
- zlog_debug("Route[External]: Adding a new route %s/%d",
- inet_ntoa(p.prefix), p.prefixlen);
+ zlog_debug("Route[External]: Adding a new route %s/%d with paths %u",
+ inet_ntoa(p.prefix), p.prefixlen,
+ listcount(asbr_route->paths));
ospf_route_add(ospf->new_external_route, &p, new, asbr_route);
struct ospf_route *newor)
{
struct route_node *rn;
- struct ospf_route * or ;
+ struct ospf_route *or;
struct ospf_path *op;
struct ospf_path *newop;
struct listnode *n1;
route_unlock_node(rn);
or = rn->info;
+
+ assert(or);
+
if (or->path_type != newor->path_type)
return 0;
return 0;
}
+ assert(or->paths);
+
if (or->paths->count != newor->paths->count)
return 0;
/* Check each path. */
for (n1 = listhead(or->paths), n2 = listhead(newor->paths); n1 && n2;
- n1 = listnextnode(n1), n2 = listnextnode(n2)) {
+ n1 = listnextnode_unchecked(n1), n2 = listnextnode_unchecked(n2)) {
op = listgetdata(n1);
newop = listgetdata(n2);
if ((lst = rn->info) != NULL) {
for (ALL_LIST_ELEMENTS(lst, node, nnode, lsa))
ospf_lsa_unlock(&lsa); /* external_lsas lst */
- list_delete_and_null(&lst);
+ list_delete(&lst);
}
route_table_finish(rt);