From sa@pal.svznov.kemerovo.su Tue Nov 30 19:27:32 1999
Return-Path: <sa@pal.svznov.kemerovo.su>
Received: from pal.svznov.kemerovo.su (pal.svznov.kemerovo.su [193.125.140.95])
	by hub.freebsd.org (Postfix) with ESMTP id 7309914E06
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 30 Nov 1999 19:27:23 -0800 (PST)
	(envelope-from sa@pal.svznov.kemerovo.su)
Received: (from root@localhost)
	by pal.svznov.kemerovo.su (8.9.3/8.9.3) id KAA06182;
	Wed, 1 Dec 1999 10:28:10 +0700 (KRAT)
	(envelope-from sa)
Message-Id: <199912010328.KAA06182@pal.svznov.kemerovo.su>
Date: Wed, 1 Dec 1999 10:28:10 +0700 (KRAT)
From: root@pal.svznov.kemerovo.su
Sender: sa@pal.svznov.kemerovo.su
Reply-To: eugen@svzserv.kemerovo.su
To: FreeBSD-gnats-submit@freebsd.org
Subject: Bug in /usr/include/netinet/in.h with u_int32_t
X-Send-Pr-Version: 3.2

>Number:         15197
>Category:       i386
>Synopsis:       Bug in /usr/include/netinet/in.h with u_int32_t
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 30 19:30:01 PST 1999
>Closed-Date:    Wed Dec 1 05:42:26 PST 1999
>Last-Modified:  Wed Dec  1 05:43:07 PST 1999
>Originator:     Eugene Grosbein
>Release:        FreeBSD 3.3-STABLE i386,  cvsup'd at 1 Dec 1999
>Organization:
SvzServ Co.
>Environment:
Fresh installation of FreeBSD 3.3-RELEASE, 
                 cvsup'd to -STABLE; gcc 2.7.2.3.
>Description:

There is a definition in /usr/include/netinet/in.h,
$FreeBSD: src/sys/netinet/in.h,v 1.38.2.3 1999/08/29 16:29:34 peter Exp $,
line 223:

struct in_addr {
	u_int32_t s_addr;
};

<netinet/in.h> does not define u_int32_t. It does not include <sys/types.h>
or something else that defines u_int32_t. Therefore, if a C-program
includes <netinet/in.h> and <sys/types.h> AFTER, it fails to compile.
I discovered it compiling Perl module TacacsPlus-0.16 fetched from CPAN.

>How-To-Repeat:

Download http://www.perl.com/CPAN-local/authors/id/MSHOYHER/TacacsPlus-0.16.tar.gz
tar xfvz TacacsPlus-0.16.tar.gz
perl Makefile.PL
make
   
Here you will have parse error in /usr/include/netinet/in.h
 
>Fix:
Here is a patch:

--- in.h.orig	Wed Dec  1 10:25:23 1999
+++ in.h	Wed Dec  1 10:25:47 1999
@@ -36,7 +36,7 @@
 
 #ifndef _NETINET_IN_H_
 #define _NETINET_IN_H_
-
+#include <sys/types.h>
 /*
  * Constants and structures defined by the internet system,
  * Per RFC 790, September 1981, and numerous additions.
 

>Release-Note:
>Audit-Trail:

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: eugen@svzserv.kemerovo.su
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: i386/15197: Bug in /usr/include/netinet/in.h with u_int32_t 
Date: Wed, 01 Dec 1999 14:33:59 +0200

 On Wed, 01 Dec 1999 10:28:10 +0700, root@pal.svznov.kemerovo.su wrote:
 
 > <netinet/in.h> does not define u_int32_t. It does not include <sys/types.h>
 > or something else that defines u_int32_t. Therefore, if a C-program
 > includes <netinet/in.h> and <sys/types.h> AFTER, it fails to compile.
 
 You're right.  That's why you _always_ include <sys/*> before the rest
 of your headers.  This is standard practice.
 
 If you find any FreeBSD manual pages in which the SYNOPSIS shows the
 inclusion of <sys/*> _after_ the inclusion of other headers, please
 report such documentation bugs in a new PR.
 
 You should contact the maintainers of the code that's breaking for you
 and get them to order their inclusions correctly.
 
 I'd close your problem report, but can't access the database at the
 moment.  Hopefully someone else will do the honours.
 
 Ciao,
 Sheldon.
 
State-Changed-From-To: open->closed 
State-Changed-By: sheldonh 
State-Changed-When: Wed Dec 1 05:42:26 PST 1999 
State-Changed-Why:  
Bug in 3rd-party source, see follow-up for details. 
>Unformatted:
