diff options
| author | Pat Ruddy <pat@voltanet.io> | 2021-03-10 17:59:07 +0000 |
|---|---|---|
| committer | Pat Ruddy <pat@voltanet.io> | 2021-06-18 09:40:42 +0100 |
| commit | 4f7bf1ab052e82f16f8b965c6afe9d1c0f22f479 (patch) | |
| tree | 27eebad2905df380b1b00b42f6231db2ebee92cc /ospf6d/ospf6_interface.c | |
| parent | aa6a96ba78bacb2792f2a6c26b6873b3ff4e35b8 (diff) | |
ospf6d: add tx fifo infrastructure
Add per interface fifo and per instance write list as a precursor
to implementing fairer sharing of the ospf6 oscket resources.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
Diffstat (limited to 'ospf6d/ospf6_interface.c')
| -rw-r--r-- | ospf6d/ospf6_interface.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 952c7f8b27..57b7348bcc 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -185,6 +185,8 @@ struct ospf6_interface *ospf6_interface_create(struct interface *ifp) oi = XCALLOC(MTYPE_OSPF6_IF, sizeof(struct ospf6_interface)); + oi->obuf = ospf6_fifo_new(); + oi->area = (struct ospf6_area *)NULL; oi->neighbor_list = list_new(); oi->neighbor_list->cmp = ospf6_neighbor_cmp; @@ -243,6 +245,8 @@ void ospf6_interface_delete(struct ospf6_interface *oi) QOBJ_UNREG(oi); + ospf6_fifo_free(oi->obuf); + for (ALL_LIST_ELEMENTS(oi->neighbor_list, node, nnode, on)) ospf6_neighbor_delete(on); @@ -888,6 +892,15 @@ int interface_down(struct thread *thread) ospf6_sso(oi->interface->ifindex, &allspfrouters6, IPV6_LEAVE_GROUP, ospf6->fd); + /* deal with write fifo */ + ospf6_fifo_flush(oi->obuf); + if (oi->on_write_q) { + listnode_delete(ospf6->oi_write_q, oi); + if (list_isempty(ospf6->oi_write_q)) + thread_cancel(&ospf6->t_write); + oi->on_write_q = 0; + } + ospf6_interface_state_change(OSPF6_INTERFACE_DOWN, oi); return 0; |
