diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c index 7c80c226..f7961514 100644 --- a/proto/ospf/iface.c +++ b/proto/ospf/iface.c @@ -1397,6 +1397,13 @@ ospf_iface_info(struct ospf_iface *ifa) cli_msg(-1015, "\tBackup designated router (IP): %I", ifa->bdrip); } + uint lsrt_count = 0; + struct ospf_neighbor *n; + WALK_LIST(n, ifa->neigh_list) + lsrt_count += n->lsrt_count; + cli_msg(-1015, "\tTotal LSA retransmission list length: %u", lsrt_count); + cli_msg(-1015, "\tStatistics:"); ospf_iface_stats(-1015, &ifa->stats); + } diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c index 37139b96..09a38e3d 100644 --- a/proto/ospf/lsupd.c +++ b/proto/ospf/lsupd.c @@ -129,8 +129,9 @@ ospf_lsa_lsrt_up(struct top_hash_entry *en, struct ospf_neighbor *n) if (!SNODE_VALID(ret)) { - en->ret_count++; s_add_tail(&n->lsrtl, SNODE ret); + n->lsrt_count++; + en->ret_count++; } ret->lsa = en->lsa; @@ -148,6 +149,7 @@ ospf_lsa_lsrt_down_(struct top_hash_entry *en, struct ospf_neighbor *n, struct t s_rem_node(SNODE ret); ospf_hash_delete(n->lsrth, ret); + n->lsrt_count--; if (EMPTY_SLIST(n->lsrtl)) tm_stop(n->lsrt_timer); @@ -450,6 +452,7 @@ ospf_rxmt_lsupd(struct ospf_proto *p, struct ospf_neighbor *n) s_rem_node(SNODE ret); ospf_hash_delete(n->lsrth, ret); + n->lsrt_count--; continue; } diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c index f2d3505e..ff27cd41 100644 --- a/proto/ospf/neighbor.c +++ b/proto/ospf/neighbor.c @@ -39,6 +39,7 @@ init_lists(struct ospf_proto *p, struct ospf_neighbor *n) s_init_list(&(n->lsrtl)); n->lsrth = ospf_top_new(p, n->pool); + n->lsrt_count = 0; } static void diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h index 8e49a7c5..90fbd562 100644 --- a/proto/ospf/ospf.h +++ b/proto/ospf/ospf.h @@ -390,6 +390,7 @@ struct ospf_neighbor */ slist lsrtl; /* slist of struct top_hash_entry from n->lsrth */ struct top_graph *lsrth; + u32 lsrt_count; /* Number of entries in Link state retransmission list */ timer *dbdes_timer; /* DBDES exchange timer */ timer *lsrq_timer; /* LSA request timer */ timer *lsrt_timer; /* LSA retransmission timer */