summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_message.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_message.c')
-rw-r--r--ospf6d/ospf6_message.c56
1 files changed, 51 insertions, 5 deletions
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c
index 549f5668b9..a80ec4430f 100644
--- a/ospf6d/ospf6_message.c
+++ b/ospf6d/ospf6_message.c
@@ -46,7 +46,7 @@
#include "ospf6_flood.h"
#include "ospf6d.h"
-
+#include "ospf6_gr.h"
#include <netinet/ip6.h>
DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_MESSAGE, "OSPF6 message");
@@ -84,7 +84,9 @@ const uint16_t ospf6_lsa_minlen[OSPF6_LSTYPE_SIZE] = {
/* 0x2006 */ 0,
/* 0x2007 */ OSPF6_AS_EXTERNAL_LSA_MIN_SIZE,
/* 0x0008 */ OSPF6_LINK_LSA_MIN_SIZE,
- /* 0x2009 */ OSPF6_INTRA_PREFIX_LSA_MIN_SIZE};
+ /* 0x2009 */ OSPF6_INTRA_PREFIX_LSA_MIN_SIZE,
+ /* 0x200a */ 0,
+ /* 0x000b */ OSPF6_GRACE_LSA_MIN_SIZE};
/* print functions */
@@ -512,8 +514,44 @@ static void ospf6_hello_recv(struct in6_addr *src, struct in6_addr *dst,
thread_execute(master, hello_received, on, 0);
if (twoway)
thread_execute(master, twoway_received, on, 0);
- else
- thread_execute(master, oneway_received, on, 0);
+ else {
+ if (IS_DEBUG_OSPF6_GR_HELPER)
+ zlog_debug(
+ "%s, Received oneway hello from RESTARTER so ignore here.",
+ __PRETTY_FUNCTION__);
+
+ if (!OSPF6_GR_IS_ACTIVE_HELPER(on)) {
+ /* If the router is DR_OTHER, RESTARTER will not wait
+ * until it receives the hello from it if it receives
+ * from DR and BDR.
+ * So, helper might receives ONE_WAY hello from
+ * RESTARTER. So not allowing to change the state if it
+ * receives one_way hellow when it acts as HELPER for
+ * that specific neighbor.
+ */
+ thread_execute(master, oneway_received, on, 0);
+ }
+ }
+
+ if (OSPF6_GR_IS_ACTIVE_HELPER(on)) {
+ /* As per the GR Conformance Test Case 7.2. Section 3
+ * "Also, if X was the Designated Router on network segment S
+ * when the helping relationship began, Y maintains X as the
+ * Designated Router until the helping relationship is
+ * terminated."
+ * When it is a helper for this neighbor, It should not trigger
+ * the ISM Events. Also Intentionally not setting the priority
+ * and other fields so that when the neighbor exits the Grace
+ * period, it can handle if there is any change before GR and
+ * after GR.
+ */
+ if (IS_DEBUG_OSPF6_GR_HELPER)
+ zlog_debug(
+ "%s, Neighbor is under GR Restart, hence ignoring the ISM Events",
+ __PRETTY_FUNCTION__);
+
+ return;
+ }
/* Schedule interface events */
if (backupseen)
@@ -1260,7 +1298,15 @@ static unsigned ospf6_lsa_examin(struct ospf6_lsa_header *lsah,
lsalen - OSPF6_LSA_HEADER_SIZE
- OSPF6_INTRA_PREFIX_LSA_MIN_SIZE,
ntohs(intra_prefix_lsa->prefix_num) /* 16 bits */
- );
+ );
+ case OSPF6_LSTYPE_GRACE_LSA:
+ if (lsalen < OSPF6_LSA_HEADER_SIZE + GRACE_PERIOD_TLV_SIZE
+ + GRACE_RESTART_REASON_TLV_SIZE) {
+ if (IS_DEBUG_OSPF6_GR_HELPER)
+ zlog_debug("%s: Undersized GraceLSA.",
+ __func__);
+ return MSG_NG;
+ }
}
/* No additional validation is possible for unknown LSA types, which are
themselves valid in OPSFv3, hence the default decision is to accept.