summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_packet.c
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2021-10-15 15:21:40 +0200
committerGitHub <noreply@github.com>2021-10-15 15:21:40 +0200
commit1afa7d53261fa7b19185d99251b07816ac9b054e (patch)
tree35c1ad045bc3f4cd50d4f8bbcbc840d8f6233e5f /ospfd/ospf_packet.c
parentMerge pull request #9836 from opensourcerouting/doc-developer-fixes (diff)
parentospfd: fix another DR election issue during graceful restart (diff)
downloadfrr-1afa7d53261fa7b19185d99251b07816ac9b054e.tar.xz
frr-1afa7d53261fa7b19185d99251b07816ac9b054e.zip
Merge pull request #9813 from opensourcerouting/ospf-gr-fixes
ospfd: more GR fixes
Diffstat (limited to 'ospfd/ospf_packet.c')
-rw-r--r--ospfd/ospf_packet.c64
1 files changed, 33 insertions, 31 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 4294c255a..ca4bb0a2b 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -1096,39 +1096,41 @@ static void ospf_hello(struct ip *iph, struct ospf_header *ospfh,
zlog_debug(
"%s, Neighbor is under GR Restart, hence ignoring the ISM Events",
__PRETTY_FUNCTION__);
-
- return;
- }
-
- /* If neighbor itself declares DR and no BDR exists,
- cause event BackupSeen */
- if (IPV4_ADDR_SAME(&nbr->address.u.prefix4, &hello->d_router))
- if (hello->bd_router.s_addr == INADDR_ANY
- && oi->state == ISM_Waiting)
+ } else {
+ /* If neighbor itself declares DR and no BDR exists,
+ cause event BackupSeen */
+ if (IPV4_ADDR_SAME(&nbr->address.u.prefix4, &hello->d_router))
+ if (hello->bd_router.s_addr == INADDR_ANY
+ && oi->state == ISM_Waiting)
+ OSPF_ISM_EVENT_SCHEDULE(oi, ISM_BackupSeen);
+
+ /* neighbor itself declares BDR. */
+ if (oi->state == ISM_Waiting
+ && IPV4_ADDR_SAME(&nbr->address.u.prefix4,
+ &hello->bd_router))
OSPF_ISM_EVENT_SCHEDULE(oi, ISM_BackupSeen);
- /* neighbor itself declares BDR. */
- if (oi->state == ISM_Waiting
- && IPV4_ADDR_SAME(&nbr->address.u.prefix4, &hello->bd_router))
- OSPF_ISM_EVENT_SCHEDULE(oi, ISM_BackupSeen);
-
- /* had not previously. */
- if ((IPV4_ADDR_SAME(&nbr->address.u.prefix4, &hello->d_router)
- && IPV4_ADDR_CMP(&nbr->address.u.prefix4, &nbr->d_router))
- || (IPV4_ADDR_CMP(&nbr->address.u.prefix4, &hello->d_router)
- && IPV4_ADDR_SAME(&nbr->address.u.prefix4, &nbr->d_router)))
- OSPF_ISM_EVENT_SCHEDULE(oi, ISM_NeighborChange);
-
- /* had not previously. */
- if ((IPV4_ADDR_SAME(&nbr->address.u.prefix4, &hello->bd_router)
- && IPV4_ADDR_CMP(&nbr->address.u.prefix4, &nbr->bd_router))
- || (IPV4_ADDR_CMP(&nbr->address.u.prefix4, &hello->bd_router)
- && IPV4_ADDR_SAME(&nbr->address.u.prefix4, &nbr->bd_router)))
- OSPF_ISM_EVENT_SCHEDULE(oi, ISM_NeighborChange);
-
- /* Neighbor priority check. */
- if (nbr->priority >= 0 && nbr->priority != hello->priority)
- OSPF_ISM_EVENT_SCHEDULE(oi, ISM_NeighborChange);
+ /* had not previously. */
+ if ((IPV4_ADDR_SAME(&nbr->address.u.prefix4, &hello->d_router)
+ && IPV4_ADDR_CMP(&nbr->address.u.prefix4, &nbr->d_router))
+ || (IPV4_ADDR_CMP(&nbr->address.u.prefix4, &hello->d_router)
+ && IPV4_ADDR_SAME(&nbr->address.u.prefix4,
+ &nbr->d_router)))
+ OSPF_ISM_EVENT_SCHEDULE(oi, ISM_NeighborChange);
+
+ /* had not previously. */
+ if ((IPV4_ADDR_SAME(&nbr->address.u.prefix4, &hello->bd_router)
+ && IPV4_ADDR_CMP(&nbr->address.u.prefix4, &nbr->bd_router))
+ || (IPV4_ADDR_CMP(&nbr->address.u.prefix4,
+ &hello->bd_router)
+ && IPV4_ADDR_SAME(&nbr->address.u.prefix4,
+ &nbr->bd_router)))
+ OSPF_ISM_EVENT_SCHEDULE(oi, ISM_NeighborChange);
+
+ /* Neighbor priority check. */
+ if (nbr->priority >= 0 && nbr->priority != hello->priority)
+ OSPF_ISM_EVENT_SCHEDULE(oi, ISM_NeighborChange);
+ }
/* Set neighbor information. */
nbr->priority = hello->priority;