summaryrefslogtreecommitdiff
path: root/sys/net/if_var.h
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2019-11-07 07:36:33 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2019-11-07 07:36:33 +0000
commit37888cbb216c3b0a4b8628e4f5b1f49605c2ff56 (patch)
tree5bc0f3659b6a4221fc47f31b18711d577ca21d8c /sys/net/if_var.h
parent9b2b8e17cfdc462bd540a101c43c204770f2a3f3 (diff)
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_var.h')
-rw-r--r--sys/net/if_var.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index deb09ad44da..3787fc54e6d 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_var.h,v 1.101 2019/11/06 03:51:26 dlg Exp $ */
+/* $OpenBSD: if_var.h,v 1.102 2019/11/07 07:36:32 dlg Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
@@ -125,7 +125,7 @@ struct ifnet { /* and the entries */
TAILQ_HEAD(, ifmaddr) if_maddrlist; /* [N] list of multicast records */
TAILQ_HEAD(, ifg_list) if_groups; /* [N] list of groups per if */
struct hook_desc_head *if_addrhooks; /* [I] address change callbacks */
- struct hook_desc_head *if_linkstatehooks; /* [I] link change callbacks*/
+ struct task_list if_linkstatehooks; /* [I] link change callbacks*/
struct task_list if_detachhooks; /* [I] detach callbacks */
/* [I] check or clean routes (+ or -)'d */
void (*if_rtrequest)(struct ifnet *, int, struct rtentry *);
@@ -376,6 +376,8 @@ void if_ih_remove(struct ifnet *, int (*)(struct ifnet *, struct mbuf *,
void if_detachhook_add(struct ifnet *, struct task *);
void if_detachhook_del(struct ifnet *, struct task *);
+void if_linkstatehook_add(struct ifnet *, struct task *);
+void if_linkstatehook_del(struct ifnet *, struct task *);
void if_rxr_livelocked(struct if_rxring *);
void if_rxr_init(struct if_rxring *, u_int, u_int);