]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
OSPF: DD seqnum should be initialized only for first attempts
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Sun, 3 Feb 2019 20:27:41 +0000 (21:27 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Sun, 3 Feb 2019 20:30:10 +0000 (21:30 +0100)
After SeqNumberMismatch/BadLSReq, we should continue with the old
seqnum++. The old code tries to do that by n->adj, but it was set
nowhere.

proto/ospf/neighbor.c
proto/ospf/ospf.h

index ff27cd411a6f6f7318e80798822234b18c266991..9239894ecbc687474315468bc8ec3470dde9ddb9 100644 (file)
@@ -85,7 +85,6 @@ ospf_neighbor_new(struct ospf_iface *ifa)
   n->pool = pool;
   n->ifa = ifa;
   add_tail(&ifa->neigh_list, NODE n);
-  n->adj = 0;
   n->csn = 0;
   n->state = NEIGHBOR_DOWN;
 
@@ -179,8 +178,8 @@ ospf_neigh_chstate(struct ospf_neighbor *n, u8 state)
 
   if (state == NEIGHBOR_EXSTART)
   {
-    /* First time adjacency */
-    if (n->adj == 0)
+    /* First time adjacency attempt */
+    if (old_state < NEIGHBOR_EXSTART)
       n->dds = random_u32();
 
     n->dds++;
index 90fbd562dc2a206d80125e725691a7ccee437105..35fd667221d6bd143cc7825fdf2810ee23b99ca9 100644 (file)
@@ -363,7 +363,6 @@ struct ospf_neighbor
   u32 rid;                     /* Router ID */
   ip_addr ip;                  /* IP of it's interface */
   u8 priority;                 /* Priority */
-  u8 adj;                      /* built adjacency? */
   u32 options;                 /* Options received */
 
   /* Entries dr and bdr store IP addresses in OSPFv2 and router IDs in