Summary: | [patch] fix AF_UNSPEC handling in casper DNS limits | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | mp39590 | ||||
Component: | kern | Assignee: | Mariusz Zaborski <oshogbo> | ||||
Status: | Open --- | ||||||
Severity: | Affects Some People | CC: | emaste, oshogbo | ||||
Priority: | --- | Keywords: | patch | ||||
Version: | CURRENT | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
I didn't notice this PR. I will take it. |
Created attachment 150065 [details] patch Currently, if we set AF_UNSPEC as a limit for DNS service in casper it won't allow us to issue any requests. Code responsible for this check looks like this: @ static bool @ dns_allowed_family(const nvlist_t *limits, int family) @ { @ [...] @ while ((name = nvlist_next(limits, NULL, &cookie)) != NULL) { @ if (strncmp(name, "family", sizeof("family") - 1) != 0) @ continue; @ nofamilies = false; @ if (family == AF_UNSPEC) @ continue; @ if (nvlist_get_number(limits, name) == (uint64_t)family) @ return (true); @ } @ [...] @ if (nofamilies) @ return (true); @ @ return (false); @ } Attached patch changes this behavior to following one: if limit nvlist contain AF_UNSPEC any family is allowed.