From nobody@FreeBSD.org  Thu Oct 18 07:53:42 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 710DC37B407
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 18 Oct 2001 07:53:42 -0700 (PDT)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id f9IErgN15492;
	Thu, 18 Oct 2001 07:53:42 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200110181453.f9IErgN15492@freefall.freebsd.org>
Date: Thu, 18 Oct 2001 07:53:42 -0700 (PDT)
From: KUROSAWA Takahiro <fwkg7679@mb.infoweb.ne.jp>
To: freebsd-gnats-submit@FreeBSD.org
Subject: "typedef" seems dropped around pfil_head_t in sys/net/pfil.h (maybe typo).
X-Send-Pr-Version: www-1.0

>Number:         31356
>Category:       kern
>Synopsis:       "typedef" seems dropped around pfil_head_t in sys/net/pfil.h (maybe typo).
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 18 08:00:01 PDT 2001
>Closed-Date:    Mon Oct 22 01:46:41 PDT 2001
>Last-Modified:  Mon Oct 22 01:47:25 PDT 2001
>Originator:     KUROSAWA Takahiro
>Release:        5.0-CURRENT
>Organization:
>Environment:
FreeBSD amdk6 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Thu Oct 18 19:36:13 JST 2001     kurosawa@amdk6:/home/kurosawa/compile/em6/sys/i386/compile/AMDK7EM6  i386
>Description:
pfil_head_t seems to be a typedef'd type according to its name, 
but is actually declared as a variable in sys/net/pfil.h.

"typedef" seems dropped before "struct":
(from sys/net/pfil.h)
struct pfil_head {  
        pfil_list_t     ph_in;
        pfil_list_t     ph_out;
        int             ph_init;
} pfil_head_t;

>How-To-Repeat:
Compile and link these two files (a.c and b.c) with c++ compiler:
  c++ a.c b.c

This results in:
/tmp/cc5njlvK.o(.data+0x0): multiple definition of `pfil_head_t'
/tmp/ccaxafCz.o(.data+0x0): first defined here

a.c:
#include <sys/types.h>
#include <net/pfil.h>
int main(void) { return 0; }

b.c:
#include <sys/types.h>
#include <net/pfil.h>

>Fix:
Append "typedef" before "struct" at line 57 in sys/net/pfil.h (rev. 1.6).
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Mon Oct 22 01:46:41 PDT 2001 
State-Changed-Why:  
Fixed by removing "pfil_head_t" completely. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31356 
>Unformatted:
