summaryrefslogtreecommitdiffstats
path: root/proto/ospf/neighbor.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto/ospf/neighbor.c')
-rw-r--r--proto/ospf/neighbor.c22
1 files changed, 11 insertions, 11 deletions
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 */