#3013 resolv_is_address failure in getaddrinfo on FreeBSD 10.3
Closed: wontfix by pbrezina. Opened by rootwyrm.

Issue is specific to the getaddrinfo call at resolv_is_address in src/resolv/async_resolv.c
Appears to be a failure to pass a correct value to the name argument at multiple points specifically relating to IPv6.

(Mon May 16 13:55:26 2016) [sssd[be[rootwyrm.net]]] [sdap_sudo_get_ip_addresses] (0x2000): Found IP address: 192.168.0.100 in network 192.168.0.0/23
(Mon May 16 13:55:26 2016) [sssd[be[rootwyrm.net]]] [sdap_sudo_get_ip_addresses] (0x2000): Found IP address: fe80::20c:29ff:fefb:3e26 in network fe80::/64
(Mon May 16 13:55:26 2016) [sssd[be[rootwyrm.net]]] [sdap_sudo_get_ip_addresses] (0x2000): Found IP address: AAAA:BBBB:CCCC:DDDD:4130::100 in network 2001:470:1f11:b72::/64
(Mon May 16 13:55:26 2016) [sssd[be[rootwyrm.net]]] [sdap_sudo_get_ip_addresses] (0x2000): Found IP address: fe80::1 in network fe80::/64
(Mon May 16 13:55:26 2016) [sssd[be[rootwyrm.net]]] [sdap_sudo_get_hostnames_send] (0x2000): Found hostname: testbox
(Mon May 16 13:55:26 2016) [sssd[be[rootwyrm.net]]] [resolv_is_address] (0x0040): getaddrinfo failed [8]: hostname nor servname provided, or not known
(Mon May 16 13:55:26 2016) [sssd[be[rootwyrm.net]]] [resolv_gethostbyname_step] (0x2000): Querying files
(Mon May 16 13:55:26 2016) [sssd[be[rootwyrm.net]]] [resolv_gethostbyname_files_send] (0x0100): Trying to resolve A record of 'testbox' in files
...
(Mon May 16 13:55:26 2016) [sssd[be[rootwyrm.net]]] [get_server_status] (0x1000): Status of server 'taurus.rootwyrm.net' is 'name not resolved'
(Mon May 16 13:55:26 2016) [sssd[be[rootwyrm.net]]] [resolv_is_address] (0x0040): getaddrinfo failed [8]: hostname nor servname provided, or not known
(Mon May 16 13:55:26 2016) [sssd[be[rootwyrm.net]]] [resolv_gethostbyname_step] (0x2000): Querying files
(Mon May 16 13:55:26 2016) [sssd[be[rootwyrm.net]]] [resolv_gethostbyname_files_send] (0x0100): Trying to resolve A record of 'taurus.rootwyrm.net' in files
(Mon May 16 13:55:26 2016) [sssd[be[rootwyrm.net]]] [set_server_common_status] (0x0100): Marking server 'taurus.rootwyrm.net' as 'resolving name'
...
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [ipa_dyndns_update_send] (0x0400): Performing update
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [sdap_id_op_connect_step] (0x4000): reusing cached connection
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [sdap_id_op_destroy] (0x4000): releasing operation connection
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [resolv_is_address] (0x0040): getaddrinfo failed [8]: hostname nor servname provided, or not known
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [resolv_gethostbyname_step] (0x2000): Querying DNS
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [resolv_gethostbyname_dns_query] (0x0100): Trying to resolve A record of 'testbox.rootwyrm.net' in DNS
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [schedule_request_timeout] (0x2000): Scheduling a timeout of 6 seconds
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [schedule_timeout_watcher] (0x2000): Scheduling DNS timeout watcher
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [unschedule_timeout_watcher] (0x4000): Unscheduling DNS timeout watcher
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [resolv_gethostbyname_dns_parse] (0x1000): Parsing an A reply
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [request_watch_destructor] (0x0400): Deleting request watch
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [resolv_is_address] (0x0040): getaddrinfo failed [8]: hostname nor servname provided, or not known
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [resolv_gethostbyname_step] (0x2000): Querying DNS
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [resolv_gethostbyname_dns_query] (0x0100): Trying to resolve AAAA record of 'testbox.rootwyrm.net' in DNS
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [schedule_request_timeout] (0x2000): Scheduling a timeout of 6 seconds
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [schedule_timeout_watcher] (0x2000): Scheduling DNS timeout watcher
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [unschedule_timeout_watcher] (0x4000): Unscheduling DNS timeout watcher
...

As an additional side-effect, Dynamic DNS updates fail as well. The message produced is incorrect and does not have correct IPv6 contents:

(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [be_nsupdate_create_fwd_msg] (0x0400):  -- Begin nsupdate message --
realm ROOTWYRM.NET
zone rootwyrm.net.
update delete testbox.rootwyrm.net. in A
send
update delete testbox.rootwyrm.net. in AAAA
send
update add testbox.rootwyrm.net. 1200 in A 192.168.0.100
send
(Mon May 16 13:55:28 2016) [sssd[be[rootwyrm.net]]] [be_nsupdate_create_fwd_msg] (0x0400):  -- End nsupdate message --

I don't think the getaddrinfo failure is related. And I find it a bit counter-intuitive, because with AI_NUMERICHOST, I wouldn't expect getaddrinfo to care about the hostname at all. Nonetheless, it's unrelated, because the function that calls getaddrinfo just returns 'this is not a hostname' and carries on.

About the v6 address, by default, we only update the address used to connect to the server. As the manpage states:

dyndns_update (boolean)
           Optional. This option tells SSSD to automatically update the DNS server built into FreeIPA v2 with the IP address of this client. The update is secured using GSS-TSIG. The IP address of the IPA
           LDAP connection is used for the updates, if it is not otherwise specified by using the dyndns_iface option.

Would setting the dyndns_iface option help here?

As I said earlier, the getaddrinfo issue is unrelated. If you want to have all addresses propagated to IPA and not the one from the LDAP socket, use dyndns_iface.

milestone: NEEDS_TRIAGE => SSSD Deferred

Fields changed

rhbz: => 0

Metadata Update from @rootwyrm:
- Issue set to the milestone: SSSD Patches welcome

Thank you for taking time to submit this request for SSSD. Unfortunately this issue was not given priority and the team lacks the capacity to work on it at this time.

Given that we are unable to fulfill this request I am closing the issue as wontfix.

If the issue still persist on recent SSSD you can request re-consideration of this decision by reopening this issue. Please provide additional technical details about its importance to you.

Thank you for understanding.

Metadata Update from @pbrezina:
- Issue close_status updated to: wontfix
- Issue status updated to: Closed (was: Open)

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/4054

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata