| 213 | } |
| 214 | |
| 215 | static int |
| 216 | encap_unregister_srcaddr(struct srcaddrtab_head *head, |
| 217 | const struct srcaddrtab *cookie) |
| 218 | { |
| 219 | struct srcaddrtab *p; |
| 220 | |
| 221 | SRCADDR_WLOCK(); |
| 222 | CK_LIST_FOREACH(p, head, chain) { |
| 223 | if (p == cookie) { |
| 224 | CK_LIST_REMOVE(p, chain); |
| 225 | SRCADDR_WUNLOCK(); |
| 226 | SRCADDR_WAIT(); |
| 227 | free(p, M_NETADDR); |
| 228 | return (0); |
| 229 | } |
| 230 | } |
| 231 | SRCADDR_WUNLOCK(); |
| 232 | return (EINVAL); |
| 233 | } |
| 234 | |
| 235 | static struct encaptab * |
| 236 | encap_attach(struct encaptab_head *head, const struct encap_config *cfg, |
no test coverage detected