| 270 | } |
| 271 | |
| 272 | static int |
| 273 | encap_detach(struct encaptab_head *head, const struct encaptab *cookie) |
| 274 | { |
| 275 | struct encaptab *ep; |
| 276 | |
| 277 | ENCAP_WLOCK(); |
| 278 | CK_LIST_FOREACH(ep, head, chain) { |
| 279 | if (ep == cookie) { |
| 280 | CK_LIST_REMOVE(ep, chain); |
| 281 | ENCAP_WUNLOCK(); |
| 282 | ENCAP_WAIT(); |
| 283 | free(ep, M_NETADDR); |
| 284 | return (0); |
| 285 | } |
| 286 | } |
| 287 | ENCAP_WUNLOCK(); |
| 288 | return (EINVAL); |
| 289 | } |
| 290 | |
| 291 | static int |
| 292 | encap_input(struct encaptab_head *head, struct mbuf *m, int off, int proto) |
no test coverage detected