diff options
Diffstat (limited to 'ospf6d/ospf6_message.c')
| -rw-r--r-- | ospf6d/ospf6_message.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index cd73e3d406..64de9bae41 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -515,12 +515,12 @@ static void ospf6_hello_recv(struct in6_addr *src, struct in6_addr *dst, if (twoway) thread_execute(master, twoway_received, on, 0); else { - if (IS_DEBUG_OSPF6_GR) - zlog_debug( - "%s, Received oneway hello from RESTARTER so ignore here.", - __PRETTY_FUNCTION__); - - if (!OSPF6_GR_IS_ACTIVE_HELPER(on)) { + if (OSPF6_GR_IS_ACTIVE_HELPER(on)) { + if (IS_DEBUG_OSPF6_GR) + zlog_debug( + "%s, Received oneway hello from RESTARTER so ignore here.", + __PRETTY_FUNCTION__); + } else { /* If the router is DR_OTHER, RESTARTER will not wait * until it receives the hello from it if it receives * from DR and BDR. @@ -553,6 +553,21 @@ static void ospf6_hello_recv(struct in6_addr *src, struct in6_addr *dst, return; } + /* + * 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->ospf6->gr_info.restart_in_progress + && oi->state == OSPF6_INTERFACE_WAITING + && hello->drouter == oi->area->ospf6->router_id) + oi->drouter = hello->drouter; + /* Schedule interface events */ if (backupseen) thread_add_event(master, backup_seen, oi, 0, NULL); @@ -1863,11 +1878,13 @@ static void ospf6_make_header(uint8_t type, struct ospf6_interface *oi, oh->version = (uint8_t)OSPFV3_VERSION; oh->type = type; - + oh->length = 0; oh->router_id = oi->area->ospf6->router_id; oh->area_id = oi->area->area_id; + oh->checksum = 0; oh->instance_id = oi->instance_id; oh->reserved = 0; + stream_forward_endp(s, OSPF6_HEADER_SIZE); } |
