summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_packet.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2021-10-12 16:58:39 +0200
committerGitHub <noreply@github.com>2021-10-12 16:58:39 +0200
commitc5708d0b9822a7607c65d02f3f1c6dfda3cb7d48 (patch)
treeca28abff546937e8f883f94b050996b2a68fadaf /ospfd/ospf_packet.c
parentMerge pull request #9788 from idryzhov/ospf6-clear-interface-vrf (diff)
parentospfd: preserve DR status across graceful restarts (diff)
downloadfrr-c5708d0b9822a7607c65d02f3f1c6dfda3cb7d48.tar.xz
frr-c5708d0b9822a7607c65d02f3f1c6dfda3cb7d48.zip
Merge pull request #9781 from opensourcerouting/ospfd-gr-dr-fix
ospfd: preserve DR status across graceful restarts
Diffstat (limited to 'ospfd/ospf_packet.c')
-rw-r--r--ospfd/ospf_packet.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 1dcf93dcd..eacc30eba 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -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. */