--- embedaddon/quagga/ospfd/ospf_lsa.c 2013/07/21 23:54:40 1.1.1.3 +++ embedaddon/quagga/ospfd/ospf_lsa.c 2016/11/02 10:09:12 1.1.1.4 @@ -50,7 +50,7 @@ #include "ospfd/ospf_ase.h" #include "ospfd/ospf_zebra.h" - + u_int32_t get_metric (u_char *metric) { @@ -61,7 +61,7 @@ get_metric (u_char *metric) return m; } - + struct timeval tv_adjust (struct timeval a) { @@ -108,6 +108,17 @@ int2tv (int a) } struct timeval +msec2tv (int a) +{ + struct timeval ret; + + ret.tv_sec = 0; + ret.tv_usec = a * 1000; + + return tv_adjust (ret); +} + +struct timeval tv_add (struct timeval a, struct timeval b) { struct timeval ret; @@ -145,9 +156,9 @@ ospf_lsa_refresh_delay (struct ospf_lsa *lsa) quagga_gettime (QUAGGA_CLK_MONOTONIC, &now); delta = tv_sub (now, lsa->tv_orig); - if (tv_cmp (delta, int2tv (OSPF_MIN_LS_INTERVAL)) < 0) + if (tv_cmp (delta, msec2tv (OSPF_MIN_LS_INTERVAL)) < 0) { - delay = tv_ceil (tv_sub (int2tv (OSPF_MIN_LS_INTERVAL), delta)); + delay = tv_ceil (tv_sub (msec2tv (OSPF_MIN_LS_INTERVAL), delta)); if (IS_DEBUG_OSPF (lsa, LSA_GENERATE)) zlog_debug ("LSA[Type%d:%s]: Refresh timer delay %d seconds", @@ -159,7 +170,7 @@ ospf_lsa_refresh_delay (struct ospf_lsa *lsa) return delay; } - + int get_age (struct ospf_lsa *lsa) { @@ -171,7 +182,7 @@ get_age (struct ospf_lsa *lsa) return age; } - + /* Fletcher Checksum -- Refer to RFC1008. */ /* All the offsets are zero-based. The offsets in the RFC1008 are @@ -205,7 +216,7 @@ ospf_lsa_checksum_valid (struct lsa_header *lsa) } - + /* Create OSPF LSA. */ struct ospf_lsa * ospf_lsa_new () @@ -248,7 +259,7 @@ ospf_lsa_dup (struct ospf_lsa *lsa) new->refresh_list = -1; if (IS_DEBUG_OSPF (lsa, LSA)) - zlog_debug ("LSA: duplicated %p (new: %p)", lsa, new); + zlog_debug ("LSA: duplicated %p (new: %p)", (void *)lsa, (void *)new); return new; } @@ -260,7 +271,7 @@ ospf_lsa_free (struct ospf_lsa *lsa) assert (lsa->lock == 0); if (IS_DEBUG_OSPF (lsa, LSA)) - zlog_debug ("LSA: freed %p", lsa); + zlog_debug ("LSA: freed %p", (void *)lsa); /* Delete LSA data. */ if (lsa->data != NULL) @@ -336,12 +347,12 @@ ospf_lsa_data_free (struct lsa_header *lsah) { if (IS_DEBUG_OSPF (lsa, LSA)) zlog_debug ("LSA[Type%d:%s]: data freed %p", - lsah->type, inet_ntoa (lsah->id), lsah); + lsah->type, inet_ntoa (lsah->id), (void *)lsah); XFREE (MTYPE_OSPF_LSA_DATA, lsah); } - + /* LSA general functions. */ const char * @@ -393,8 +404,8 @@ lsa_header_set (struct stream *s, u_char options, stream_forward_endp (s, OSPF_LSA_HEADER_SIZE); } - + /* router-LSA related functions. */ /* Get router-LSA flags. */ static u_char @@ -568,6 +579,9 @@ lsa_link_broadcast_set (struct stream *s, struct ospf_ /* Describe Type 3 Link. */ if (oi->state == ISM_Waiting) { + if (IS_DEBUG_OSPF (lsa, LSA_GENERATE)) + zlog_debug ("LSA[Type1]: Interface %s is in state Waiting. " + "Adding stub interface", oi->ifp->name); masklen2ip (oi->address->prefixlen, &mask); id.s_addr = oi->address->u.prefix4.s_addr & mask.s_addr; return link_info_set (s, id, mask, LSA_LINK_TYPE_STUB, 0, @@ -580,12 +594,18 @@ lsa_link_broadcast_set (struct stream *s, struct ospf_ IPV4_ADDR_SAME (&oi->address->u.prefix4, &DR (oi))) && ospf_nbr_count (oi, NSM_Full) > 0) { + if (IS_DEBUG_OSPF (lsa, LSA_GENERATE)) + zlog_debug ("LSA[Type1]: Interface %s has a DR. " + "Adding transit interface", oi->ifp->name); return link_info_set (s, DR (oi), oi->address->u.prefix4, LSA_LINK_TYPE_TRANSIT, 0, cost); } /* Describe type 3 link. */ else { + if (IS_DEBUG_OSPF (lsa, LSA_GENERATE)) + zlog_debug ("LSA[Type1]: Interface %s has no DR. " + "Adding stub interface", oi->ifp->name); masklen2ip (oi->address->prefixlen, &mask); id.s_addr = oi->address->u.prefix4.s_addr & mask.s_addr; return link_info_set (s, id, mask, LSA_LINK_TYPE_STUB, 0, @@ -737,7 +757,7 @@ ospf_router_lsa_body_set (struct stream *s, struct osp /* Set # of links here. */ stream_putw_at (s, putp, cnt); } - + static int ospf_stub_router_timer (struct thread *t) { @@ -794,7 +814,7 @@ ospf_stub_router_check (struct ospf_area *area) OSPF_AREA_TIMER_ON (area->t_stub_router, ospf_stub_router_timer, area->ospf->stub_router_startup_time); } - + /* Create new router-LSA. */ static struct ospf_lsa * ospf_router_lsa_new (struct ospf_area *area) @@ -879,7 +899,7 @@ ospf_router_lsa_originate (struct ospf_area *area) if (IS_DEBUG_OSPF (lsa, LSA_GENERATE)) { zlog_debug ("LSA[Type%d:%s]: Originate router-LSA %p", - new->data->type, inet_ntoa (new->data->id), new); + new->data->type, inet_ntoa (new->data->id), (void *)new); ospf_lsa_header_dump (new->data); } @@ -996,7 +1016,7 @@ ospf_router_lsa_update (struct ospf *ospf) return 0; } - + /* network-LSA related functions. */ /* Originate Network-LSA. */ static void @@ -1114,7 +1134,7 @@ ospf_network_lsa_update (struct ospf_interface *oi) if (IS_DEBUG_OSPF (lsa, LSA_GENERATE)) { zlog_debug ("LSA[Type%d:%s]: Originate network-LSA %p", - new->data->type, inet_ntoa (new->data->id), new); + new->data->type, inet_ntoa (new->data->id), (void *)new); ospf_lsa_header_dump (new->data); } @@ -1175,7 +1195,7 @@ ospf_network_lsa_refresh (struct ospf_lsa *lsa) return new; } - + static void stream_put_ospf_metric (struct stream *s, u_int32_t metric_value) { @@ -1291,7 +1311,7 @@ ospf_summary_lsa_originate (struct prefix_ipv4 *p, u_i if (IS_DEBUG_OSPF (lsa, LSA_GENERATE)) { zlog_debug ("LSA[Type%d:%s]: Originate summary-LSA %p", - new->data->type, inet_ntoa (new->data->id), new); + new->data->type, inet_ntoa (new->data->id), (void *)new); ospf_lsa_header_dump (new->data); } @@ -1334,7 +1354,7 @@ ospf_summary_lsa_refresh (struct ospf *ospf, struct os return new; } - + /* summary-ASBR-LSA related functions. */ static void ospf_summary_asbr_lsa_body_set (struct stream *s, struct prefix *p, @@ -1434,7 +1454,7 @@ ospf_summary_asbr_lsa_originate (struct prefix_ipv4 *p if (IS_DEBUG_OSPF (lsa, LSA_GENERATE)) { zlog_debug ("LSA[Type%d:%s]: Originate summary-ASBR-LSA %p", - new->data->type, inet_ntoa (new->data->id), new); + new->data->type, inet_ntoa (new->data->id), (void *)new); ospf_lsa_header_dump (new->data); } @@ -1624,7 +1644,8 @@ ospf_external_lsa_body_set (struct stream *s, struct e stream_put_ospf_metric (s, mvalue); /* Get forwarding address to nexthop if on the Connection List, else 0. */ - fwd_addr = ospf_external_lsa_nexthop_get (ospf, ei->nexthop); + fwd_addr = (ei->route_map_set.nexthop.s_addr != -1) ? + ROUTEMAP_NEXTHOP (ei) : ospf_external_lsa_nexthop_get (ospf, ei->nexthop); /* Put forwarding address. */ stream_put_ipv4 (s, fwd_addr.s_addr); @@ -2066,7 +2087,7 @@ ospf_external_lsa_originate (struct ospf *ospf, struct if (IS_DEBUG_OSPF (lsa, LSA_GENERATE)) { zlog_debug ("LSA[Type%d:%s]: Originate AS-external-LSA %p", - new->data->type, inet_ntoa (new->data->id), new); + new->data->type, inet_ntoa (new->data->id), (void *)new); ospf_lsa_header_dump (new->data); } @@ -2186,7 +2207,7 @@ ospf_nssa_lsa_flush (struct ospf *ospf, struct prefix_ void ospf_external_lsa_flush (struct ospf *ospf, u_char type, struct prefix_ipv4 *p, - unsigned int ifindex /*, struct in_addr nexthop */) + ifindex_t ifindex /*, struct in_addr nexthop */) { struct ospf_lsa *lsa; @@ -2251,7 +2272,8 @@ ospf_external_lsa_refresh_default (struct ospf *ospf) if (lsa) { if (IS_DEBUG_OSPF_EVENT) - zlog_debug ("LSA[Type5:0.0.0.0]: Refresh AS-external-LSA %p", lsa); + zlog_debug ("LSA[Type5:0.0.0.0]: Refresh AS-external-LSA %p", + (void *)lsa); ospf_external_lsa_refresh (ospf, lsa, ei, LSA_REFRESH_FORCE); } else @@ -2368,7 +2390,7 @@ ospf_external_lsa_refresh (struct ospf *ospf, struct o return new; } - + /* LSA installation functions. */ /* Install router-LSA to an area. */ @@ -2400,8 +2422,7 @@ ospf_router_lsa_install (struct ospf *ospf, struct osp ospf_refresher_register_lsa (ospf, new); } if (rt_recalc) - ospf_spf_calculate_schedule (ospf); - + ospf_spf_calculate_schedule (ospf, SPF_FLAG_ROUTER_LSA_INSTALL); return new; } @@ -2435,7 +2456,7 @@ ospf_network_lsa_install (struct ospf *ospf, ospf_refresher_register_lsa (ospf, new); } if (rt_recalc) - ospf_spf_calculate_schedule (ospf); + ospf_spf_calculate_schedule (ospf, SPF_FLAG_NETWORK_LSA_INSTALL); return new; } @@ -2458,11 +2479,9 @@ ospf_summary_lsa_install (struct ospf *ospf, struct os /* This doesn't exist yet... */ ospf_summary_incremental_update(new); */ #else /* #if 0 */ - ospf_spf_calculate_schedule (ospf); + ospf_spf_calculate_schedule (ospf, SPF_FLAG_SUMMARY_LSA_INSTALL); #endif /* #if 0 */ - if (IS_DEBUG_OSPF (lsa, LSA_INSTALL)) - zlog_debug ("ospf_summary_lsa_install(): SPF scheduled"); } if (IS_LSA_SELF (new)) @@ -2491,7 +2510,7 @@ ospf_summary_asbr_lsa_install (struct ospf *ospf, stru - RFC 2328 Section 16.5 implies it should be */ /* ospf_ase_calculate_schedule(); */ #else /* #if 0 */ - ospf_spf_calculate_schedule (ospf); + ospf_spf_calculate_schedule (ospf, SPF_FLAG_ASBR_SUMMARY_LSA_INSTALL); #endif /* #if 0 */ } @@ -2576,11 +2595,9 @@ ospf_discard_from_db (struct ospf *ospf, ospf_ase_unregister_external_lsa (old, ospf); ospf_ls_retransmit_delete_nbr_as (ospf, old); break; -#ifdef HAVE_OPAQUE_LSA case OSPF_OPAQUE_AS_LSA: ospf_ls_retransmit_delete_nbr_as (ospf, old); break; -#endif /* HAVE_OPAQUE_LSA */ case OSPF_AS_NSSA_LSA: ospf_ls_retransmit_delete_nbr_area (old->area, old); ospf_ase_unregister_external_lsa (old, ospf); @@ -2614,9 +2631,7 @@ ospf_lsa_install (struct ospf *ospf, struct ospf_inter lsdb = ospf->lsdb; break; case OSPF_AS_EXTERNAL_LSA: -#ifdef HAVE_OPAQUE_LSA case OSPF_OPAQUE_AS_LSA: -#endif /* HAVE_OPAQUE_LSA */ lsdb = ospf->lsdb; break; default: @@ -2681,7 +2696,7 @@ ospf_lsa_install (struct ospf *ospf, struct ospf_inter { zlog_debug ("ospf_lsa_install() Premature Aging " "lsa 0x%p, seqnum 0x%x", - lsa, ntohl(lsa->data->ls_seqnum)); + (void *)lsa, ntohl(lsa->data->ls_seqnum)); ospf_lsa_header_dump (lsa->data); } } @@ -2728,7 +2743,6 @@ ospf_lsa_install (struct ospf *ospf, struct ospf_inter case OSPF_AS_EXTERNAL_LSA: new = ospf_external_lsa_install (ospf, lsa, rt_recalc); break; -#ifdef HAVE_OPAQUE_LSA case OSPF_OPAQUE_LINK_LSA: if (IS_LSA_SELF (lsa)) lsa->oi = oi; /* Specify outgoing ospf-interface for this LSA. */ @@ -2741,7 +2755,6 @@ ospf_lsa_install (struct ospf *ospf, struct ospf_inter case OSPF_OPAQUE_AS_LSA: new = ospf_opaque_lsa_install (lsa, rt_recalc); break; -#endif /* HAVE_OPAQUE_LSA */ case OSPF_AS_NSSA_LSA: new = ospf_external_lsa_install (ospf, lsa, rt_recalc); default: /* type-6,8,9....nothing special */ @@ -2759,9 +2772,7 @@ ospf_lsa_install (struct ospf *ospf, struct ospf_inter switch (lsa->data->type) { case OSPF_AS_EXTERNAL_LSA: -#ifdef HAVE_OPAQUE_LSA case OSPF_OPAQUE_AS_LSA: -#endif /* HAVE_OPAQUE_LSA */ case OSPF_AS_NSSA_LSA: zlog_debug ("LSA[%s]: Install %s", dump_lsa_key (new), @@ -2784,17 +2795,17 @@ ospf_lsa_install (struct ospf *ospf, struct ospf_inter { if (IS_DEBUG_OSPF (lsa, LSA_INSTALL)) zlog_debug ("LSA[Type%d:%s]: Install LSA 0x%p, MaxAge", - new->data->type, - inet_ntoa (new->data->id), - lsa); + new->data->type, + inet_ntoa (new->data->id), + (void *)lsa); ospf_lsa_maxage (ospf, lsa); } return new; } - -static int + +int ospf_check_nbr_status (struct ospf *ospf) { struct listnode *node, *nnode; @@ -2818,8 +2829,8 @@ ospf_check_nbr_status (struct ospf *ospf) return 1; } - + static int ospf_maxage_lsa_remover (struct thread *thread) { @@ -2843,6 +2854,9 @@ ospf_maxage_lsa_remover (struct thread *thread) continue; } + /* There is at least one neighbor from which we still await an ack + * for that LSA, so we are not allowed to remove it from our lsdb yet + * as per RFC 2328 section 14 para 4 a) */ if (lsa->retransmit_counter > 0) { reschedule = 1; @@ -2851,7 +2865,11 @@ ospf_maxage_lsa_remover (struct thread *thread) /* 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); + { + OSPF_TIMER_ON (ospf->t_maxage, ospf_maxage_lsa_remover, 0); + route_unlock_node(rn); /* route_top/route_next */ + return 0; + } /* Remove LSA from the LSDB */ if (IS_LSA_SELF (lsa)) @@ -2866,7 +2884,7 @@ ospf_maxage_lsa_remover (struct thread *thread) if (CHECK_FLAG (lsa->flags, OSPF_LSA_PREMATURE_AGE)) { if (IS_DEBUG_OSPF (lsa, LSA_FLOODING)) - zlog_debug ("originating new lsa for lsa 0x%p\n", lsa); + zlog_debug ("originating new lsa for lsa 0x%p\n", (void *)lsa); ospf_lsa_refresh (ospf, lsa); } @@ -2896,9 +2914,11 @@ void ospf_lsa_maxage_delete (struct ospf *ospf, struct ospf_lsa *lsa) { struct route_node *rn; - struct prefix_ls lsa_prefix; + struct prefix_ptr lsa_prefix; - ls_prefix_set (&lsa_prefix, lsa); + lsa_prefix.family = 0; + lsa_prefix.prefixlen = sizeof(lsa_prefix.prefix) * CHAR_BIT; + lsa_prefix.prefix = (uintptr_t) lsa; if ((rn = route_node_lookup(ospf->maxage_lsa, (struct prefix *)&lsa_prefix))) @@ -2908,9 +2928,9 @@ ospf_lsa_maxage_delete (struct ospf *ospf, struct ospf UNSET_FLAG(lsa->flags, OSPF_LSA_IN_MAXAGE); ospf_lsa_unlock (&lsa); /* maxage_lsa */ rn->info = NULL; - route_unlock_node (rn); /* route_node_lookup */ + route_unlock_node (rn); /* unlock node because lsa is deleted */ } - route_unlock_node (rn); /* route_node_lookup */ + route_unlock_node (rn); /* route_node_lookup */ } } @@ -2922,7 +2942,7 @@ ospf_lsa_maxage_delete (struct ospf *ospf, struct ospf void ospf_lsa_maxage (struct ospf *ospf, struct ospf_lsa *lsa) { - struct prefix_ls lsa_prefix; + struct prefix_ptr lsa_prefix; struct route_node *rn; /* When we saw a MaxAge LSA flooded to us, we put it on the list @@ -2931,16 +2951,23 @@ ospf_lsa_maxage (struct ospf *ospf, struct ospf_lsa *l { if (IS_DEBUG_OSPF (lsa, LSA_FLOODING)) zlog_debug ("LSA[Type%d:%s]: %p already exists on MaxAge LSA list", - lsa->data->type, inet_ntoa (lsa->data->id), lsa); + lsa->data->type, inet_ntoa (lsa->data->id), (void *)lsa); return; } - ls_prefix_set (&lsa_prefix, lsa); + lsa_prefix.family = 0; + lsa_prefix.prefixlen = sizeof(lsa_prefix.prefix) * CHAR_BIT; + lsa_prefix.prefix = (uintptr_t) lsa; + if ((rn = route_node_get (ospf->maxage_lsa, (struct prefix *)&lsa_prefix)) != NULL) { if (rn->info != NULL) { + if (IS_DEBUG_OSPF (lsa, LSA_FLOODING)) + zlog_debug ("LSA[%s]: found LSA (%p) in table for LSA %p %d", + dump_lsa_key (lsa), rn->info, (void *)lsa, + lsa_prefix.prefixlen); route_unlock_node (rn); } else @@ -2979,7 +3006,6 @@ ospf_lsa_maxage_walker_remover (struct ospf *ospf, str switch (lsa->data->type) { -#ifdef HAVE_OPAQUE_LSA case OSPF_OPAQUE_LINK_LSA: case OSPF_OPAQUE_AREA_LSA: case OSPF_OPAQUE_AS_LSA: @@ -2992,13 +3018,12 @@ ospf_lsa_maxage_walker_remover (struct ospf *ospf, str * topology, and thus, routing recalculation is not needed here. */ break; -#endif /* HAVE_OPAQUE_LSA */ case OSPF_AS_EXTERNAL_LSA: case OSPF_AS_NSSA_LSA: ospf_ase_incremental_update (ospf, lsa); break; default: - ospf_spf_calculate_schedule (ospf); + ospf_spf_calculate_schedule (ospf, SPF_FLAG_MAXAGE); break; } ospf_lsa_maxage (ospf, lsa); @@ -3033,12 +3058,10 @@ ospf_lsa_maxage_walker (struct thread *thread) ospf_lsa_maxage_walker_remover (ospf, lsa); LSDB_LOOP (ASBR_SUMMARY_LSDB (area), rn, lsa) ospf_lsa_maxage_walker_remover (ospf, lsa); -#ifdef HAVE_OPAQUE_LSA LSDB_LOOP (OPAQUE_AREA_LSDB (area), rn, lsa) ospf_lsa_maxage_walker_remover (ospf, lsa); LSDB_LOOP (OPAQUE_LINK_LSDB (area), rn, lsa) ospf_lsa_maxage_walker_remover (ospf, lsa); -#endif /* HAVE_OPAQUE_LSA */ LSDB_LOOP (NSSA_LSDB (area), rn, lsa) ospf_lsa_maxage_walker_remover (ospf, lsa); } @@ -3048,10 +3071,8 @@ ospf_lsa_maxage_walker (struct thread *thread) { LSDB_LOOP (EXTERNAL_LSDB (ospf), rn, lsa) ospf_lsa_maxage_walker_remover (ospf, lsa); -#ifdef HAVE_OPAQUE_LSA LSDB_LOOP (OPAQUE_AS_LSDB (ospf), rn, lsa) ospf_lsa_maxage_walker_remover (ospf, lsa); -#endif /* HAVE_OPAQUE_LSA */ } OSPF_TIMER_ON (ospf->t_maxage_walker, ospf_lsa_maxage_walker, @@ -3104,15 +3125,11 @@ ospf_lsa_lookup (struct ospf_area *area, u_int32_t typ case OSPF_SUMMARY_LSA: case OSPF_ASBR_SUMMARY_LSA: case OSPF_AS_NSSA_LSA: -#ifdef HAVE_OPAQUE_LSA case OSPF_OPAQUE_LINK_LSA: case OSPF_OPAQUE_AREA_LSA: -#endif /* HAVE_OPAQUE_LSA */ return ospf_lsdb_lookup_by_id (area->lsdb, type, id, adv_router); case OSPF_AS_EXTERNAL_LSA: -#ifdef HAVE_OPAQUE_LSA case OSPF_OPAQUE_AS_LSA: -#endif /* HAVE_OPAQUE_LSA */ return ospf_lsdb_lookup_by_id (ospf->lsdb, type, id, adv_router); default: break; @@ -3148,13 +3165,11 @@ ospf_lsa_lookup_by_id (struct ospf_area *area, u_int32 return ospf_lsdb_lookup_by_id (area->lsdb, type, id, id); case OSPF_AS_EXTERNAL_LSA: case OSPF_AS_NSSA_LSA: -#ifdef HAVE_OPAQUE_LSA case OSPF_OPAQUE_LINK_LSA: case OSPF_OPAQUE_AREA_LSA: case OSPF_OPAQUE_AS_LSA: /* Currently not used. */ break; -#endif /* HAVE_OPAQUE_LSA */ default: break; } @@ -3167,14 +3182,12 @@ ospf_lsa_lookup_by_header (struct ospf_area *area, str { struct ospf_lsa *match; -#ifdef HAVE_OPAQUE_LSA /* * Strictly speaking, the LSA-ID field for Opaque-LSAs (type-9/10/11) * is redefined to have two subfields; opaque-type and opaque-id. * However, it is harmless to treat the two sub fields together, as if * they two were forming a unique LSA-ID. */ -#endif /* HAVE_OPAQUE_LSA */ match = ospf_lsa_lookup (area, lsah->type, lsah->id, lsah->adv_router); @@ -3325,14 +3338,12 @@ ospf_lsa_flush_schedule (struct ospf *ospf, struct osp switch (lsa->data->type) { -#ifdef HAVE_OPAQUE_LSA /* Opaque wants to be notified of flushes */ case OSPF_OPAQUE_LINK_LSA: case OSPF_OPAQUE_AREA_LSA: case OSPF_OPAQUE_AS_LSA: ospf_opaque_lsa_refresh (lsa); break; -#endif /* HAVE_OPAQUE_LSA */ default: ospf_refresher_unregister_lsa (ospf, lsa); ospf_lsa_flush (ospf, lsa); @@ -3392,22 +3403,18 @@ ospf_flush_self_originated_lsas_now (struct ospf *ospf ospf_lsa_flush_schedule (ospf, lsa); LSDB_LOOP (ASBR_SUMMARY_LSDB (area), rn, lsa) ospf_lsa_flush_schedule (ospf, lsa); -#ifdef HAVE_OPAQUE_LSA LSDB_LOOP (OPAQUE_LINK_LSDB (area), rn, lsa) ospf_lsa_flush_schedule (ospf, lsa); LSDB_LOOP (OPAQUE_AREA_LSDB (area), rn, lsa) ospf_lsa_flush_schedule (ospf, lsa); -#endif /* HAVE_OPAQUE_LSA */ } if (need_to_flush_ase) { LSDB_LOOP (EXTERNAL_LSDB (ospf), rn, lsa) ospf_lsa_flush_schedule (ospf, lsa); -#ifdef HAVE_OPAQUE_LSA LSDB_LOOP (OPAQUE_AS_LSDB (ospf), rn, lsa) ospf_lsa_flush_schedule (ospf, lsa); -#endif /* HAVE_OPAQUE_LSA */ } /* @@ -3515,7 +3522,7 @@ ospf_lsa_unique_id (struct ospf *ospf, return id; } - + #define LSA_ACTION_FLOOD_AREA 1 #define LSA_ACTION_FLUSH_AREA 2 @@ -3578,7 +3585,7 @@ ospf_schedule_lsa_flush_area (struct ospf_area *area, thread_add_event (master, ospf_lsa_action, data, 0); } - + /* LSA Refreshment functions. */ struct ospf_lsa * ospf_lsa_refresh (struct ospf *ospf, struct ospf_lsa *lsa) @@ -3616,13 +3623,11 @@ ospf_lsa_refresh (struct ospf *ospf, struct ospf_lsa * else ospf_lsa_flush_as (ospf, lsa); break; -#ifdef HAVE_OPAQUE_LSA case OSPF_OPAQUE_LINK_LSA: case OSPF_OPAQUE_AREA_LSA: case OSPF_OPAQUE_AS_LSA: new = ospf_opaque_lsa_refresh (lsa); break; -#endif /* HAVE_OPAQUE_LSA */ default: break; } @@ -3670,7 +3675,7 @@ ospf_refresher_register_lsa (struct ospf *ospf, struct if (IS_DEBUG_OSPF (lsa, LSA_REFRESH)) zlog_debug ("LSA[Refresh:%s]: ospf_refresher_register_lsa(): " "setting refresh_list on lsa %p (slod %d)", - inet_ntoa (lsa->data->id), lsa, index); + inet_ntoa (lsa->data->id), (void *)lsa, index); } } @@ -3741,9 +3746,9 @@ ospf_lsa_refresh_walker (struct thread *t) { if (IS_DEBUG_OSPF (lsa, LSA_REFRESH)) zlog_debug ("LSA[Refresh:%s]: ospf_lsa_refresh_walker(): " - "refresh lsa %p (slot %d)", - inet_ntoa (lsa->data->id), lsa, i); - + "refresh lsa %p (slot %d)", + inet_ntoa (lsa->data->id), (void *)lsa, i); + assert (lsa->lock > 0); list_delete_node (refresh_list, node); lsa->refresh_list = -1;