diff options
-rw-r--r-- | usr.sbin/ospfd/lsupdate.c | 15 | ||||
-rw-r--r-- | usr.sbin/ospfd/neighbor.c | 8 | ||||
-rw-r--r-- | usr.sbin/ospfd/ospfe.h | 3 |
3 files changed, 14 insertions, 12 deletions
diff --git a/usr.sbin/ospfd/lsupdate.c b/usr.sbin/ospfd/lsupdate.c index 4d63b9c3bec..ef5432bfd01 100644 --- a/usr.sbin/ospfd/lsupdate.c +++ b/usr.sbin/ospfd/lsupdate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lsupdate.c,v 1.24 2006/02/10 18:30:47 claudio Exp $ */ +/* $OpenBSD: lsupdate.c,v 1.25 2006/02/19 18:55:47 norby Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -195,7 +195,7 @@ add_ls_update(struct buf *buf, struct iface *iface, void *data, int len) } - + int send_ls_update(struct buf *buf, struct iface *iface, struct in_addr addr, u_int32_t nlsa) @@ -363,6 +363,8 @@ ls_retrans_list_insert(struct nbr *nbr, struct lsa_entry *new) } new->le_when = when; TAILQ_INSERT_TAIL(&nbr->ls_retrans_list, new, entry); + + nbr->ls_ret_cnt++; } void @@ -379,8 +381,9 @@ ls_retrans_list_remove(struct nbr *nbr, struct lsa_entry *le) if (TAILQ_FIRST(&nbr->ls_retrans_list) == le && evtimer_pending(&nbr->ls_retrans_timer, NULL)) reset = 1; - + TAILQ_REMOVE(&nbr->ls_retrans_list, le, entry); + nbr->ls_ret_cnt--; if (reset && TAILQ_FIRST(&nbr->ls_retrans_list)) { evtimer_del(&nbr->ls_retrans_timer); @@ -409,6 +412,8 @@ ls_retrans_list_clr(struct nbr *nbr) while ((le = TAILQ_FIRST(&nbr->ls_retrans_list)) != NULL) ls_retrans_list_free(nbr, le); + + nbr->ls_ret_cnt = 0; } int @@ -431,7 +436,7 @@ ls_retrans_timer(int fd, short event, void *bula) le->le_when = 0; /* timer fired */ else return; /* queue empty, nothing to do */ - + if (nbr->iface->self == nbr) { /* * oneshot needs to be set for lsa queued for flooding, @@ -472,7 +477,7 @@ ls_retrans_timer(int fd, short event, void *bula) TAILQ_REMOVE(&nbr->ls_retrans_list, le, entry); le->le_when = nbr->iface->rxmt_interval; ls_retrans_list_insert(nbr, le); - } + } } send_ls_update(buf, nbr->iface, addr, nlsa); diff --git a/usr.sbin/ospfd/neighbor.c b/usr.sbin/ospfd/neighbor.c index a0bf9baa07a..a84dbab2236 100644 --- a/usr.sbin/ospfd/neighbor.c +++ b/usr.sbin/ospfd/neighbor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: neighbor.c,v 1.27 2006/02/09 15:23:08 norby Exp $ */ +/* $OpenBSD: neighbor.c,v 1.28 2006/02/19 18:55:47 norby Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -649,11 +649,7 @@ nbr_to_ctl(struct nbr *nbr) nctl.db_sum_lst_cnt++; nctl.ls_req_lst_cnt = nbr->ls_req_cnt; - - /* XXX */ - nctl.ls_retrans_lst_cnt = 0; - TAILQ_FOREACH(le, &nbr->ls_retrans_list, entry) - nctl.ls_retrans_lst_cnt++; + nctl.ls_retrans_lst_cnt = nbr->ls_ret_cnt; nctl.nbr_state = nbr->state; diff --git a/usr.sbin/ospfd/ospfe.h b/usr.sbin/ospfd/ospfe.h index de4cda12e86..7e21d84a4e7 100644 --- a/usr.sbin/ospfd/ospfe.h +++ b/usr.sbin/ospfd/ospfe.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfe.h,v 1.22 2006/02/19 18:52:06 norby Exp $ */ +/* $OpenBSD: ospfe.h,v 1.23 2006/02/19 18:55:47 norby Exp $ */ /* * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org> @@ -133,6 +133,7 @@ struct nbr { u_int32_t dd_pending; u_int32_t peerid; /* unique ID in DB */ u_int32_t ls_req_cnt; + u_int32_t ls_ret_cnt; u_int32_t crypt_seq_num; int state; |