Merge pull request #9781 from opensourcerouting/ospfd-gr-dr-fix

ospfd: preserve DR status across graceful restarts
This commit is contained in:
Russ White 2021-10-12 10:58:39 -04:00 committed by GitHub
commit c5708d0b98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1134,6 +1134,21 @@ static void ospf_hello(struct ip *iph, struct ospf_header *ospfh,
nbr->priority = hello->priority;
nbr->d_router = hello->d_router;
nbr->bd_router = hello->bd_router;
/*
* RFC 3623 - Section 2:
* "If the restarting router determines that it was the Designated
* Router on a given segment prior to the restart, it elects
* itself as the Designated Router again. The restarting router
* knows that it was the Designated Router if, while the
* associated interface is in Waiting state, a Hello packet is
* received from a neighbor listing the router as the Designated
* Router".
*/
if (oi->area->ospf->gr_info.restart_in_progress
&& oi->state == ISM_Waiting
&& IPV4_ADDR_SAME(&hello->d_router, &oi->address->u.prefix4))
DR(oi) = hello->d_router;
}
/* Save DD flags/options/Seqnum received. */