ospfd: Some small tweaks to the SPF execution reason patch
* ospf_spf.h: use an enum for the reason, and have it as a new argument to
ospf_spf_calculate_schedule, no need for additional call, and let compiler
do the checking.
* ospf_spf.c: format changes - Quagga coding style places function names
at the start of a new line, for easy grepping for definition.
(ospf_spf_calculate_timer) Change the log format of SPF execution time to
avoid ginormous line, and make logging conditional, as is the norm.
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index 31cbaae..94c31c9 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -2409,10 +2409,7 @@
ospf_refresher_register_lsa (ospf, new);
}
if (rt_recalc)
- {
- ospf_flag_spf_reason (SPF_FLAG_ROUTER_LSA_INSTALL);
- ospf_spf_calculate_schedule (ospf);
- }
+ ospf_spf_calculate_schedule (ospf, SPF_FLAG_ROUTER_LSA_INSTALL);
return new;
}
@@ -2446,10 +2443,7 @@
ospf_refresher_register_lsa (ospf, new);
}
if (rt_recalc)
- {
- ospf_flag_spf_reason (SPF_FLAG_NETWORK_LSA_INSTALL);
- ospf_spf_calculate_schedule (ospf);
- }
+ ospf_spf_calculate_schedule (ospf, SPF_FLAG_NETWORK_LSA_INSTALL);
return new;
}
@@ -2472,8 +2466,7 @@
/* This doesn't exist yet... */
ospf_summary_incremental_update(new); */
#else /* #if 0 */
- ospf_flag_spf_reason (SPF_FLAG_SUMMARY_LSA_INSTALL);
- ospf_spf_calculate_schedule (ospf);
+ ospf_spf_calculate_schedule (ospf, SPF_FLAG_SUMMARY_LSA_INSTALL);
#endif /* #if 0 */
}
@@ -2504,8 +2497,7 @@
- RFC 2328 Section 16.5 implies it should be */
/* ospf_ase_calculate_schedule(); */
#else /* #if 0 */
- ospf_flag_spf_reason (SPF_FLAG_ASBR_SUMMARY_LSA_INSTALL);
- ospf_spf_calculate_schedule (ospf);
+ ospf_spf_calculate_schedule (ospf, SPF_FLAG_ASBR_SUMMARY_LSA_INSTALL);
#endif /* #if 0 */
}
@@ -3027,8 +3019,7 @@
ospf_ase_incremental_update (ospf, lsa);
break;
default:
- ospf_flag_spf_reason (SPF_FLAG_MAXAGE);
- ospf_spf_calculate_schedule (ospf);
+ ospf_spf_calculate_schedule (ospf, SPF_FLAG_MAXAGE);
break;
}
ospf_lsa_maxage (ospf, lsa);