diff options
Diffstat (limited to 'proto/ospf')
-rw-r--r-- | proto/ospf/config.Y | 4 | ||||
-rw-r--r-- | proto/ospf/hello.c | 4 | ||||
-rw-r--r-- | proto/ospf/iface.c | 4 | ||||
-rw-r--r-- | proto/ospf/neighbor.c | 2 | ||||
-rw-r--r-- | proto/ospf/ospf.c | 2 | ||||
-rw-r--r-- | proto/ospf/ospf.h | 3 |
6 files changed, 12 insertions, 7 deletions
diff --git a/proto/ospf/config.Y b/proto/ospf/config.Y index 5f9f12c..f14f1a4 100644 --- a/proto/ospf/config.Y +++ b/proto/ospf/config.Y @@ -96,6 +96,7 @@ ospf_vlink_item: | RETRANSMIT expr { OSPF_PATT->rxmtint = $2 ; if ($2<=0) cf_error("Retransmit int must be greater than zero"); } | TRANSMIT DELAY expr { OSPF_PATT->inftransdelay = $3 ; if (($3<=0) || ($3>65535)) cf_error("Transmit delay must be in range 1-65535"); } | WAIT expr { OSPF_PATT->waitint = $2 ; } + | DEAD expr { OSPF_PATT->dead = $2 ; if ($2<=1) cf_error("Dead interval must be greater than one"); } | DEAD COUNT expr { OSPF_PATT->deadc = $3 ; if ($3<=1) cf_error("Dead count must be greater than one"); } | AUTHENTICATION NONE { OSPF_PATT->autype = OSPF_AUTH_NONE ; } | AUTHENTICATION SIMPLE { OSPF_PATT->autype = OSPF_AUTH_SIMPLE ; } @@ -115,6 +116,7 @@ ospf_vlink_start: VIRTUAL LINK idval OSPF_PATT->inftransdelay = INFTRANSDELAY_D; OSPF_PATT->waitint = WAIT_DMH*HELLOINT_D; OSPF_PATT->deadc = DEADC_D; + OSPF_PATT->dead = 0; OSPF_PATT->type = OSPF_IT_VLINK; init_list(&OSPF_PATT->nbma_list); OSPF_PATT->autype = OSPF_AUTH_NONE; @@ -129,6 +131,7 @@ ospf_iface_item: | TRANSMIT DELAY expr { OSPF_PATT->inftransdelay = $3 ; if (($3<=0) || ($3>65535)) cf_error("Transmit delay must be in range 1-65535"); } | PRIORITY expr { OSPF_PATT->priority = $2 ; if (($2<0) || ($2>255)) cf_error("Priority must be in range 0-255"); } | WAIT expr { OSPF_PATT->waitint = $2 ; } + | DEAD expr { OSPF_PATT->dead = $2 ; if ($2<=1) cf_error("Dead interval must be greater than one"); } | DEAD COUNT expr { OSPF_PATT->deadc = $3 ; if ($3<=1) cf_error("Dead count must be greater than one"); } | TYPE BROADCAST { OSPF_PATT->type = OSPF_IT_BCAST ; } | TYPE NONBROADCAST { OSPF_PATT->type = OSPF_IT_NBMA ; } @@ -210,6 +213,7 @@ ospf_iface_start: OSPF_PATT->priority = PRIORITY_D; OSPF_PATT->waitint = WAIT_DMH*HELLOINT_D; OSPF_PATT->deadc = DEADC_D; + OSPF_PATT->dead = 0; OSPF_PATT->type = OSPF_IT_UNDEF; OSPF_PATT->strictnbma = 0; OSPF_PATT->stub = 0; diff --git a/proto/ospf/hello.c b/proto/ospf/hello.c index 5711ac5..ce87431 100644 --- a/proto/ospf/hello.c +++ b/proto/ospf/hello.c @@ -38,7 +38,7 @@ ospf_hello_receive(struct ospf_hello_packet *ps, return; } - if (ntohl(ps->deadint) != ifa->helloint * ifa->deadc) + if (ntohl(ps->deadint) != ifa->dead) { log(L_ERR "%s%I%sdead interval mismatch (%d).", beg, faddr, rec, ntohl(ps->deadint)); @@ -209,7 +209,7 @@ ospf_hello_send(timer * timer, int poll, struct ospf_neighbor *dirn) pkt->helloint = ntohs(ifa->helloint); pkt->options = ifa->oa->opt.byte; pkt->priority = ifa->priority; - pkt->deadint = htonl(ifa->deadc * ifa->helloint); + pkt->deadint = htonl(ifa->dead); pkt->dr = ifa->drip; ipa_hton(pkt->dr); pkt->bdr = ifa->bdrip; diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c index 68b6377..cce7faf 100644 --- a/proto/ospf/iface.c +++ b/proto/ospf/iface.c @@ -393,7 +393,7 @@ ospf_iface_new(struct proto_ospf *po, struct iface *iface, ifa->pollint = ip->pollint; ifa->strictnbma = ip->strictnbma; ifa->waitint = ip->waitint; - ifa->deadc = ip->deadc; + ifa->dead = (ip->dead == 0) ? ip->deadc * ifa->helloint : ip->dead; ifa->stub = ip->stub; ifa->autype = ip->autype; ifa->passwords = ip->passwords; @@ -585,7 +585,7 @@ ospf_iface_info(struct ospf_iface *ifa) cli_msg(-1015, "\tPoll timer: %u", ifa->pollint); } cli_msg(-1015, "\tWait timer: %u", ifa->waitint); - cli_msg(-1015, "\tDead timer: %u", ifa->deadc * ifa->helloint); + cli_msg(-1015, "\tDead timer: %u", ifa->dead); cli_msg(-1015, "\tRetransmit timer: %u", ifa->rxmtint); if ((ifa->type == OSPF_IT_BCAST) || (ifa->type == OSPF_IT_NBMA)) { diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c index 59a9805..7696d45 100644 --- a/proto/ospf/neighbor.c +++ b/proto/ospf/neighbor.c @@ -309,7 +309,7 @@ ospf_neigh_sm(struct ospf_neighbor *n, int event) case NEIGHBOR_DOWN: neigh_chstate(n, NEIGHBOR_INIT); default: - tm_start(n->inactim, n->ifa->deadc * n->ifa->helloint); /* Restart inactivity timer */ + tm_start(n->inactim, n->ifa->dead); /* Restart inactivity timer */ break; } break; diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c index ce01a37..e43c741 100644 --- a/proto/ospf/ospf.c +++ b/proto/ospf/ospf.c @@ -721,7 +721,7 @@ ospf_reconfigure(struct proto *p, struct proto_config *c) /* DEAD COUNT */ if (ip1->deadc != ip2->deadc) { - ifa->deadc = ip2->deadc; + ifa->dead = ip2->dead; OSPF_TRACE(D_EVENTS, "Changing dead count on interface %s from %d to %d", ifa->iface->name, ip1->deadc, ip2->deadc); diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h index 44ba10f..79d1f4f 100644 --- a/proto/ospf/ospf.h +++ b/proto/ospf/ospf.h @@ -138,7 +138,7 @@ struct ospf_iface u32 waitint; /* number of sec before changing state from wait */ u32 rxmtint; /* number of seconds between LSA retransmissions */ u32 pollint; /* Poll interval */ - u32 deadc; /* after "deadint" missing hellos is router dead */ + u32 dead; /* after "deadint" missing hellos is router dead */ u32 vid; /* Id of peer of virtual link */ ip_addr vip; /* IP of peer of virtual link */ struct ospf_area *voa; /* Area wich the vlink goes through */ @@ -548,6 +548,7 @@ struct ospf_iface_patt u32 priority; u32 waitint; u32 deadc; + u32 dead; u32 type; u32 autype; u32 strictnbma; |