Discussion:
new imported libpcap has net/bpf.h handling issue
Norikatsu Shigemura
2007-10-20 18:35:05 UTC
Permalink
I tried to install ports/net/pchar on 8-current machine. And
I got following compiling error message:-(.

c++ -O -fno-strict-aliasing -pipe -march=pentium3 -I. -DSIZEOF_BOOL=1 -DHAVE_SOCKLEN_T=1 -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SOCKADDR_SA_LEN=1 -DHAVE_HERROR=1 -DHAVE_SNPRINTF=1 -DHAVE_LIBM=1 -DHAVE_IPV6=1 -DHAVE_PCAP=1 -DHAVE_LIBPCAP=1 -DHAVE_BPF=1 -c Pctest.cc -o Pctest.o
Pctest.cc: In constructor 'Pctest::Pctest()':
Pctest.cc:103: error: 'BIOCIMMEDIATE' was not declared in this scope

So I research this issue. As the result, I found a issue which
is that new pcap.h doesn't #include <net/bpf.h>.

I don't have any idea to fix this issue. Anyone, please fix
this issue:-).

--- src/contrib/libpcap/pcap.h 2006/09/04 19:54:21 1.12
+++ src/contrib/libpcap/pcap.h 2007/10/16 02:07:55 1.13
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* $FreeBSD$
- * @(#) $Header: /home/ncvs/src/contrib/libpcap/pcap.h,v 1.12 2006/09/04 19:54:21 sam Exp $ (LBL)
+ * @(#) $Header: /home/ncvs/src/contrib/libpcap/pcap.h,v 1.13 2007/10/16 02:07:55 mlaier Exp $ (LBL)
*/

#ifndef lib_pcap_h
@@ -41,7 +41,9 @@
#include <sys/types.h>
#include <sys/time.h>

-#include <net/bpf.h>
+#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H
+#include <pcap-bpf.h>
+#endif

#include <stdio.h>
Max Laier
2007-10-20 19:25:40 UTC
Permalink
Post by Norikatsu Shigemura
I tried to install ports/net/pchar on 8-current machine. And
I got following compiling error message:-(.
c++ -O -fno-strict-aliasing -pipe -march=pentium3 -I. -DSIZEOF_BOOL=1
-DHAVE_SOCKLEN_T=1 -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1
-DHAVE_STRINGS_H=1 -DHAVE_SOCKADDR_SA_LEN=1 -DHAVE_HERROR=1
-DHAVE_SNPRINTF=1 -DHAVE_LIBM=1 -DHAVE_IPV6=1 -DHAVE_PCAP=1
-DHAVE_LIBPCAP=1 -DHAVE_BPF=1 -c Pctest.cc -o Pctest.o Pctest.cc: In
Pctest.cc:103: error: 'BIOCIMMEDIATE' was not declared in this scope
So I research this issue. As the result, I found a issue which
is that new pcap.h doesn't #include <net/bpf.h>.
I don't have any idea to fix this issue. Anyone, please fix
this issue:-).
I'm somewhat reluctant to apply this as I don't think it's a good idea to
have that kind of namespace pollution in the pcap header. If you want to
use bpf directly, you should include the header yourself.

As this behavior is verbatim from the vendor, code that doesn't include
sys/bpf.h when it needs it isn't portable and should be fixed, anyhow.

This of course is just my reading of things and you can convince me
otherwise. If a ton of ports break, we most certainly should apply the
bandaid.
Post by Norikatsu Shigemura
--- src/contrib/libpcap/pcap.h 2006/09/04 19:54:21 1.12
+++ src/contrib/libpcap/pcap.h 2007/10/16 02:07:55 1.13
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* $FreeBSD$
/home/ncvs/src/contrib/libpcap/pcap.h,v 1.13 2007/10/16 02:07:55 mlaier
Exp $ (LBL) */
#ifndef lib_pcap_h
@@ -41,7 +41,9 @@
#include <sys/types.h>
#include <sys/time.h>
-#include <net/bpf.h>
+#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H
+#include <pcap-bpf.h>
+#endif
#include <stdio.h>
--
/"\ Best regards, | ***@freebsd.org
\ / Max Laier | ICQ #67774661
X http://pf4freebsd.love2party.net/ | ***@EFnet
/ \ ASCII Ribbon Campaign | Against HTML Mail and News
Max Laier
2007-10-20 20:37:44 UTC
Permalink
Post by Norikatsu Shigemura
I tried to install ports/net/pchar on 8-current machine. And
I got following compiling error message:-(.
c++ -O -fno-strict-aliasing -pipe -march=pentium3 -I. -DSIZEOF_BOOL=1
-DHAVE_SOCKLEN_T=1 -DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1
-DHAVE_STRINGS_H=1 -DHAVE_SOCKADDR_SA_LEN=1 -DHAVE_HERROR=1
-DHAVE_SNPRINTF=1 -DHAVE_LIBM=1 -DHAVE_IPV6=1 -DHAVE_PCAP=1
-DHAVE_LIBPCAP=1 -DHAVE_BPF=1 -c Pctest.cc -o Pctest.o Pctest.cc: In
Pctest.cc:103: error: 'BIOCIMMEDIATE' was not declared in this scope
So I research this issue. As the result, I found a issue which
is that new pcap.h doesn't #include <net/bpf.h>.
I don't have any idea to fix this issue. Anyone, please fix
this issue:-).
Reverted now - sorry for the confusion.
Post by Norikatsu Shigemura
--- src/contrib/libpcap/pcap.h 2006/09/04 19:54:21 1.12
+++ src/contrib/libpcap/pcap.h 2007/10/16 02:07:55 1.13
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* $FreeBSD$
/home/ncvs/src/contrib/libpcap/pcap.h,v 1.13 2007/10/16 02:07:55 mlaier
Exp $ (LBL) */
#ifndef lib_pcap_h
@@ -41,7 +41,9 @@
#include <sys/types.h>
#include <sys/time.h>
-#include <net/bpf.h>
+#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H
+#include <pcap-bpf.h>
+#endif
#include <stdio.h>
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to
--
/"\ Best regards, | ***@freebsd.org
\ / Max Laier | ICQ #67774661
X http://pf4freebsd.love2party.net/ | ***@EFnet
/ \ ASCII Ribbon Campaign | Against HTML Mail and News
Loading...