/*
- * Copyright (c) 2000-2016 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2018 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
/* Reinject packet into the system as incoming or outgoing */
if (!sin || sin->sin_addr.s_addr == 0) {
- struct ip_out_args ipoa =
- { IFSCOPE_NONE, { 0 }, IPOAF_SELECT_SRCIF, 0, SO_TC_UNSPEC,
- _NET_SERVICE_TYPE_UNSPEC };
+ struct ip_out_args ipoa;
struct route ro;
struct ip_moptions *imo;
+ bzero(&ipoa, sizeof(ipoa));
+ ipoa.ipoa_boundif = IFSCOPE_NONE;
+ ipoa.ipoa_flags = IPOAF_SELECT_SRCIF;
+ ipoa.ipoa_sotc = SO_TC_UNSPEC;
+ ipoa.ipoa_netsvctype = _NET_SERVICE_TYPE_UNSPEC;
+
/*
* Don't allow both user specified and setsockopt options,
* and don't allow packet length sizes that will crash
lck_rw_done(divcbinfo.ipi_lock);
return (0);
}
- lck_mtx_assert(mutex_held, LCK_MTX_ASSERT_OWNED);
+ LCK_MTX_ASSERT(mutex_held, LCK_MTX_ASSERT_OWNED);
so->unlock_lr[so->next_unlock_lr] = lr_saved;
so->next_unlock_lr = (so->next_unlock_lr+1) % SO_LCKDBG_MAX;
lck_mtx_unlock(mutex_held);
}
__private_extern__ lck_mtx_t *
-div_getlock(struct socket *so, __unused int locktype)
+div_getlock(struct socket *so, __unused int flags)
{
struct inpcb *inpcb = (struct inpcb *)so->so_pcb;
-
+
if (so->so_pcb) {
if (so->so_usecount < 0)
- panic("div_getlock: so=%p usecount=%x lrh= %s\n",
+ panic("div_getlock: so=%p usecount=%x lrh= %s\n",
so, so->so_usecount, solockhistory_nr(so));
return(&inpcb->inpcb_mtx);
} else {
- panic("div_getlock: so=%p NULL NO PCB lrh= %s\n",
+ panic("div_getlock: so=%p NULL NO PCB lrh= %s\n",
so, solockhistory_nr(so));
return (so->so_proto->pr_domain->dom_mtx);
}