summaryrefslogtreecommitdiff
path: root/sys/netinet6/in6_ifattach.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2019-11-08 07:16:30 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2019-11-08 07:16:30 +0000
commitcc9483a80803855ffa3376b13ebbd8b6e388cee1 (patch)
tree837221515cc522324b695dbd52708970926136b6 /sys/netinet6/in6_ifattach.c
parent49a5ca10756fe16735beacb0938189fe6b04b0e6 (diff)
convert interface address change hooks to tasks and a task_list.
this follows what's been done for detach and link state hooks, and makes handling of hooks generally more robust. address hooks are a bit different to detach/link state hooks in that there's only a few things that register hooks (carp, pf, vxlan), but a lot of places to run the hooks (lots of ipv4 and ipv6 address configuration). an address hook cookie was in struct pfi_kif, which is part of the pf abi. rather than break pfctl -sI, this maintains the void * used for the cookie and uses it to store a task, which is then used as intended with the new api.
Diffstat (limited to 'sys/netinet6/in6_ifattach.c')
-rw-r--r--sys/netinet6/in6_ifattach.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c
index 87aac0e1378..9e3232452de 100644
--- a/sys/netinet6/in6_ifattach.c
+++ b/sys/netinet6/in6_ifattach.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in6_ifattach.c,v 1.114 2019/08/21 15:32:18 florian Exp $ */
+/* $OpenBSD: in6_ifattach.c,v 1.115 2019/11/08 07:16:29 dlg Exp $ */
/* $KAME: in6_ifattach.c,v 1.124 2001/07/18 08:32:51 jinmei Exp $ */
/*
@@ -289,7 +289,7 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct in6_addr *ifid)
nd6_dad_start(&ia6->ia_ifa);
if (ifp->if_flags & IFF_LOOPBACK) {
- dohooks(ifp->if_addrhooks, 0);
+ if_addrhooks_run(ifp);
return (0); /* No need to install a connected route. */
}
@@ -303,7 +303,7 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct in6_addr *ifid)
in6_purgeaddr(&ia6->ia_ifa);
return (error);
}
- dohooks(ifp->if_addrhooks, 0);
+ if_addrhooks_run(ifp);
return (0);
}
@@ -419,7 +419,7 @@ in6_ifdetach(struct ifnet *ifp)
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
in6_purgeaddr(ifa);
- dohooks(ifp->if_addrhooks, 0);
+ if_addrhooks_run(ifp);
}
/*