diff options
Diffstat (limited to 'ospfd/ospf_interface.c')
| -rw-r--r-- | ospfd/ospf_interface.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index a4f4cd216a..2a758d5583 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -494,6 +494,20 @@ struct ospf_interface *ospf_if_lookup_recv_if(struct ospf *ospf, return match; } +void ospf_interface_fifo_flush(struct ospf_interface *oi) +{ + struct ospf *ospf = oi->ospf; + + ospf_fifo_flush(oi->obuf); + + if (oi->on_write_q) { + listnode_delete(ospf->oi_write_q, oi); + if (list_isempty(ospf->oi_write_q)) + THREAD_OFF(ospf->t_write); + oi->on_write_q = 0; + } +} + static void ospf_if_reset_stats(struct ospf_interface *oi) { oi->hello_in = oi->hello_out = 0; @@ -505,19 +519,10 @@ static void ospf_if_reset_stats(struct ospf_interface *oi) void ospf_if_stream_unset(struct ospf_interface *oi) { - struct ospf *ospf = oi->ospf; - /* flush the interface packet queue */ - ospf_fifo_flush(oi->obuf); + ospf_interface_fifo_flush(oi); /*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)) - THREAD_OFF(ospf->t_write); - oi->on_write_q = 0; - } } |
