From b49e6f5a65d437cb7e7bdefe8397e0f550496012 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Tue, 25 Aug 2009 16:42:14 +0200 Subject: Temporary OSPFv3 development commit --- proto/ospf/neighbor.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'proto/ospf/neighbor.c') diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c index d86895e..374da63 100644 --- a/proto/ospf/neighbor.c +++ b/proto/ospf/neighbor.c @@ -173,16 +173,16 @@ electbdr(list nl) struct ospf_neighbor *neigh, *n1, *n2; u32 nid; -#ifdef OSPFv2 - nid = ipa_to_u32(neigh->ip); -#else /* OSPFv3 */ - nid = neigh->rid; -#endif - n1 = NULL; n2 = NULL; WALK_LIST(neigh, nl) /* First try those decl. themselves */ { +#ifdef OSPFv2 + nid = ipa_to_u32(neigh->ip); +#else /* OSPFv3 */ + nid = neigh->rid; +#endif + if (neigh->state >= NEIGHBOR_2WAY) /* Higher than 2WAY */ if (neigh->priority > 0) /* Eligible */ if (neigh->dr != nid) /* And not decl. itself DR */ @@ -231,15 +231,15 @@ electdr(list nl) struct ospf_neighbor *neigh, *n; u32 nid; + n = NULL; + WALK_LIST(neigh, nl) /* And now DR */ + { #ifdef OSPFv2 - nid = ipa_to_u32(neigh->ip); + nid = ipa_to_u32(neigh->ip); #else /* OSPFv3 */ - nid = neigh->rid; + nid = neigh->rid; #endif - n = NULL; - WALK_LIST(neigh, nl) /* And now DR */ - { if (neigh->state >= NEIGHBOR_2WAY) /* Higher than 2WAY */ if (neigh->priority > 0) /* Eligible */ if (neigh->dr == nid) /* And declaring itself DR */ -- cgit v1.2.3