From: Ondrej Zajicek (work) Date: Sun, 3 Feb 2019 20:27:41 +0000 (+0100) Subject: OSPF: DD seqnum should be initialized only for first attempts X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf402c61e6fe780033cc107b957d8af37528fe91;p=thirdparty%2Fbird.git OSPF: DD seqnum should be initialized only for first attempts 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. --- diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c index ff27cd411..9239894ec 100644 --- a/proto/ospf/neighbor.c +++ b/proto/ospf/neighbor.c @@ -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++; diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h index 90fbd562d..35fd66722 100644 --- a/proto/ospf/ospf.h +++ b/proto/ospf/ospf.h @@ -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