From 1a2ad348f660b150265f6df759a07de8a2b6de2f Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Sun, 30 Jun 2019 20:12:59 +0200 Subject: OSPF: Support for graceful restart Implement OSPFv2 (RFC 3623) and OSPFv3 (RFC 5187) graceful restart, for both restarting and helper sides. Graceful restart is initiated by 'graceful down' command. --- proto/ospf/dbdes.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'proto/ospf/dbdes.c') diff --git a/proto/ospf/dbdes.c b/proto/ospf/dbdes.c index a1559782..b39595d9 100644 --- a/proto/ospf/dbdes.c +++ b/proto/ospf/dbdes.c @@ -215,7 +215,7 @@ ospf_send_dbdes(struct ospf_proto *p, struct ospf_neighbor *n) ASSERT((n->state == NEIGHBOR_EXSTART) || (n->state == NEIGHBOR_EXCHANGE)); - if (n->ifa->oa->rt == NULL) + if (!n->ifa->oa->rt && !p->gr_recovery) return; ospf_prepare_dbdes(p, n); @@ -279,6 +279,10 @@ ospf_process_dbdes(struct ospf_proto *p, struct ospf_packet *pkt, struct ospf_ne if (LSA_SCOPE(lsa_type) == LSA_SCOPE_RES) DROP1("LSA with invalid scope"); + /* RFC 3623 2.2 (2) special case - check for my router-LSA (GR recovery) */ + if ((lsa_type == LSA_T_RT) && (lsa.rt == p->router_id)) + n->got_my_rt_lsa = 1; + en = ospf_hash_find(p->gr, lsa_domain, lsa.id, lsa.rt, lsa_type); if (!en || (lsa_comp(&lsa, &(en->lsa)) == CMP_NEWER)) { -- cgit v1.2.3