diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-07-09 03:31:54 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-07-09 03:39:19 +0200 |
commit | 85840d4c03552a69927b666774fa39921e7b1047 (patch) | |
tree | 83602f31fd98940bd74713017e9b26deb8ac6e58 /proto/ospf/topology.h | |
parent | 05e3933c06b488e71c9c149c25aec9c733a8bd1f (diff) |
OSPF: Fix handling of external routes on graceful restart
We need to flush learned external LSAs a bit later than other LSAs (after
first feed after end of the graceful restart) to avoid flap of external
routes.
Diffstat (limited to 'proto/ospf/topology.h')
-rw-r--r-- | proto/ospf/topology.h | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/proto/ospf/topology.h b/proto/ospf/topology.h index ffae436a..535d1f1b 100644 --- a/proto/ospf/topology.h +++ b/proto/ospf/topology.h @@ -33,7 +33,7 @@ struct top_hash_entry u32 lb_id; /* Interface ID of link back iface (for bcast or NBMA networks) */ u32 dist; /* Distance from the root */ int ret_count; /* Number of retransmission lists referencing the entry */ - u8 dirty; /* Will be flushed during next LSAdb update unless reoriginated*/ + u8 gr_dirty; /* Local LSA received during GR, will be removed unless reoriginated */ u8 color; #define OUTSPF 0 #define CANDIDATE 1 @@ -115,10 +115,11 @@ struct top_hash_entry */ -#define LSA_M_BASIC 0 -#define LSA_M_EXPORT 1 -#define LSA_M_RTCALC 2 -#define LSA_M_STALE 3 +#define LSA_M_BASIC 0 +#define LSA_M_EXPORT 1 +#define LSA_M_RTCALC 2 +#define LSA_M_EXPORT_STALE 3 +#define LSA_M_RTCALC_STALE 4 /* * LSA entry modes: @@ -128,9 +129,13 @@ struct top_hash_entry * routing table calculation is scheduled. This is also the mode used for LSAs * received from neighbors. Example: Router-LSAs, Network-LSAs. * - * LSA_M_EXPORT - like LSA_M_BASIC, but the routing table calculation does not - * depend on the LSA. Therefore, the calculation is not scheduled when the LSA - * is changed. Example: AS-external-LSAs for exported routes. + * LSA_M_EXPORT - The LSA is originated using ospf_originate_lsa() as a + * consequence of route export to the OSPF instance. It has to be reoriginated + * during each channel feed, otherwise it is flushed automatically at the end of + * the feed. May be originated and flushed asynchronously. Also, routing table + * calculation does not depend on the LSA. Therefore, the routing table + * calculation is not scheduled when the LSA is changed. Example: + * AS-external-LSAs for exported routes. * * LSA_M_RTCALC - The LSA has to be requested using ospf_originate_lsa() during * each routing table calculation, otherwise it is flushed automatically at the @@ -138,8 +143,11 @@ struct top_hash_entry * source for it. Therefore, the calculation is not scheduled when the LSA is * changed. Example: Summary-LSAs. * - * LSA_M_STALE - Temporary state for LSA_M_RTCALC that is not requested during - * the current routing table calculation. + * LSA_M_EXPORT_STALE - Temporary state for LSA_M_EXPORT that is not requested + * during current external route feed. + * + * LSA_M_RTCALC_STALE - Temporary state for LSA_M_RTCALC that is not requested + * during current routing table calculation. * * * Note that we do not schedule the routing table calculation when the age of @@ -181,7 +189,8 @@ struct top_hash_entry * ospf_originate_lsa(struct ospf_proto *p, struct ospf_new void ospf_advance_lsa(struct ospf_proto *p, struct top_hash_entry *en, struct ospf_lsa_header *lsa, u32 type, u32 domain, void *body); void ospf_flush_lsa(struct ospf_proto *p, struct top_hash_entry *en); void ospf_update_lsadb(struct ospf_proto *p); -void ospf_mark_lsadb(struct ospf_proto *p); +void ospf_feed_begin(struct channel *C, int initial); +void ospf_feed_end(struct channel *C); static inline void ospf_flush2_lsa(struct ospf_proto *p, struct top_hash_entry **en) { if (*en) { ospf_flush_lsa(p, *en); *en = NULL; } } |