Our resolv.h already includes a bunch of headers listed in resolver(3) man page. Make the list complete by adding netinet/in.h for sockaddr_in. This should reduce patching required when porting code written with Linux or NetBSD in mind. reinstating kern/85741 How-To-Repeat: $ cat a.c #include <resolv.h> int main() { return 0; } $ cc a.c In file included from a.c:1: /usr/include/resolv.h:157:14: error: array has incomplete element type 'struct sockaddr_in' nsaddr_list[MAXNS]; /*%< address of name server */ ^ /usr/include/resolv.h:156:9: note: forward declaration of 'struct sockaddr_in' struct sockaddr_in ^ /usr/include/resolv.h:171:18: error: field has incomplete type 'struct in_addr' struct in_addr addr; ^ /usr/include/resolv.h:171:10: note: forward declaration of 'struct in_addr' struct in_addr addr; ^ /usr/include/resolv.h:195:21: error: field has incomplete type 'struct sockaddr_in' struct sockaddr_in sin; ^ /usr/include/resolv.h:156:9: note: forward declaration of 'struct sockaddr_in' struct sockaddr_in ^ 3 errors generated.
Hi, I am trying to build Asterisk 15.1.3 on 12.0-CURRENT (r326622) and the configure script fails with this error while checking for resolv.h. Applying Jan's patch resolves the issue. Why hasn't this been committed yet? Thanks. -- Herbert
NetBSD did exactly this in revision 1.40 date: 2012-11-07 16:45:24 +0100; author: christos; state: Exp; lines: +2 -1; add <netinet/in.h> because it is needed for sockaddr_in.
Reset status (cant be in progress without 'real' assignee). CC askterisk maintainer
I have no objection. I have not seen the reported failure in the asterisk ports, but I have never tested the specific version reported here. Present versions of the asterisk ports (13 and 15) work fine and I don't see this impacting them.
Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>
I'm running into this error trying to build sssd 2.8.2.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=58cf91d3b72a01777bacf72d66a648a744ae3143 commit 58cf91d3b72a01777bacf72d66a648a744ae3143 Author: Jan Beich <jbeich@FreeBSD.org> AuthorDate: 2024-01-08 11:52:08 +0000 Commit: Yoshihiro Takahashi <nyan@FreeBSD.org> CommitDate: 2024-01-08 11:52:08 +0000 resolv: Add a required include to resolv.h Add a required include to resolv.h for sockaddr_in. This should reduce patching required when porting code written with Linux or NetBSD in mind. PR: 182466 MFC after: 1 week include/resolv.h | 1 + lib/libc/net/resolver.3 | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=5a70219b209f4ba8e8244d3886d364da4c00e4df commit 5a70219b209f4ba8e8244d3886d364da4c00e4df Author: Jan Beich <jbeich@FreeBSD.org> AuthorDate: 2024-01-08 11:52:08 +0000 Commit: Yoshihiro Takahashi <nyan@FreeBSD.org> CommitDate: 2024-01-15 10:33:59 +0000 resolv: Add a required include to resolv.h Add a required include to resolv.h for sockaddr_in. This should reduce patching required when porting code written with Linux or NetBSD in mind. PR: 182466 MFC after: 1 week (cherry picked from commit 58cf91d3b72a01777bacf72d66a648a744ae3143) include/resolv.h | 1 + lib/libc/net/resolver.3 | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=4487c6281b6a9347731a06aafada7be57aa2fe19 commit 4487c6281b6a9347731a06aafada7be57aa2fe19 Author: Jan Beich <jbeich@FreeBSD.org> AuthorDate: 2024-01-08 11:52:08 +0000 Commit: Yoshihiro Takahashi <nyan@FreeBSD.org> CommitDate: 2024-01-15 10:35:35 +0000 resolv: Add a required include to resolv.h Add a required include to resolv.h for sockaddr_in. This should reduce patching required when porting code written with Linux or NetBSD in mind. PR: 182466 MFC after: 1 week (cherry picked from commit 58cf91d3b72a01777bacf72d66a648a744ae3143) include/resolv.h | 1 + lib/libc/net/resolver.3 | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-)