diff options
| author | Chirag Shah <chirag@cumulusnetworks.com> | 2017-10-23 11:59:29 -0700 |
|---|---|---|
| committer | Chirag Shah <chirag@cumulusnetworks.com> | 2017-10-23 14:48:22 -0700 |
| commit | 85c8ef06638e2055b726b7dcc4bc1695496fb90b (patch) | |
| tree | 56018915394c6cef14442129d9978803d53f17e6 /ospfd/ospf_interface.c | |
| parent | c93396633cb878db1cfcbe19fd8a308b3d221f60 (diff) | |
ospfd: reset ospf interface protocol stats
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospf_interface.c')
| -rw-r--r-- | ospfd/ospf_interface.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index 34a1e6f6d6..e8700e7eb0 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -453,6 +453,15 @@ struct ospf_interface *ospf_if_lookup_recv_if(struct ospf *ospf, return match; } +static void ospf_if_reset_stats(struct ospf_interface *oi) +{ + oi->hello_in = oi->hello_out = 0; + oi->db_desc_in = oi->db_desc_out = 0; + oi->ls_req_in = oi->ls_req_out = 0; + oi->ls_upd_in = oi->ls_upd_out = 0; + oi->ls_ack_in = oi->ls_ack_out = 0; +} + void ospf_if_stream_set(struct ospf_interface *oi) { /* set output fifo queue. */ @@ -468,6 +477,9 @@ void ospf_if_stream_unset(struct ospf_interface *oi) ospf_fifo_free(oi->obuf); oi->obuf = NULL; + /*reset protocol stats */ + ospf_if_reset_stats(oi); + if (oi->on_write_q) { listnode_delete(ospf->oi_write_q, oi); if (list_isempty(ospf->oi_write_q)) |
