Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#3945 closed bug (fixed)

getaddrinfo() issue

Reported by: kaliber Owned by: anevilyak
Priority: normal Milestone: R1
Component: Kits/Network Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking: #6200
Has a Patch: no Platform: All

Description

Samba daamon (smbd) doesn't work because of broken getaddrinfo(). The function return an error if a hint AI_GETADDRINFO is passed. I've made investigation and realized that AI_MASK in netdb.h is incorrect.

Please look at: http://dev.haiku-os.org/browser/haiku/trunk/src/kits/network/dns/irs/getaddrinfo.c#L336 and http://dev.haiku-os.org/browser/haiku/trunk/headers/posix/netdb.h#L206

In my opinion AI_MASK should be defined as follow:

#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_ADDRCONFIG)

Change History (9)

comment:1 Changed 10 years ago by v

Do you have a link to the offending line in smbd?

comment:2 Changed 10 years ago by kaliber

First of all it should be AI_ADDRCONFIG instead of AI_GETADDRINFO.

V, search in samba sources for AI_ADDRCONFIG. I can't remember the correct place.

comment:3 Changed 10 years ago by v

One place it can be found is in source3/libsmb/namequery.c, but there are more.

getaddrinfo() in the Haiku source already checks for the presence of AI_ADDRCONFIG, so perhaps adding AI_ADDRCONFIG to the AI_MASK definition is enough for the mentioned samba issue.

BTW, this getaddrinfo spec suggests a few more flags: AI_NUMERICSERV, AI_V4MAPPED and AI_ALL

comment:4 Changed 9 years ago by anevilyak

Blocking: 6200 added

(In #6200) Didn't see that one, thanks.

comment:5 Changed 9 years ago by anevilyak

Owner: changed from axeld to anevilyak
Status: newin-progress
Version: R1/pre-alpha1R1/Development

Can you check with hrev37266?

comment:6 Changed 9 years ago by kaliber

Smbd works now. Thanks!

comment:7 Changed 9 years ago by anevilyak

Resolution: fixed
Status: in-progressclosed

comment:8 Changed 9 years ago by stippi

Nice - just thinking that some optional packages might be broken now without a recompile?

comment:9 Changed 9 years ago by axeld

Just for completeness: our libbind comes straight from the latest ISC version. But since I manually updated the headers, I must have missed the changes made to netdb.h - I also completely missed this ticket, sorry!

Note: See TracTickets for help on using tickets.