Summary: | [patch] cap_getaddrinfo() doesn't work | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | mp39590 | ||||
Component: | kern | Assignee: | Mariusz Zaborski <oshogbo> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | emaste, junovitch, oshogbo | ||||
Priority: | --- | Keywords: | patch | ||||
Version: | CURRENT | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Feedback timeout is appropriate when a question to the submitter goes unanswered. You are the submitter here. It's likely nobody with the familiarity has had the time to look at this PR and address it. I didn't notice this PR. I will take it. A commit references this bug: Author: oshogbo Date: Thu Apr 14 18:27:10 UTC 2016 New revision: 297982 URL: https://svnweb.freebsd.org/changeset/base/297982 Log: Set NULL to the ai_next pointer which fix cap_getaddrinfo(). Add regression test case. PR: 195551 Submitted by: Mikhail <mp39590@gmail.com> Approved by: pjd (mentor) Changes: head/lib/libcasper/services/cap_dns/cap_dns.c head/tools/regression/capsicum/libcasper/dns.c |
Created attachment 150064 [details] patch cap_getaddrinfo() from casper daemon doesn't work and returns error about badly formatted hints structure. There are following errors: 1. When passing hints structure to native getaddrinfo() ai_next member wasn't set to NULL, and because of it getaddrinfo() failed, since it requires everything to be set to 0 or NULL. From the man page: "All other elements of the addrinfo structure passed via hints must be zero or the null pointer." 2. nvlist_add_string was trying to add ai->ai_canonname field from getaddrinfo() response, but it could be NULL and nvlist was going into 'error 22' state after this. I've also added test cases for cap_getaddrinfo() for regression tests.