Delete PCB policy. */
| 166 | |
| 167 | /* Delete PCB policy. */ |
| 168 | int |
| 169 | ipsec_delete_pcbpolicy(struct inpcb *inp) |
| 170 | { |
| 171 | |
| 172 | if (inp->inp_sp == NULL) |
| 173 | return (0); |
| 174 | |
| 175 | if (inp->inp_sp->sp_in != NULL) |
| 176 | key_freesp(&inp->inp_sp->sp_in); |
| 177 | |
| 178 | if (inp->inp_sp->sp_out != NULL) |
| 179 | key_freesp(&inp->inp_sp->sp_out); |
| 180 | |
| 181 | free(inp->inp_sp, M_IPSEC_INPCB); |
| 182 | inp->inp_sp = NULL; |
| 183 | return (0); |
| 184 | } |
| 185 | |
| 186 | /* Deep-copy a policy in PCB. */ |
| 187 | static struct secpolicy * |
no test coverage detected