diff options
author | Ondrej Filip <feela@network.cz> | 2004-07-14 01:42:14 +0200 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2004-07-14 01:42:14 +0200 |
commit | a417ad13a117d2458702cbec4aa418ba99981611 (patch) | |
tree | 0e5a13df928a1f74bc35e17828911849e1fd8112 | |
parent | 897999c22a85499e4e8a476e27469201645012fb (diff) | |
download | bird-a417ad13a117d2458702cbec4aa418ba99981611.tar bird-a417ad13a117d2458702cbec4aa418ba99981611.zip |
Send hello just after interface is up.
This makes the adjacency forming faster.
Minor code clean up.
-rw-r--r-- | proto/ospf/hello.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/proto/ospf/hello.c b/proto/ospf/hello.c index 73721d1..7820cf7 100644 --- a/proto/ospf/hello.c +++ b/proto/ospf/hello.c @@ -59,7 +59,7 @@ ospf_hello_receive(struct ospf_hello_packet *ps, WALK_LIST(nn, ifa->nbma_list) { - if (ipa_compare(faddr, nn->ip) == 0) + if (ipa_equal(faddr, nn->ip)) { found = 1; break; @@ -132,24 +132,22 @@ ospf_hello_receive(struct ospf_hello_packet *ps, ospf_iface_sm(ifa, ISM_NEICH); /* Router is declaring itself ad DR and there is no BDR */ - if ((ipa_compare(n->ip, n->dr) == 0) && (ipa_to_u32(n->bdr) == 0) + if (ipa_equal(n->ip, n->dr) && (ipa_to_u32(n->bdr) == 0) && (n->state != NEIGHBOR_FULL)) ospf_iface_sm(ifa, ISM_BACKS); /* Neighbor is declaring itself as BDR */ - if ((ipa_compare(n->ip, n->bdr) == 0) && (n->state != NEIGHBOR_FULL)) + if (ipa_equal(n->ip, n->bdr) && (n->state != NEIGHBOR_FULL)) ospf_iface_sm(ifa, ISM_BACKS); /* Neighbor is newly declaring itself as DR or BDR */ - if (((ipa_compare(n->ip, n->dr) == 0) && (ipa_compare(n->dr, olddr) != 0)) - || ((ipa_compare(n->ip, n->bdr) == 0) - && (ipa_compare(n->bdr, oldbdr) != 0))) + if ((ipa_equal(n->ip, n->dr) && (!ipa_equal(n->dr, olddr))) + || (ipa_equal(n->ip, n->bdr) && (!ipa_equal(n->bdr, oldbdr)))) ospf_iface_sm(ifa, ISM_NEICH); /* Neighbor is no more declaring itself as DR or BDR */ - if (((ipa_compare(n->ip, olddr) == 0) && (ipa_compare(n->dr, olddr) != 0)) - || ((ipa_compare(n->ip, oldbdr) == 0) - && (ipa_compare(n->bdr, oldbdr) != 0))) + if ((ipa_equal(n->ip, olddr) && (!ipa_equal(n->dr, olddr))) + || (ipa_equal(n->ip, oldbdr) && (!ipa_equal(n->bdr, oldbdr)))) ospf_iface_sm(ifa, ISM_NEICH); } @@ -253,7 +251,7 @@ ospf_hello_send(timer * timer, int poll, struct ospf_neighbor *dirn) send = 1; WALK_LIST(n1, ifa->neigh_list) { - if (ipa_compare(nb->ip, n1->ip) == 0) + if (ipa_equal(nb->ip, n1->ip)) { send = 0; break; |