[Bug 195552] New: [patch] AF_UNSPEC handling in casper DNS limits

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Dec 1 11:54:51 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195552

            Bug ID: 195552
           Summary: [patch] AF_UNSPEC handling in casper DNS limits
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: mp39590 at gmail.com

Created attachment 150065
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=150065&action=edit
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list