-/* $OpenBSD: in.c,v 1.178 2022/11/19 14:26:40 kn Exp $ */
+/* $OpenBSD: in.c,v 1.179 2022/12/06 22:19:39 mvs Exp $ */
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
/*
*/
memset(&ifr, 0, sizeof(ifr));
memcpy(&ifr.ifr_addr, &inm->inm_sin, sizeof(inm->inm_sin));
+ KERNEL_LOCK();
if ((*ifp->if_ioctl)(ifp, SIOCADDMULTI,(caddr_t)&ifr) != 0) {
+ KERNEL_UNLOCK();
free(inm, M_IPMADDR, sizeof(*inm));
return (NULL);
}
+ KERNEL_UNLOCK();
TAILQ_INSERT_HEAD(&ifp->if_maddrlist, &inm->inm_ifma,
ifma_list);
-/* $OpenBSD: in6.c,v 1.258 2022/12/02 12:56:51 kn Exp $ */
+/* $OpenBSD: in6.c,v 1.259 2022/12/06 22:19:39 mvs Exp $ */
/* $KAME: in6.c,v 1.372 2004/06/14 08:14:21 itojun Exp $ */
/*
* filter appropriately for the new address.
*/
memcpy(&ifr.ifr_addr, &in6m->in6m_sin, sizeof(in6m->in6m_sin));
+ KERNEL_LOCK();
*errorp = (*ifp->if_ioctl)(ifp, SIOCADDMULTI, (caddr_t)&ifr);
+ KERNEL_UNLOCK();
if (*errorp) {
free(in6m, M_IPMADDR, sizeof(*in6m));
return (NULL);