summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorVitaliy Makkoveev <mvs@cvs.openbsd.org>2023-12-19 20:34:11 +0000
committerVitaliy Makkoveev <mvs@cvs.openbsd.org>2023-12-19 20:34:11 +0000
commit585525fa10a9d5fdcdd30f22fb5f2a48140cb88f (patch)
tree434d435606bd2e24c933598fbefef09480fbac50 /sys/net
parent774877c40a549ed7fa31aa2116396e28cccf4c89 (diff)
Initialize `sc_outputtask' before interface attachment. if_alloc_sadl()
has sleep point, so the uninitialized `sc_outputtask` could be accessed through ioctl(2) interface. ok sashan bluhm
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_pflow.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/if_pflow.c b/sys/net/if_pflow.c
index 94608c56dfd..7bc9e70542f 100644
--- a/sys/net/if_pflow.c
+++ b/sys/net/if_pflow.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pflow.c,v 1.106 2023/12/16 22:16:02 mvs Exp $ */
+/* $OpenBSD: if_pflow.c,v 1.107 2023/12/19 20:34:10 mvs Exp $ */
/*
* Copyright (c) 2011 Florian Obser <florian@narrans.de>
@@ -277,12 +277,12 @@ pflow_clone_create(struct if_clone *ifc, int unit)
timeout_set_proc(&pflowif->sc_tmo6, pflow_timeout6, pflowif);
timeout_set_proc(&pflowif->sc_tmo_tmpl, pflow_timeout_tmpl, pflowif);
+ task_set(&pflowif->sc_outputtask, pflow_output_process, pflowif);
+
if_counters_alloc(ifp);
if_attach(ifp);
if_alloc_sadl(ifp);
- task_set(&pflowif->sc_outputtask, pflow_output_process, pflowif);
-
/* Insert into list of pflows */
KERNEL_ASSERT_LOCKED();
SMR_SLIST_INSERT_HEAD_LOCKED(&pflowif_list, pflowif, sc_next);