Lines Matching defs:new
225 * Copy IPsec policy from old INPCB into new.
226 * It is expected that new INPCB has not configured policies.
229 ipsec_copy_pcbpolicy(struct inpcb *old, struct inpcb *new)
241 IPSEC_ASSERT(new->inp_sp != NULL, ("new inp_sp is NULL"));
242 IPSEC_ASSERT((new->inp_sp->flags & (
244 ("new PCB already has configured policies"));
245 INP_WLOCK_ASSERT(new);
252 ipsec_setspidx_inpcb(new, &sp->spidx, IPSEC_DIR_INBOUND);
253 if (new->inp_sp->sp_in != NULL)
254 key_freesp(&new->inp_sp->sp_in);
255 new->inp_sp->sp_in = sp;
256 new->inp_sp->flags |= INP_INBOUND_POLICY;
262 ipsec_setspidx_inpcb(new, &sp->spidx, IPSEC_DIR_OUTBOUND);
263 if (new->inp_sp->sp_out != NULL)
264 key_freesp(&new->inp_sp->sp_out);
265 new->inp_sp->sp_out = sp;
266 new->inp_sp->flags |= INP_OUTBOUND_POLICY;
301 /* Allocate new SP entry. */
343 /* Clear old SP and set new SP. */
348 printf("%s: new SP(%p)\n", __func__, newsp));