From 9c94583a3ded3b2792bd08d88beb10100a82d7b4 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Sun, 3 Feb 2019 16:20:37 +0100 Subject: [PATCH] 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. --- proto/ospf/neighbor.c | 4 ++-- proto/ospf/ospf.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c index 7ce682b0..54d643c6 100644 --- a/proto/ospf/neighbor.c +++ b/proto/ospf/neighbor.c @@ -176,8 +176,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 22b87ebe..23289ccd 100644 --- a/proto/ospf/ospf.h +++ b/proto/ospf/ospf.h @@ -353,7 +353,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