Send hello just after interface is up.
This makes the adjacency forming faster. Minor code clean up.
This commit is contained in:
parent
897999c22a
commit
a417ad13a1
1 changed files with 8 additions and 10 deletions
|
@ -59,7 +59,7 @@ ospf_hello_receive(struct ospf_hello_packet *ps,
|
||||||
|
|
||||||
WALK_LIST(nn, ifa->nbma_list)
|
WALK_LIST(nn, ifa->nbma_list)
|
||||||
{
|
{
|
||||||
if (ipa_compare(faddr, nn->ip) == 0)
|
if (ipa_equal(faddr, nn->ip))
|
||||||
{
|
{
|
||||||
found = 1;
|
found = 1;
|
||||||
break;
|
break;
|
||||||
|
@ -132,24 +132,22 @@ ospf_hello_receive(struct ospf_hello_packet *ps,
|
||||||
ospf_iface_sm(ifa, ISM_NEICH);
|
ospf_iface_sm(ifa, ISM_NEICH);
|
||||||
|
|
||||||
/* Router is declaring itself ad DR and there is no BDR */
|
/* 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))
|
&& (n->state != NEIGHBOR_FULL))
|
||||||
ospf_iface_sm(ifa, ISM_BACKS);
|
ospf_iface_sm(ifa, ISM_BACKS);
|
||||||
|
|
||||||
/* Neighbor is declaring itself as BDR */
|
/* 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);
|
ospf_iface_sm(ifa, ISM_BACKS);
|
||||||
|
|
||||||
/* Neighbor is newly declaring itself as DR or BDR */
|
/* Neighbor is newly declaring itself as DR or BDR */
|
||||||
if (((ipa_compare(n->ip, n->dr) == 0) && (ipa_compare(n->dr, olddr) != 0))
|
if ((ipa_equal(n->ip, n->dr) && (!ipa_equal(n->dr, olddr)))
|
||||||
|| ((ipa_compare(n->ip, n->bdr) == 0)
|
|| (ipa_equal(n->ip, n->bdr) && (!ipa_equal(n->bdr, oldbdr))))
|
||||||
&& (ipa_compare(n->bdr, oldbdr) != 0)))
|
|
||||||
ospf_iface_sm(ifa, ISM_NEICH);
|
ospf_iface_sm(ifa, ISM_NEICH);
|
||||||
|
|
||||||
/* Neighbor is no more declaring itself as DR or BDR */
|
/* Neighbor is no more declaring itself as DR or BDR */
|
||||||
if (((ipa_compare(n->ip, olddr) == 0) && (ipa_compare(n->dr, olddr) != 0))
|
if ((ipa_equal(n->ip, olddr) && (!ipa_equal(n->dr, olddr)))
|
||||||
|| ((ipa_compare(n->ip, oldbdr) == 0)
|
|| (ipa_equal(n->ip, oldbdr) && (!ipa_equal(n->bdr, oldbdr))))
|
||||||
&& (ipa_compare(n->bdr, oldbdr) != 0)))
|
|
||||||
ospf_iface_sm(ifa, ISM_NEICH);
|
ospf_iface_sm(ifa, ISM_NEICH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,7 +251,7 @@ ospf_hello_send(timer * timer, int poll, struct ospf_neighbor *dirn)
|
||||||
send = 1;
|
send = 1;
|
||||||
WALK_LIST(n1, ifa->neigh_list)
|
WALK_LIST(n1, ifa->neigh_list)
|
||||||
{
|
{
|
||||||
if (ipa_compare(nb->ip, n1->ip) == 0)
|
if (ipa_equal(nb->ip, n1->ip))
|
||||||
{
|
{
|
||||||
send = 0;
|
send = 0;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue