Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Feb 2002 04:21:26 -0500 (EST)
From:      Alan Eldridge <ports@geeksrus.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/35071: include/arpa/inet.h broken: must include <netinet/in.h>
Message-ID:  <200202180921.g1I9LQV02856@wwweasel.geeksrus.net>

next in thread | raw e-mail | index | archive | help

>Number:         35071
>Category:       bin
>Synopsis:       include/arpa/inet.h broken: must include <netinet/in.h>
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 18 01:30:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Alan Eldridge
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
Geeksrus.NET
>Environment:
System: FreeBSD wwweasel.geeksrus.net 4.5-STABLE FreeBSD 4.5-STABLE #0: Fri Feb 8 21:25:34 EST 2002 root@wwweasel.geeksrus.net:/usr/obj/usr/src/sys/WWWEASEL i386

>Description:

According to Single Unix Spec Version 2:

<quote>
DESCRIPTION

The <arpa/inet.h> header makes available the type in_port_t and the type in_addr_t as defined in the description of <netinet/in.h>. 

The <arpa/inet.h> header makes available the in_addr structure, as defined in the description of <netinet/in.h>. 

	:
	:
	:

 Inclusion of the <arpa/inet.h> header may also make visible all symbols from <netinet/in.h> and <inttypes.h>. 
</quote>

We fail on the second sentence. The third sentence allows us to simply
include <netinet/in.h> rather than requiring that we play type-defining-macro
games.

Note that software that compiles on other Unices fails on FreeBSD for this
reason. The wget package is about to become the newest casualty; it's CVS
version will not compile without patching on FBSD, so their next release of
1.8.2 won't either.

>How-To-Repeat:

[alane ~]$ cat t.c
#include <arpa/inet.h>
[alane ~]$ cc -c t.c
In file included from t.c:1:
/usr/include/arpa/inet.h:89: warning: parameter has incomplete type
/usr/include/arpa/inet.h:92: warning: parameter has incomplete type
/usr/include/arpa/inet.h:96: warning: parameter has incomplete type
[alane ~]$

>Fix:

---8<-snip---8<-snip---8<-snip---8<-snip---8<-snip---8<-snip---8<---
--- include/arpa/inet.h.orig	Sat Apr 21 10:53:03 2001
+++ include/arpa/inet.h	Mon Feb 18 04:10:23 2002
@@ -62,8 +62,7 @@
 
 #include <sys/types.h>
 #include <sys/cdefs.h>
-
-struct in_addr;
+#include <netinet/in.h>
 
 /* XXX all new diversions!! argh!! */
 #define	inet_addr	__inet_addr
---8<-snip---8<-snip---8<-snip---8<-snip---8<-snip---8<-snip---8<---



>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202180921.g1I9LQV02856>