To: None <gnats-bugs@gnats.netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: netbsd-bugs
Date: 03/21/1997 21:07:31
>Number: 3377
>Category: kern
>Synopsis: [dM] <net/if.h> needs <sys/socket.h>
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people (Kernel Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Mar 21 18:20:02 1997
>Last-Modified:
>Originator: der Mouse
>Organization:
Dis-
>Release: 1.2_BETA (also present in -current)
>Environment:
Any (noticed on SPARCstation-2)
>Description:
<net/if.h> needs, but does not include, <sys/socket.h>. For
example, when writing bpf code based on the manpage, one finds
that including the five include files documented in the bpf
manpage (four for bpf plus one more for BIOC[GS]ETIF) does not
produce working code.
>How-To-Repeat:
% cat > z.c
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <net/bpf.h>
#include <net/if.h>
<EOT>
% cc -c z.c
In file included from z.c:5:
/usr/include/net/if.h:127: warning: `struct sockaddr' declared inside parameter list
/usr/include/net/if.h:127: warning: its scope is only this definition or declaration,
/usr/include/net/if.h:127: warning: which is probably not what you want.
/usr/include/net/if.h:280: field `ifru_addr' has incomplete type
/usr/include/net/if.h:281: field `ifru_dstaddr' has incomplete type
/usr/include/net/if.h:282: field `ifru_broadaddr' has incomplete type
/usr/include/net/if.h:299: field `ifra_addr' has incomplete type
/usr/include/net/if.h:300: field `ifra_dstaddr' has incomplete type
/usr/include/net/if.h:302: field `ifra_mask' has incomplete type
In file included from /usr/include/net/if.h:321,
from z.c:5:
/usr/include/net/if_arp.h:78: field `arp_pa' has incomplete type
/usr/include/net/if_arp.h:79: field `arp_ha' has incomplete type
%
>Fix:
--- OLD/sys/net/if.h Thu Jan 1 00:00:00 1970
+++ NEW/sys/net/if.h Thu Jan 1 00:00:00 1970
@@ -36,6 +36,7 @@
*/
#include <sys/queue.h>
+#include <sys/socket.h>
/*
* Structures defining a network interface, providing a packet
der Mouse
mouse@rodents.montreal.qc.ca
7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
>Audit-Trail:
>Unformatted: