assimilation / assimilation-official

This is the official main repository for the Assimilation project
51 stars 9 forks source link

fix: clientlib: don't limit getaddrinfo to dgram #32

Closed dmuhamedagic closed 7 years ago

dmuhamedagic commented 7 years ago

Let getaddrinfo find any net address. gettaddrinfo(3) says:

   ai_socktype This field specifies the preferred socket type, for example
               SOCK_STREAM  or  SOCK_DGRAM.   Specifying  0  in this field
               indicates that socket addresses of any type can be returned
               by getaddrinfo().
Alan-R commented 7 years ago

I'm happy to include this patch. Did you observe something failing because of it?

I don't find a contributor agreement for you yet. Could you kindly provide it? I'll send you the link.

This particular patch is so simple, that I don't think there's any intellectual property issue regarding it, but I'd love to be able to take more from you.

dmuhamedagic commented 7 years ago

On Sun, Sep 24, 2017 at 10:34:08PM +0000, Alan Robertson wrote:

I'm happy to include this patch. Did you observe something failing because of it?

Yes, the tests regarding the name resolution behaved differently on Debian stretch compared to jessie:

tests/cclass_wrappers_test.py::TestpyNetAddr::test_ipv6_strinit ** (process:111): DEBUG: netaddr_dns_new.1045: Could not resolve 0 - reason: Servname not supported for ai_socktype
** (process:111): DEBUG: netaddr_dns_new.1045: Could not resolve - reason: Servname not supported for ai_socktype
** (process:111): DEBUG: netaddr_dns_new.1045: Could not resolve [0 - reason: Servname not supported for ai_socktype
** (process:111): DEBUG: netaddr_dns_new.1045: Could not resolve [0 - reason: Servname not supported for ai_socktype
** (process:111): DEBUG: netaddr_dns_new.1045: Could not resolve 0 - reason: Servname not supported for ai_socktype
** (process:111): DEBUG: netaddr_dns_new.1045: Could not resolve [0 - reason: Servname not supported for ai_socktype
** (process:111): DEBUG: netaddr_dns_new.1045: Could not resolve ffff - reason: Servname not supported for ai_socktype
** (process:111): DEBUG: netaddr_dns_new.1045: Could not resolve ffff - reason: Servname not supported for ai_socktype
** (process:111): DEBUG: netaddr_dns_new.1045: Could not resolve [ffff - reason: Servname not supported for ai_socktype
** (process:111): DEBUG: netaddr_dns_new.1045: Could not resolve [ffff - reason: Servname not supported for ai_socktype
PASSED
tests/cclass_wrappers_test.py::TestpyNetAddr::test_dns_strinit ** (process:111): DEBUG: netaddr_dns_new.1045: Could not resolve www.linux-ha.org - reason: Servname not supported for ai_socktype
** (process:111): DEBUG: netaddr_dns_new.1045: Could not resolve www.linux-ha.org - reason: Servname not supported for ai_socktype
FAILEDSegmentation fault

There was also a segfault, which needs to be examined separately.