| 308 | } |
| 309 | |
| 310 | static void |
| 311 | ipsec_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 | |
| 331 | static void |
| 332 | ipsec_cachepolicy(struct inpcb *inp, struct secpolicy *sp, u_int dir) |
no test coverage detected