MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ipsec_invalidate_cache

Function ipsec_invalidate_cache

freebsd/netipsec/ipsec.c:310–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310static void
311ipsec_invalidate_cache(struct inpcb *inp, u_int dir)
312{
313 struct secpolicy *sp;
314
315 INP_WLOCK_ASSERT(inp);
316 if (dir == IPSEC_DIR_OUTBOUND) {
317 if (inp->inp_sp->flags & INP_INBOUND_POLICY)
318 return;
319 sp = inp->inp_sp->sp_in;
320 inp->inp_sp->sp_in = NULL;
321 } else {
322 if (inp->inp_sp->flags & INP_OUTBOUND_POLICY)
323 return;
324 sp = inp->inp_sp->sp_out;
325 inp->inp_sp->sp_out = NULL;
326 }
327 if (sp != NULL)
328 key_freesp(&sp); /* release extra reference */
329}
330
331static void
332ipsec_cachepolicy(struct inpcb *inp, struct secpolicy *sp, u_int dir)

Callers 2

ipsec_cachepolicyFunction · 0.85
ipsec_getpcbpolicyFunction · 0.85

Calls 1

key_freespFunction · 0.85

Tested by

no test coverage detected