diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2010-11-19 13:46:21 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2010-11-19 13:46:21 +0100 |
commit | 391931d45686a807d322878d4b3d5c9634e2dbca (patch) | |
tree | 73916db85f6b68eabb5000fdcfe19ade4e7954f3 /proto/ospf | |
parent | 79f561a173c9ceb824d64aa32d82e43ba62acebc (diff) |
Minor finalizations of link state checks.
Diffstat (limited to 'proto/ospf')
-rw-r--r-- | proto/ospf/config.Y | 7 | ||||
-rw-r--r-- | proto/ospf/hello.c | 2 | ||||
-rw-r--r-- | proto/ospf/iface.c | 6 | ||||
-rw-r--r-- | proto/ospf/neighbor.c | 1 | ||||
-rw-r--r-- | proto/ospf/ospf.c | 6 | ||||
-rw-r--r-- | proto/ospf/ospf.h | 4 |
6 files changed, 12 insertions, 14 deletions
diff --git a/proto/ospf/config.Y b/proto/ospf/config.Y index 49d65942..3af879d6 100644 --- a/proto/ospf/config.Y +++ b/proto/ospf/config.Y @@ -49,7 +49,7 @@ CF_KEYWORDS(OSPF, AREA, OSPF_METRIC1, OSPF_METRIC2, OSPF_TAG, OSPF_ROUTER_ID) CF_KEYWORDS(BROADCAST, NEIGHBORS, RFC1583COMPAT, STUB, TICK, COST, RETRANSMIT) CF_KEYWORDS(HELLO, TRANSMIT, PRIORITY, DEAD, NONBROADCAST, POINTOPOINT, TYPE) CF_KEYWORDS(NONE, SIMPLE, AUTHENTICATION, STRICT, CRYPTOGRAPHIC) -CF_KEYWORDS(ELIGIBLE, POLL, NETWORKS, HIDDEN, VIRTUAL, LINK) +CF_KEYWORDS(ELIGIBLE, POLL, NETWORKS, HIDDEN, VIRTUAL, CHECK, LINK) CF_KEYWORDS(RX, BUFFER, LARGE, NORMAL, STUBNET, HIDDEN, SUMMARY) CF_KEYWORDS(WAIT, DELAY, LSADB) @@ -192,7 +192,7 @@ ospf_iface_item: | TYPE POINTOPOINT { OSPF_PATT->type = OSPF_IT_PTP ; } | STRICT NONBROADCAST bool { OSPF_PATT->strictnbma = $3 ; } | STUB bool { OSPF_PATT->stub = $2 ; } - | LINK bool { OSPF_PATT->use_link = $2 ; } + | CHECK LINK bool { OSPF_PATT->check_link = $3; } | NEIGHBORS '{' ipa_list '}' | AUTHENTICATION NONE { OSPF_PATT->autype = OSPF_AUTH_NONE ; } | AUTHENTICATION SIMPLE { OSPF_PATT->autype = OSPF_AUTH_SIMPLE ; } @@ -274,9 +274,6 @@ ospf_iface_start: OSPF_PATT->deadc = DEADC_D; OSPF_PATT->dead = 0; OSPF_PATT->type = OSPF_IT_UNDEF; - OSPF_PATT->strictnbma = 0; - OSPF_PATT->stub = 0; - OSPF_PATT->use_link = 1; init_list(&OSPF_PATT->nbma_list); OSPF_PATT->autype = OSPF_AUTH_NONE; reset_passwords(); diff --git a/proto/ospf/hello.c b/proto/ospf/hello.c index 3d7d8de3..216dc72f 100644 --- a/proto/ospf/hello.c +++ b/proto/ospf/hello.c @@ -247,7 +247,7 @@ ospf_hello_send(timer *timer, int poll, struct ospf_neighbor *dirn) else ifa = (struct ospf_iface *) timer->data; - if (ifa->state == OSPF_IS_DOWN) + if (ifa->state <= OSPF_IS_LOOP) return; if (ifa->stub) diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c index 072e1c71..83ea1c29 100644 --- a/proto/ospf/iface.c +++ b/proto/ospf/iface.c @@ -334,7 +334,7 @@ ospf_iface_sm(struct ospf_iface *ifa, int event) break; case ISM_LOOP: - if (ifa->sk && ifa->use_link) + if (ifa->sk && ifa->check_link) ospf_iface_chstate(ifa, OSPF_IS_LOOP); break; @@ -401,7 +401,7 @@ ospf_iface_add(struct object_lock *lock) } /* Do iface UP, unless there is no link and we use link detection */ - ospf_iface_sm(ifa, (ifa->use_link && !(ifa->iface->flags & IF_LINK_UP)) ? ISM_LOOP : ISM_UP); + ospf_iface_sm(ifa, (ifa->check_link && !(ifa->iface->flags & IF_LINK_UP)) ? ISM_LOOP : ISM_UP); } void @@ -435,7 +435,7 @@ ospf_iface_new(struct proto_ospf *po, struct iface *iface, struct ifa *addr, ifa->stub = ospf_iface_stubby(ip, addr); ifa->ioprob = OSPF_I_OK; ifa->rxbuf = ip->rxbuf; - ifa->use_link = ip->use_link; + ifa->check_link = ip->check_link; #ifdef OSPFv2 ifa->autype = ip->autype; diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c index 2563abd4..05f024a7 100644 --- a/proto/ospf/neighbor.c +++ b/proto/ospf/neighbor.c @@ -284,6 +284,7 @@ can_do_adj(struct ospf_neighbor *n) switch (ifa->state) { case OSPF_IS_DOWN: + case OSPF_IS_LOOP: bug("%s: Iface %s in down state?", p->name, ifa->iface->name); break; case OSPF_IS_WAITING: diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index d9d8b7c4..026d9751 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -759,12 +759,12 @@ ospf_reconfigure(struct proto *p, struct proto_config *c) } /* LINK */ - if (oldip->use_link != newip->use_link) + if (oldip->check_link != newip->check_link) { - ifa->use_link = newip->use_link; + ifa->check_link = newip->check_link; if (!(ifa->iface->flags & IF_LINK_UP)) - ospf_iface_sm(ifa, ifa->use_link ? ISM_LOOP : ISM_UNLOOP); + ospf_iface_sm(ifa, ifa->check_link ? ISM_LOOP : ISM_UNLOOP); } /* strict nbma */ diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h index 341d9a7c..3345d4fc 100644 --- a/proto/ospf/ospf.h +++ b/proto/ospf/ospf.h @@ -246,7 +246,7 @@ struct ospf_iface u8 sk_spf; /* Socket is a member of SPFRouters group */ u8 sk_dr; /* Socket is a member of DRouters group */ u16 rxbuf; /* Buffer size */ - u8 use_link; /* Whether iface link change is used */ + u8 check_link; /* Whether iface link change is used */ }; struct ospf_md5 @@ -755,7 +755,7 @@ struct ospf_iface_patt u32 stub; u32 vid; u16 rxbuf; - u8 use_link; + u8 check_link; #define OSPF_RXBUF_NORMAL 0 #define OSPF_RXBUF_LARGE 1 #define OSPF_RXBUF_MINSIZE 256 /* Minimal allowed size */ |