On Fri, Feb 09, 2018 at 03:39:43AM +0100, Claudio Jeker wrote:
> On netsplits it can happen that on join multiple ospfd end up as DR.
> In my case with 3 routers the one cut off stays DR even though the rest of
> the network already has a DR and BDR.
> 
> Looking into this it seems that in some cases we don't issue an
> IF_EVT_NBR_CHNG and so the re-evaluation of DR/BDR does not happen.
> Looking at hello.c and the rfc seems to suggest that the following case is
> currently not handled:
> 
>             o   Bidirectional communication has been established to a
>                 neighbor.  In other words, the state of the neighbor has
>                 transitioned to 2-Way or higher.
> 
> The other cases in the RFC seem to be covered.
> The following diff fixes this and seems to solve the problem I'm seeing.
> 
> Since this is one of those bits that always caused trouble I would like
> more tests and maybe someone is brave enough to OK the diff.

Here the ospf6d diff for the same issue

-- 
:wq Claudio

Index: hello.c
===================================================================
RCS file: /cvs/src/usr.sbin/ospf6d/hello.c,v
retrieving revision 1.17
diff -u -p -r1.17 hello.c
--- hello.c     18 Nov 2014 20:54:28 -0000      1.17
+++ hello.c     9 Feb 2018 03:21:01 -0000
@@ -173,7 +173,6 @@ recv_hello(struct iface *iface, struct i
                nbr->dr.s_addr = hello.d_rtr;
                nbr->bdr.s_addr = hello.bd_rtr;
                nbr->priority = LSA_24_GETHI(ntohl(hello.opts));
-               nbr_change = 1;
        }
 
        /* actually the neighbor address shouldn't be stored on virtual links */
@@ -186,8 +185,10 @@ recv_hello(struct iface *iface, struct i
                memcpy(&nbr_id, buf, sizeof(nbr_id));
                if (nbr_id == ospfe_router_id()) {
                        /* seen myself */
-                       if (nbr->state & NBR_STA_PRELIM)
+                       if (nbr->state & NBR_STA_PRELIM) {
                                nbr_fsm(nbr, NBR_EVT_2_WAY_RCVD);
+                               nbr_change = 1;
+                       }
                        break;
                }
                buf += sizeof(nbr_id);

Reply via email to