Subject: kern/679: /usr/include/net/bpf.h doesn't protect itself
To: None <gnats-admin@NetBSD.ORG>
From: None <jhawk@MIT.EDU>
List: netbsd-bugs
Date: 01/02/1995 13:05:12
>Number:         679
>Category:       kern
>Synopsis:       /usr/include/net/bpf.h doesn't protect itself
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan  2 13:05:05 1995
>Originator:     John Hawkinson
>Organization:
MIT
>Release:        1.0
>Environment:
System: NetBSD lola-granola 1.0 NetBSD 1.0 (LOLA-DDB) #56: Sat Dec 17 13:51:12 EST 1994 fsf@lola-granola:/u1/usr/src/sys/arch/i386/compile/LOLA-DDB i386
This bug is present in today's -current.

>Description:

	<net/bpf.h> causes problems when it is included multiple times.
	libpcap (for tcpdump 3.0) does this.

>How-To-Repeat:

	#include <net/bpf.h>
	#include <net/bpf.h>   /* ;-) */

>Fix:

*** 1.1	1995/01/02 20:47:47
--- bpf.h	1995/01/02 21:04:32
***************
*** 1,4 ****
! /*	$NetBSD: bpf.h,v 1.6 1994/06/29 06:35:54 cgd Exp $	*/
  
  /*
   * Copyright (c) 1990, 1991, 1993
--- 1,4 ----
! /*	$Id: bpf.h,v 1.3 1995/01/02 21:04:32 jhawk Exp $	*/
  
  /*
   * Copyright (c) 1990, 1991, 1993
***************
*** 40,45 ****
--- 40,48 ----
   *	@(#)bpf.h	8.1 (Berkeley) 6/10/93
   */
  
+ #ifndef _BPF_H_
+ #define _BPF_H_
+ 
  /*
   * Alignment macros.  BPF_WORDALIGN rounds up to the next 
   * even multiple of BPF_ALIGNMENT. 
***************
*** 250,252 ****
--- 253,256 ----
   */
  #define BPF_MEMWORDS 16
  
+ #endif /* _BPF_H_ */

>Audit-Trail:
>Unformatted: