* Create a new set that is a subset of a parent. */
| 606 | * Create a new set that is a subset of a parent. |
| 607 | */ |
| 608 | static struct domainset * |
| 609 | domainset_shadow(const struct domainset *pdomain, |
| 610 | const struct domainset *domain, struct domainlist *freelist) |
| 611 | { |
| 612 | struct domainset *ndomain; |
| 613 | |
| 614 | ndomain = LIST_FIRST(freelist); |
| 615 | LIST_REMOVE(ndomain, ds_link); |
| 616 | |
| 617 | /* |
| 618 | * Initialize the key from the request. |
| 619 | */ |
| 620 | domainset_copy(domain, ndomain); |
| 621 | |
| 622 | /* |
| 623 | * Restrict the key by the parent. |
| 624 | */ |
| 625 | DOMAINSET_AND(&ndomain->ds_mask, &pdomain->ds_mask); |
| 626 | |
| 627 | return _domainset_create(ndomain, freelist); |
| 628 | } |
| 629 | |
| 630 | /* |
| 631 | * Recursively check for errors that would occur from applying mask to |
no test coverage detected