summaryrefslogtreecommitdiffstats
path: root/sys/net/if_aggr.c
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2019-11-07 07:36:31 +0000
committerdlg <dlg@openbsd.org>2019-11-07 07:36:31 +0000
commit4f5e51a4e9a138283295ab8b7f236f90bf0f58ce (patch)
treee8f67f65e4d04bf88cb83ad12c28409ae28f84d8 /sys/net/if_aggr.c
parentAdd -F flag to send-keys to expand formats in search-backward and (diff)
downloadwireguard-openbsd-4f5e51a4e9a138283295ab8b7f236f90bf0f58ce.tar.xz
wireguard-openbsd-4f5e51a4e9a138283295ab8b7f236f90bf0f58ce.zip
turn the linkstate hooks into a task list, like the detach hooks.
this is largely mechanical, except for carp. this moves the addition of the carp link state hook after we're committed to using the new interface as a carpdev. because the add can't fail, we avoid a complicated unwind dance. also, this tweaks the carp linkstate hook so it only updates the relevant carp interface, not all of the carpdevs on the parent. hrvoje popovski has tested an early version of this diff and it's generally ok, but there's some splasserts that this diff fires that i'll fix in an upcoming diff. ok claudio@
Diffstat (limited to 'sys/net/if_aggr.c')
-rw-r--r--sys/net/if_aggr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/net/if_aggr.c b/sys/net/if_aggr.c
index b73ea41caac..3744abbe898 100644
--- a/sys/net/if_aggr.c
+++ b/sys/net/if_aggr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_aggr.c,v 1.20 2019/11/06 03:51:26 dlg Exp $ */
+/* $OpenBSD: if_aggr.c,v 1.21 2019/11/07 07:36:31 dlg Exp $ */
/*
* Copyright (c) 2019 The University of Queensland
@@ -335,7 +335,7 @@ struct aggr_port {
int (*p_output)(struct ifnet *, struct mbuf *, struct sockaddr *,
struct rtentry *);
- void *p_lcookie;
+ struct task p_lhook;
struct task p_dhook;
struct aggr_softc *p_aggr;
@@ -1135,8 +1135,8 @@ aggr_add_port(struct aggr_softc *sc, const struct trunk_reqport *rp)
}
}
- p->p_lcookie = hook_establish(ifp0->if_linkstatehooks, 1,
- aggr_p_linkch, p);
+ task_set(&p->p_lhook, aggr_p_linkch, p);
+ if_linkstatehook_add(ifp0, &p->p_lhook);
task_set(&p->p_dhook, aggr_p_detach, p);
if_detachhook_add(ifp0, &p->p_dhook);
@@ -1428,7 +1428,7 @@ aggr_p_dtor(struct aggr_softc *sc, struct aggr_port *p, const char *op)
}
if_detachhook_del(ifp0, &p->p_dhook);
- hook_disestablish(ifp0->if_linkstatehooks, p->p_lcookie);
+ if_linkstatehook_del(ifp0, &p->p_lhook);
if_put(ifp0);
free(p, M_DEVBUF, sizeof(*p));