diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2010-11-13 14:19:23 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2010-11-13 14:19:23 +0100 |
commit | d9e7e1b13d69fa50d1979576c418c579f05463c6 (patch) | |
tree | f5abd04371627296271c674ec39c36be2d90f821 /proto/ospf/ospf.c | |
parent | fe181e7c63843ad65401cc1e400ae1ac3187122f (diff) |
Adds support for iface link detection to OSPF.
Diffstat (limited to 'proto/ospf/ospf.c')
-rw-r--r-- | proto/ospf/ospf.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index a2a38f4b..d9d8b7c4 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -269,7 +269,7 @@ ospf_init(struct proto_config *c) p->reload_routes = ospf_reload_routes; p->accept_ra_types = RA_OPTIMAL; p->rt_notify = ospf_rt_notify; - p->if_notify = ospf_iface_notify; + p->if_notify = ospf_if_notify; p->ifa_notify = ospf_ifa_notify; p->rte_better = ospf_rte_better; p->rte_same = ospf_rte_same; @@ -728,7 +728,7 @@ ospf_reconfigure(struct proto *p, struct proto_config *c) } /* POLL TIMER */ - if (oldip->pollint != newip->pollint) + if ((oldip->pollint != newip->pollint) && ifa->poll_timer) { ifa->pollint = newip->helloint; ifa->poll_timer->recurrent = ifa->pollint; @@ -758,6 +758,15 @@ ospf_reconfigure(struct proto *p, struct proto_config *c) ospf_iface_change_mtu(po, ifa); } + /* LINK */ + if (oldip->use_link != newip->use_link) + { + ifa->use_link = newip->use_link; + + if (!(ifa->iface->flags & IF_LINK_UP)) + ospf_iface_sm(ifa, ifa->use_link ? ISM_LOOP : ISM_UNLOOP); + } + /* strict nbma */ if ((oldip->strictnbma == 0) && (newip->strictnbma != 0)) { @@ -819,7 +828,7 @@ ospf_reconfigure(struct proto *p, struct proto_config *c) } /* WAIT */ - if (oldip->waitint != newip->waitint) + if ((oldip->waitint != newip->waitint) && ifa->wait_timer) { ifa->waitint = newip->waitint; if (ifa->wait_timer->expires != 0) @@ -890,7 +899,7 @@ ospf_reconfigure(struct proto *p, struct proto_config *c) } if (!found) { - nb1 = mb_alloc(p->pool, sizeof(struct nbma_node)); + nb1 = mb_alloc(ifa->pool, sizeof(struct nbma_node)); nb1->ip = nb2->ip; nb1->eligible = nb2->eligible; add_tail(&ifa->nbma_list, NODE nb1); |