Index: bpf.c =================================================================== RCS file: /room/netbsd/src/dist/dhcp/common/bpf.c,v retrieving revision 1.8 retrieving revision 1.9 diff -c -r1.8 -r1.9 *** bpf.c 22 Oct 2004 05:22:39 -0000 1.8 --- bpf.c 1 Dec 2004 23:45:12 -0000 1.9 *************** *** 47,53 **** #ifndef lint static char copyright[] = ! "$Id: bpf.c,v 1.8 2004/10/22 05:22:39 perry Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" --- 47,53 ---- #ifndef lint static char copyright[] = ! "$Id: bpf.c,v 1.9 2004/12/01 23:45:12 christos Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" *************** *** 66,71 **** --- 66,72 ---- # endif # endif + #include #include #include "includes/netinet/ip.h" #include "includes/netinet/udp.h" *************** *** 98,108 **** struct interface_info *info; { int sock; - char filename[50]; - int b; u_int bufsize; /* Open a BPF device */ for (b = 0; 1; b++) { #ifndef NO_SNPRINTF snprintf(filename, sizeof(filename), BPF_FORMAT, b); --- 99,119 ---- struct interface_info *info; { int sock; u_int bufsize; /* Open a BPF device */ + #ifdef _PATH_BPF + const char *filename = _PATH_BPF; + sock = open (filename, O_RDWR, 0); + if (sock < 0) + log_fatal ("No bpf devices.%s%s%s", + " Please read the README", + " section for your operating", + " system."); + + #else + char filename[50]; + int b; for (b = 0; 1; b++) { #ifndef NO_SNPRINTF snprintf(filename, sizeof(filename), BPF_FORMAT, b); *************** *** 125,130 **** --- 136,142 ---- break; } } + #endif /* Set the BPF buffer size to 32k */ bufsize = 32768;