From 552237cf20f79c9c48082d9accd3d861dc468095 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 19 May 2015 18:03:40 -0700 Subject: [PATCH] This is a fix to make sure router-LSA is updated when neighbor's interface ID change is received in hello packet. --- ospf6d/ospf6_message.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index ecc96f7143..09137cfed1 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -245,6 +245,7 @@ ospf6_hello_recv (struct in6_addr *src, struct in6_addr *dst, char *p; int twoway = 0; int neighborchange = 0; + int neighbor_ifindex_change = 0; int backupseen = 0; hello = (struct ospf6_hello *) @@ -285,10 +286,16 @@ ospf6_hello_recv (struct in6_addr *src, struct in6_addr *dst, on->priority = hello->priority; } - /* always override neighbor's source address and ifindex */ - on->ifindex = ntohl (hello->interface_id); + /* Always override neighbor's source address */ memcpy (&on->linklocal_addr, src, sizeof (struct in6_addr)); + /* Neighbor ifindex check */ + if (on->ifindex != ntohl (hello->interface_id)) + { + on->ifindex = ntohl (hello->interface_id); + neighbor_ifindex_change++; + } + /* TwoWay check */ for (p = (char *) ((caddr_t) hello + sizeof (struct ospf6_hello)); p + sizeof (u_int32_t) <= OSPF6_MESSAGE_END (oh); @@ -348,6 +355,9 @@ ospf6_hello_recv (struct in6_addr *src, struct in6_addr *dst, thread_add_event (master, backup_seen, oi, 0); if (neighborchange) thread_add_event (master, neighbor_change, oi, 0); + + if (neighbor_ifindex_change && on->state == OSPF6_NEIGHBOR_FULL) + OSPF6_ROUTER_LSA_SCHEDULE (oi->area); } static void -- 2.39.5