summaryrefslogtreecommitdiff
path: root/sys/netinet/in.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/netinet/in.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/netinet/in.c')
-rw-r--r--sys/netinet/in.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index a9a56e2b325..50e922c95a6 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in.c,v 1.165 2019/11/07 13:25:44 bluhm Exp $ */
+/* $OpenBSD: in.c,v 1.166 2019/11/08 07:16:29 dlg Exp $ */
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
/*
@@ -390,7 +390,7 @@ in_ioctl_set_ifaddr(u_long cmd, caddr_t data, struct ifnet *ifp,
in_ifscrub(ifp, ia);
error = in_ifinit(ifp, ia, sin, newifaddr);
if (!error)
- dohooks(ifp->if_addrhooks, 0);
+ if_addrhooks_run(ifp);
NET_UNLOCK();
return error;
@@ -503,7 +503,7 @@ in_ioctl_change_ifaddr(u_long cmd, caddr_t data, struct ifnet *ifp,
if (error)
break;
}
- dohooks(ifp->if_addrhooks, 0);
+ if_addrhooks_run(ifp);
break;
}
case SIOCDIFADDR:
@@ -523,7 +523,7 @@ in_ioctl_change_ifaddr(u_long cmd, caddr_t data, struct ifnet *ifp,
* the scrub but before the other steps?
*/
in_purgeaddr(&ia->ia_ifa);
- dohooks(ifp->if_addrhooks, 0);
+ if_addrhooks_run(ifp);
break;
default:
@@ -946,7 +946,7 @@ in_ifdetach(struct ifnet *ifp)
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
in_purgeaddr(ifa);
- dohooks(ifp->if_addrhooks, 0);
+ if_addrhooks_run(ifp);
}
if (ifp->if_xflags & IFXF_AUTOCONF4)