diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2019-11-06 03:51:27 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2019-11-06 03:51:27 +0000 |
commit | 37183277edd5b48bb15c17a71ef7e126f8bbe9a6 (patch) | |
tree | bf26c22343f9120a4cb97280389dbe66513dc176 /sys/net/if_bridge.h | |
parent | a6c76ac42cc0d920d495823ca251191871c97868 (diff) |
replace the hooks used with if_detachhooks with a task list.
the main semantic change is that things registering detach hooks
have to allocate and set a task structure that then gets added to
the list. this means if the task is allocated up front (eg, as part
of carps softc or bridges port structure), it avoids the possibility
that adding a hook can fail. a lot of drivers weren't checking for
failure, and unwinding state in the event of failure in other parts
was error prone.
while doing this i discovered that the list operations have to be
in a particular order, but drivers weren't doing that consistently
either. this diff wraps the list ops up so you have to seriously
go out of your way to screw them up.
ive also sprinkled some NET_ASSERT_LOCKED around the list operations
so we can make sure there's no potential for the list to be corrupted,
especially while it's being run.
hrvoje popovski has tested this a bit, and some issues he discovered
have been fixed.
ok sashan@
Diffstat (limited to 'sys/net/if_bridge.h')
-rw-r--r-- | sys/net/if_bridge.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if_bridge.h b/sys/net/if_bridge.h index 74e1cfd9838..64393cf9ad2 100644 --- a/sys/net/if_bridge.h +++ b/sys/net/if_bridge.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.h,v 1.65 2019/05/12 19:53:22 mpi Exp $ */ +/* $OpenBSD: if_bridge.h,v 1.66 2019/11/06 03:51:26 dlg Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -425,7 +425,7 @@ struct bridge_iflist { struct ifnet *ifp; /* [I] net interface */ u_int32_t bif_flags; /* member flags */ u_int32_t bif_protected; /* protected domains */ - void *bif_dhcookie; + struct task bif_dtask; }; #define bif_state bif_stp->bp_state |