Debian Bug report logs - #619684
ns2: FTBFS on kfreebsd-*: emulate/net-pcap.cc:537:19: error: 'BIOCIMMEDIATE' was not declared in this scope

version graph

Package: src:ns2; Maintainer for src:ns2 is Debian Network Simulators Team <pkg-netsim-devel@lists.alioth.debian.org>;

Reported by: Cyril Brulebois <kibi@debian.org>

Date: Sat, 26 Mar 2011 02:15:05 UTC

Severity: serious

Tags: help

Merged with 622951

Found in version ns2/2.35~RC6-3

Fixed in version ns2/2.35~RC6-4

Done: YunQiang Su <wzssyqa@gmail.com>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, YunQiang Su <wzssyqa@gmail.com>:
Bug#619684; Package src:ns2. (Sat, 26 Mar 2011 02:15:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Cyril Brulebois <kibi@debian.org>:
New Bug report received and forwarded. Copy sent to YunQiang Su <wzssyqa@gmail.com>. (Sat, 26 Mar 2011 02:15:08 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Cyril Brulebois <kibi@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: ns2: FTBFS on kfreebsd-*: emulate/net-pcap.cc:537:19: error: 'BIOCIMMEDIATE' was not declared in this scope
Date: Sat, 26 Mar 2011 03:15:00 +0100
Source: ns2
Version: 2.35~RC6-3
Severity: serious
Justification: FTBFS
User: debian-bsd@lists.debian.org
Usertags: kfreebsd

Hi,

your package no longer builds on kfreebsd-*:
| g++ -c -g -O2 -Wall -Wno-write-strings  -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR  -DNDEBUG -DLINUX_TCP_HEADER -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_14 -DHAVE_OTCL_H -DHAVE_LIBTK8_5 -DHAVE_TK_H -DHAVE_LIBTCL8_5 -DHAVE_TCLINT_H -DHAVE_TCL_H  -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=std -DUSE_SINGLE_ADDRESS_SPACE -Drng_test  -I. -I. -I/usr/include/tclcl -I/usr/include -I/usr/include/tcl -I/usr/include/tcl8.5/tcl-private/generic -I/usr/include/tcl8.5/tcl-private/generic -I/usr/include/pcap -I./tcp -I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac -I./mobile -I./trace -I./routing -I./tools -I./classifier -I./mcast -I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr -I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs -I./diffserv -I./satellite -I./wpan -o emulate/net-pcap.o emulate/net-pcap.cc
| emulate/net-pcap.cc: In member function 'virtual int PcapLiveNetwork::open(int, const char*)':
| emulate/net-pcap.cc:537:19: error: 'BIOCIMMEDIATE' was not declared in this scope
| make[1]: *** [emulate/net-pcap.o] Error 1

Full build logs:
  https://buildd.debian.org/status/package.php?p=ns2&suite=sid

Please get in touch with debian-bsd@ if you need help.

KiBi.




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#619684; Package src:ns2. (Sat, 26 Mar 2011 10:57:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to YunQiang Su <wzssyqa@gmail.com>:
Extra info received and forwarded to list. (Sat, 26 Mar 2011 10:57:03 GMT) Full text and rfc822 format available.

Message #10 received at submit@bugs.debian.org (full text, mbox):

From: YunQiang Su <wzssyqa@gmail.com>
To: Cyril Brulebois <kibi@debian.org>, 619684@bugs.debian.org
Cc: Debian Bug Tracking System <submit@bugs.debian.org>, debian-bsd@lists.debian.org
Subject: Re: Bug#619684: ns2: FTBFS on kfreebsd-*: emulate/net-pcap.cc:537:19: error: 'BIOCIMMEDIATE' was not declared in this scope
Date: Sat, 26 Mar 2011 18:54:23 +0800
[Message part 1 (text/plain, inline)]
On Sat, Mar 26, 2011 at 10:15 AM, Cyril Brulebois <kibi@debian.org> wrote:

> Source: ns2
> Version: 2.35~RC6-3
> Severity: serious
> Justification: FTBFS
> User: debian-bsd@lists.debian.org
> Usertags: kfreebsd
>
> Hi,
>
> your package no longer builds on kfreebsd-*:
> | g++ -c -g -O2 -Wall -Wno-write-strings  -DTCP_DELAY_BIND_ALL -DNO_TK
> -DTCLCL_CLASSINSTVAR  -DNDEBUG -DLINUX_TCP_HEADER -DUSE_SHM -DHAVE_LIBTCLCL
> -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_14 -DHAVE_OTCL_H -DHAVE_LIBTK8_5 -DHAVE_TK_H
> -DHAVE_LIBTCL8_5 -DHAVE_TCLINT_H -DHAVE_TCL_H  -DHAVE_CONFIG_H
> -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=std -DUSE_SINGLE_ADDRESS_SPACE
> -Drng_test  -I. -I. -I/usr/include/tclcl -I/usr/include -I/usr/include/tcl
> -I/usr/include/tcl8.5/tcl-private/generic
> -I/usr/include/tcl8.5/tcl-private/generic -I/usr/include/pcap -I./tcp
> -I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac -I./mobile
> -I./trace -I./routing -I./tools -I./classifier -I./mcast
> -I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr
> -I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs -I./diffserv
> -I./satellite -I./wpan -o emulate/net-pcap.o emulate/net-pcap.cc
> | emulate/net-pcap.cc: In member function 'virtual int
> PcapLiveNetwork::open(int, const char*)':
> | emulate/net-pcap.cc:537:19: error: 'BIOCIMMEDIATE' was not declared in
> this scope
> | make[1]: *** [emulate/net-pcap.o] Error 1
>
> Full build logs:
>  https://buildd.debian.org/status/package.php?p=ns2&suite=sid
>
> Please get in touch with debian-bsd@ if you need help.
>
> KiBi.
>
>
> I searched for it and got some information.

It said that In BSD's pcap.h, it do not include <pcap/bpf.h>, but linux one
do it.

What I want to know is that, why they are not the same ? Both them are
Debian GNU/*


-- 
YunQiang Su
[Message part 2 (text/html, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#619684; Package src:ns2. (Sat, 26 Mar 2011 10:57:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to YunQiang Su <wzssyqa@gmail.com>:
Extra info received and forwarded to list. (Sat, 26 Mar 2011 10:57:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, YunQiang Su <wzssyqa@gmail.com>:
Bug#619684; Package src:ns2. (Fri, 15 Apr 2011 14:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Aron Xu <happyaron.xu@gmail.com>:
Extra info received and forwarded to list. Copy sent to YunQiang Su <wzssyqa@gmail.com>. (Fri, 15 Apr 2011 14:57:03 GMT) Full text and rfc822 format available.

Message #20 received at 619684@bugs.debian.org (full text, mbox):

From: Aron Xu <happyaron.xu@gmail.com>
To: control@bugs.debian.org, 619684@bugs.debian.org
Cc: debian-bsd@lists.debian.org
Subject: Re: Bug #619684: ns2: FTBFS on kfreebsd-*: emulate/net-pcap.cc:537:19: error: 'BIOCIMMEDIATE' was not declared in this scope
Date: Fri, 15 Apr 2011 22:54:29 +0800
tags 619684 + help
thanks

CCing debian-bsd@l.d.o.  http://bugs.debian.org/619684

Here we find the libpcap on GNU/Linux and GNU/kfreebsd are (almost,
not very sure) the same, but the package fails to build on kfreebsd-*
and hurd. Could you please help on this issue?

Now we guess PCAP_DONT_INCLUDE_PCAP_BPF_H is set on kfreebsd-*, but we
have no kfreebsd-* box in hand to debug. Any help is highly
appreciated!


-- 
Regards,
Aron Xu




Added tag(s) help. Request was from Aron Xu <happyaron.xu@gmail.com> to control@bugs.debian.org. (Fri, 15 Apr 2011 14:57:06 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, YunQiang Su <wzssyqa@gmail.com>:
Bug#619684; Package src:ns2. (Fri, 15 Apr 2011 17:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Aron Xu <happyaron.xu@gmail.com>:
Extra info received and forwarded to list. Copy sent to YunQiang Su <wzssyqa@gmail.com>. (Fri, 15 Apr 2011 17:45:03 GMT) Full text and rfc822 format available.

Message #27 received at 619684@bugs.debian.org (full text, mbox):

From: Aron Xu <happyaron.xu@gmail.com>
To: 619684@bugs.debian.org
Cc: debian-bsd@lists.debian.org
Subject: Re: Bug #619684: ns2: FTBFS on kfreebsd-*: emulate/net-pcap.cc:537:19: error: 'BIOCIMMEDIATE' was not declared in this scope
Date: Sat, 16 Apr 2011 01:43:31 +0800
After lindi- and wzssyqa's test, the macro
PCAP_DONT_INCLUDE_PCAP_BPF_H is not defined in Sid Debian
GNU/kfreebsd, so the problem becomes a bit more complicated... Help,
please!

-- 
Regards,
Aron Xu




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#619684; Package src:ns2. (Fri, 15 Apr 2011 19:51:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to YunQiang Su <wzssyqa@gmail.com>:
Extra info received and forwarded to list. (Fri, 15 Apr 2011 19:51:05 GMT) Full text and rfc822 format available.

Message #32 received at 619684@bugs.debian.org (full text, mbox):

From: YunQiang Su <wzssyqa@gmail.com>
To: Aron Xu <happyaron.xu@gmail.com>
Cc: 619684@bugs.debian.org, debian-bsd@lists.debian.org
Subject: Re: Bug #619684: ns2: FTBFS on kfreebsd-*: emulate/net-pcap.cc:537:19: error: 'BIOCIMMEDIATE' was not declared in this scope
Date: Sat, 16 Apr 2011 03:49:51 +0800
I got it.

It used it like this

#if !defined(__linux__)&&!defined(__APPLE__)
	{
		int immed = 1;
		if (ioctl(pfd_, BIOCIMMEDIATE, &immed) < 0) {
			fprintf(stderr,
				"warning: pcap/live (%s) couldn't set immed\n",
				name());
			perror("ioctl(BIOCIMMEDIATE)");
		}
	}
#endif

On linux , BIOCIMMEDIATE is not used, but on BSD, it did being used,
but did *not* include net/bpf.h

Then there are 2 ways to fix this bug:
    1. also disable the above code block on BSD.
    2. include net/bpf.h on BSD platform.

Which one is better ?
-- 
YunQiang Su




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#619684; Package src:ns2. (Fri, 15 Apr 2011 19:54:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to YunQiang Su <wzssyqa@gmail.com>:
Extra info received and forwarded to list. (Fri, 15 Apr 2011 19:54:03 GMT) Full text and rfc822 format available.

Message #37 received at 619684@bugs.debian.org (full text, mbox):

From: YunQiang Su <wzssyqa@gmail.com>
To: Aron Xu <happyaron.xu@gmail.com>
Cc: 619684@bugs.debian.org, debian-bsd@lists.debian.org
Subject: Re: Bug #619684: ns2: FTBFS on kfreebsd-*: emulate/net-pcap.cc:537:19: error: 'BIOCIMMEDIATE' was not declared in this scope
Date: Sat, 16 Apr 2011 03:51:14 +0800
Or should pcap/bpf.h include net/bpf.h on BSD ?

-- 
YunQiang Su




Information forwarded to debian-bugs-dist@lists.debian.org, YunQiang Su <wzssyqa@gmail.com>:
Bug#619684; Package src:ns2. (Sat, 16 Apr 2011 03:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Aron Xu <happyaron.xu@gmail.com>:
Extra info received and forwarded to list. Copy sent to YunQiang Su <wzssyqa@gmail.com>. (Sat, 16 Apr 2011 03:33:03 GMT) Full text and rfc822 format available.

Message #42 received at 619684@bugs.debian.org (full text, mbox):

From: Aron Xu <happyaron.xu@gmail.com>
To: YunQiang Su <wzssyqa@gmail.com>
Cc: 619684@bugs.debian.org, debian-bsd@lists.debian.org
Subject: Re: Bug #619684: ns2: FTBFS on kfreebsd-*: emulate/net-pcap.cc:537:19: error: 'BIOCIMMEDIATE' was not declared in this scope
Date: Sat, 16 Apr 2011 11:31:25 +0800
On Sat, Apr 16, 2011 at 03:49, YunQiang Su <wzssyqa@gmail.com> wrote:
> I got it.
>
> It used it like this
>
> #if !defined(__linux__)&&!defined(__APPLE__)
>        {
>                int immed = 1;
>                if (ioctl(pfd_, BIOCIMMEDIATE, &immed) < 0) {
>                        fprintf(stderr,
>                                "warning: pcap/live (%s) couldn't set immed\n",
>                                name());
>                        perror("ioctl(BIOCIMMEDIATE)");
>                }
>        }
> #endif
>
> On linux , BIOCIMMEDIATE is not used, but on BSD, it did being used,
> but did *not* include net/bpf.h
>
> Then there are 2 ways to fix this bug:
>    1. also disable the above code block on BSD.
>    2. include net/bpf.h on BSD platform.
>
> Which one is better ?
> --
> YunQiang Su
>

I prefer to attempting to use this piece of code first. Because using
BIOCIMMEDIATE could very probably get some advantages over not using
them on kbsd platforms.

Here is a thread about it in freebsd-arch mailing list:
http://lists.freebsd.org/pipermail/freebsd-arch/2003-November/001446.html

> No.  BIOCIMMEDIATE and non-blocking mode are different.
>
> BIOCIMMEDIATE mode means "make incoming packets
> readable immediately; don't buffer them up until either the
> store buffer is full or the timeout expires".  This is for use in,
> for example, applications that are using BPF to implement
> network protocols, and want to be able to respond
> immediately to incoming packets, as opposed to, for
> example, packet capture applications (tcpdump, Ethereal,
> etc.) which don't necessarily need to immediately show or
> save incoming packets and which might want to try to get
> as many packets as possible per read on the BPF device.


-- 
Regards,
Aron Xu




Bug 619684 cloned as bug 622951. Request was from Aron Xu <happyaron.xu@gmail.com> to control@bugs.debian.org. (Sat, 16 Apr 2011 06:03:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, YunQiang Su <wzssyqa@gmail.com>:
Bug#619684; Package src:ns2. (Sat, 16 Apr 2011 06:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Aron Xu <happyaron.xu@gmail.com>:
Extra info received and forwarded to list. Copy sent to YunQiang Su <wzssyqa@gmail.com>. (Sat, 16 Apr 2011 06:21:03 GMT) Full text and rfc822 format available.

Message #49 received at 619684@bugs.debian.org (full text, mbox):

From: Aron Xu <happyaron.xu@gmail.com>
To: 622951@bugs.debian.org, 619684@bugs.debian.org
Subject: net/bpf.h isn't really included on kfreebsd-* and possibly hurd
Date: Sat, 16 Apr 2011 14:17:35 +0800
net/bpf.h is not included on kfreebsd-* and possibly hurd, which makes
package ns2 FTBFS on those archs. The following code snip could be
used to determine whether it is included, result:

Debian Sid GNU/Linux: included.
Debian Sid GNU/kfreebsd: _not_ included.
FreeBSD: included. (Asked on #freebsd, not asked about the OS version)

While at the same time, ns2 could be built on Linux and FreeBSD, but
not on Debian GNU/kfreebsd-* or hurd.

Please reassign this bug accordingly if necessary.

#include <stdio.h>
#include <pcap.h>

main(){
#ifdef _NET_BPF_H_
	printf("net/bpf.h is included.\n");
#else
	printf("net/bpf.h is *not* included.\n");
#endif
}

-- 
Regards,
Aron Xu




Information forwarded to debian-bugs-dist@lists.debian.org, YunQiang Su <wzssyqa@gmail.com>:
Bug#619684; Package src:ns2. (Sat, 16 Apr 2011 06:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Aron Xu <happyaron.xu@gmail.com>:
Extra info received and forwarded to list. Copy sent to YunQiang Su <wzssyqa@gmail.com>. (Sat, 16 Apr 2011 06:27:04 GMT) Full text and rfc822 format available.

Message #54 received at 619684@bugs.debian.org (full text, mbox):

From: Aron Xu <happyaron.xu@gmail.com>
To: 622951 <622951@bugs.debian.org>, 619684@bugs.debian.org
Subject: Re: Bug#622951: Info received (net/bpf.h isn't really included on kfreebsd-* and possibly hurd)
Date: Sat, 16 Apr 2011 14:25:59 +0800
Urh... Sorry, it seems the test wasn't run on linux and I accidentally
wrote it... The issue should be only considered on (k)freebsd
variants.


-- 
Regards,
Aron Xu




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#619684; Package src:ns2. (Sat, 16 Apr 2011 06:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to YunQiang Su <wzssyqa@gmail.com>:
Extra info received and forwarded to list. (Sat, 16 Apr 2011 06:33:03 GMT) Full text and rfc822 format available.

Message #59 received at 619684@bugs.debian.org (full text, mbox):

From: YunQiang Su <wzssyqa@gmail.com>
To: Aron Xu <happyaron.xu@gmail.com>, 619684@bugs.debian.org
Cc: 622951 <622951@bugs.debian.org>
Subject: Re: Bug#619684: Bug#622951: Info received (net/bpf.h isn't really included on kfreebsd-* and possibly hurd)
Date: Sat, 16 Apr 2011 14:30:50 +0800
The test on FreeBSD is done by daemon@freenode #freebsd.

FreeBSD desktop1.daemonrage.net 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu
Feb 17 02:41:51 UTC 2011
root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64

Many thanks to him.




Information forwarded to debian-bugs-dist@lists.debian.org, YunQiang Su <wzssyqa@gmail.com>:
Bug#619684; Package src:ns2. (Sat, 16 Apr 2011 09:42:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Romain Francoise <rfrancoise@debian.org>:
Extra info received and forwarded to list. Copy sent to YunQiang Su <wzssyqa@gmail.com>. (Sat, 16 Apr 2011 09:42:06 GMT) Full text and rfc822 format available.

Message #64 received at 619684@bugs.debian.org (full text, mbox):

From: Romain Francoise <rfrancoise@debian.org>
To: Aron Xu <happyaron.xu@gmail.com>
Cc: 619684@bugs.debian.org, YunQiang Su <wzssyqa@gmail.com>, debian-bsd@lists.debian.org
Subject: Re: Bug#619684: Bug #619684: ns2: FTBFS on kfreebsd-*: emulate/net-pcap.cc:537:19: error: 'BIOCIMMEDIATE' was not declared in this scope
Date: Sat, 16 Apr 2011 11:39:27 +0200
Hi,

I don't think this is a bug in libpcap; if your program uses
BIOCIMMEDIATE then it needs to include <net/bpf.h> itself and not
expect pcap's includes to do it.

FWIW, with the following patch ns2 builds successfully for me on
kfreebsd-amd64:

Index: ns2-2.35~RC6/emulate/net-pcap.cc
===================================================================
--- ns2-2.35~RC6.orig/emulate/net-pcap.cc	2011-04-16 11:21:52.000000000 +0200
+++ ns2-2.35~RC6/emulate/net-pcap.cc	2011-04-16 11:26:17.000000000 +0200
@@ -55,6 +55,10 @@
 #include <sys/systeminfo.h>
 #endif
 
+#if !defined(__linux__)&&!defined(__APPLE__)
+#include <net/bpf.h>
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #include <pcap.h>

-- 
Romain Francoise <rfrancoise@debian.org>
http://people.debian.org/~rfrancoise/




Merged 619684 622951. Request was from Romain Francoise <rfrancoise@debian.org> to control@bugs.debian.org. (Sat, 16 Apr 2011 10:03:07 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#619684; Package src:ns2. (Sat, 16 Apr 2011 11:57:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to YunQiang Su <wzssyqa@gmail.com>:
Extra info received and forwarded to list. (Sat, 16 Apr 2011 11:57:08 GMT) Full text and rfc822 format available.

Message #71 received at 619684@bugs.debian.org (full text, mbox):

From: YunQiang Su <wzssyqa@gmail.com>
To: Romain Francoise <rfrancoise@debian.org>
Cc: Aron Xu <happyaron.xu@gmail.com>, 619684@bugs.debian.org, debian-bsd@lists.debian.org
Subject: Re: Bug#619684: Bug #619684: ns2: FTBFS on kfreebsd-*: emulate/net-pcap.cc:537:19: error: 'BIOCIMMEDIATE' was not declared in this scope
Date: Sat, 16 Apr 2011 19:52:51 +0800
于 2011年04月16日 17:39, Romain Francoise 写道:
> Hi,
> 
> I don't think this is a bug in libpcap; if your program uses
> BIOCIMMEDIATE then it needs to include <net/bpf.h> itself and not
> expect pcap's includes to do it.
> 
> FWIW, with the following patch ns2 builds successfully for me on
> kfreebsd-amd64:
> 
> Index: ns2-2.35~RC6/emulate/net-pcap.cc
> ===================================================================
> --- ns2-2.35~RC6.orig/emulate/net-pcap.cc	2011-04-16 11:21:52.000000000 +0200
> +++ ns2-2.35~RC6/emulate/net-pcap.cc	2011-04-16 11:26:17.000000000 +0200
> @@ -55,6 +55,10 @@
>  #include <sys/systeminfo.h>
>  #endif
>  
> +#if !defined(__linux__)&&!defined(__APPLE__)
> +#include <net/bpf.h>
> +#endif
> +
>  #ifdef __cplusplus
>  extern "C" {
>  #include <pcap.h>
> 
I tested a similar patch

--- ns2-2.35~RC6.orig/emulate/net-pcap.cc
+++ ns2-2.35~RC6/emulate/net-pcap.cc
@@ -63,6 +63,8 @@ extern "C" {
 #include <pcap.h>
 #endif

+#include <net/bpf.h>
+
 #include "config.h"
 #include "scheduler.h"
 #include "net.h"

But occured an error:

g++ -c -g -O2 -Wall -Wno-write-strings  -DTCP_DELAY_BIND_ALL -DNO_TK
-DTCLCL_CLASSINSTVAR  -DNDEBUG -DLINUX_TCP_HEADER -DUSE_SHM
-DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_14 -DHAVE_OTCL_H
-DHAVE_LIBTK8_5 -DHAVE_TK_H -DHAVE_LIBTCL8_5 -DHAVE_TCLINT_H
-DHAVE_TCL_H  -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC
-DCPP_NAMESPACE=std -DUSE_SINGLE_ADDRESS_SPACE -Drng_test  -I. -I.
-I/usr/include/tclcl -I/usr/include -I/usr/include/tcl
-I/usr/include/tcl8.5/tcl-private/generic
-I/usr/include/tcl8.5/tcl-private/generic -I/usr/include/pcap -I./tcp
-I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac
-I./mobile -I./trace -I./routing -I./tools -I./classifier -I./mcast
-I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr
-I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs
-I./diffserv -I./satellite -I./wpan -o emulate/arp.o emulate/arp.cc
g++ -c -g -O2 -Wall -Wno-write-strings  -DTCP_DELAY_BIND_ALL -DNO_TK
-DTCLCL_CLASSINSTVAR  -DNDEBUG -DLINUX_TCP_HEADER -DUSE_SHM
-DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_14 -DHAVE_OTCL_H
-DHAVE_LIBTK8_5 -DHAVE_TK_H -DHAVE_LIBTCL8_5 -DHAVE_TCLINT_H
-DHAVE_TCL_H  -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC
-DCPP_NAMESPACE=std -DUSE_SINGLE_ADDRESS_SPACE -Drng_test  -I. -I.
-I/usr/include/tclcl -I/usr/include -I/usr/include/tcl
-I/usr/include/tcl8.5/tcl-private/generic
-I/usr/include/tcl8.5/tcl-private/generic -I/usr/include/pcap -I./tcp
-I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac
-I./mobile -I./trace -I./routing -I./tools -I./classifier -I./mcast
-I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr
-I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs
-I./diffserv -I./satellite -I./wpan -o emulate/icmp.o emulate/icmp.cc
g++ -c -g -O2 -Wall -Wno-write-strings  -DTCP_DELAY_BIND_ALL -DNO_TK
-DTCLCL_CLASSINSTVAR  -DNDEBUG -DLINUX_TCP_HEADER -DUSE_SHM
-DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_14 -DHAVE_OTCL_H
-DHAVE_LIBTK8_5 -DHAVE_TK_H -DHAVE_LIBTCL8_5 -DHAVE_TCLINT_H
-DHAVE_TCL_H  -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC
-DCPP_NAMESPACE=std -DUSE_SINGLE_ADDRESS_SPACE -Drng_test  -I. -I.
-I/usr/include/tclcl -I/usr/include -I/usr/include/tcl
-I/usr/include/tcl8.5/tcl-private/generic
-I/usr/include/tcl8.5/tcl-private/generic -I/usr/include/pcap -I./tcp
-I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac
-I./mobile -I./trace -I./routing -I./tools -I./classifier -I./mcast
-I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr
-I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs
-I./diffserv -I./satellite -I./wpan -o emulate/net-pcap.o
emulate/net-pcap.cc
In file included from emulate/net-pcap.cc:66:0:
/usr/include/net/bpf.h:63:8: error: redefinition of ‘struct bpf_program’
/usr/include/pcap/bpf.h:88:20: error: previous definition of ‘struct
bpf_program’
/usr/include/net/bpf.h:87:8: error: redefinition of ‘struct bpf_version’
/usr/include/pcap/bpf.h:104:20: error: previous definition of ‘struct
bpf_version’
/usr/include/net/bpf.h:875:8: error: redefinition of ‘struct bpf_insn’
/usr/include/pcap/bpf.h:1042:17: error: previous definition of ‘struct
bpf_insn’
make[1]: *** [emulate/net-pcap.o] Error 1
make[1]: Leaving directory `/home/syq/ns2-2.35~RC6'
dh_auto_build: make -j1 returned exit code 2
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2






Information forwarded to debian-bugs-dist@lists.debian.org, YunQiang Su <wzssyqa@gmail.com>:
Bug#619684; Package src:ns2. (Sat, 16 Apr 2011 12:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Romain Francoise <rfrancoise@debian.org>:
Extra info received and forwarded to list. Copy sent to YunQiang Su <wzssyqa@gmail.com>. (Sat, 16 Apr 2011 12:33:03 GMT) Full text and rfc822 format available.

Message #76 received at 619684@bugs.debian.org (full text, mbox):

From: Romain Francoise <rfrancoise@debian.org>
To: YunQiang Su <wzssyqa@gmail.com>
Cc: Aron Xu <happyaron.xu@gmail.com>, 619684@bugs.debian.org, debian-bsd@lists.debian.org
Subject: Re: Bug#619684: Bug #619684: ns2: FTBFS on kfreebsd-*: emulate/net-pcap.cc:537:19: error: 'BIOCIMMEDIATE' was not declared in this scope
Date: Sat, 16 Apr 2011 14:32:04 +0200
YunQiang Su <wzssyqa@gmail.com> writes:

> /usr/include/net/bpf.h:63:8: error: redefinition of ‘struct bpf_program’
> /usr/include/pcap/bpf.h:88:20: error: previous definition of ‘struct
> bpf_program’

Yes, the system's bpf.h must come first, as in my patch.

-- 
Romain Francoise <rfrancoise@debian.org>
http://people.debian.org/~rfrancoise/




Reply sent to YunQiang Su <wzssyqa@gmail.com>:
You have taken responsibility. (Mon, 18 Apr 2011 15:39:11 GMT) Full text and rfc822 format available.

Notification sent to Cyril Brulebois <kibi@debian.org>:
Bug acknowledged by developer. (Mon, 18 Apr 2011 15:39:11 GMT) Full text and rfc822 format available.

Message #81 received at 619684-close@bugs.debian.org (full text, mbox):

From: YunQiang Su <wzssyqa@gmail.com>
To: 619684-close@bugs.debian.org
Subject: Bug#619684: fixed in ns2 2.35~RC6-4
Date: Mon, 18 Apr 2011 15:36:21 +0000
Source: ns2
Source-Version: 2.35~RC6-4

We believe that the bug you reported is fixed in the latest version of
ns2, which is due to be installed in the Debian FTP archive:

ns2-doc_2.35~RC6-4_all.deb
  to main/n/ns2/ns2-doc_2.35~RC6-4_all.deb
ns2-examples_2.35~RC6-4_all.deb
  to main/n/ns2/ns2-examples_2.35~RC6-4_all.deb
ns2_2.35~RC6-4.debian.tar.gz
  to main/n/ns2/ns2_2.35~RC6-4.debian.tar.gz
ns2_2.35~RC6-4.dsc
  to main/n/ns2/ns2_2.35~RC6-4.dsc
ns2_2.35~RC6-4_amd64.deb
  to main/n/ns2/ns2_2.35~RC6-4_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 619684@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
YunQiang Su <wzssyqa@gmail.com> (supplier of updated ns2 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 16 Apr 2011 14:56:30 +0800
Source: ns2
Binary: ns2 ns2-doc ns2-examples
Architecture: source amd64 all
Version: 2.35~RC6-4
Distribution: unstable
Urgency: low
Maintainer: YunQiang Su <wzssyqa@gmail.com>
Changed-By: YunQiang Su <wzssyqa@gmail.com>
Description: 
 ns2        - a discrete event simulator targeted at networking research
 ns2-doc    - docs of ns2
 ns2-examples - examples of ns2
Closes: 619684
Changes: 
 ns2 (2.35~RC6-4) unstable; urgency=low
 .
   * add DM-Upload-Allowed: yes
   * update VCS info: go to git.debian.org now.
   * workaround FTBFS on kfreebsd-* (Closes: #619684)
   	assigned it to libpcap
Checksums-Sha1: 
 fa91b5cb01569741f32176aa90201d0c73f0617e 1323 ns2_2.35~RC6-4.dsc
 af15fe107a8327b97b5a70cfbfd20840ad7c1a0e 6879 ns2_2.35~RC6-4.debian.tar.gz
 c56b4295d51ed15d43be33f9be7795d7ec716e09 5375704 ns2_2.35~RC6-4_amd64.deb
 fa54743f42e5343e2d92081ae9be1fb0583e67ff 2035942 ns2-doc_2.35~RC6-4_all.deb
 2dd6641ccf1b56076620960e6f8ce321f5df641f 41457808 ns2-examples_2.35~RC6-4_all.deb
Checksums-Sha256: 
 b6b0425f0a11d61d928e03ad2bedbb75778dce6582d05c5d1b9bc599638acbf8 1323 ns2_2.35~RC6-4.dsc
 6108206f932c732846f797c98ac99cda95cec80222b96e18ea9b650e527c402c 6879 ns2_2.35~RC6-4.debian.tar.gz
 5879987ee33ab29513e2366364a377fa33151fbed52be811386474b188fc9799 5375704 ns2_2.35~RC6-4_amd64.deb
 07289f88c0a87c87613770f7933f5a0fd879b5b27e952d7bd8e6cdfa64368dc3 2035942 ns2-doc_2.35~RC6-4_all.deb
 1ae86a5a2f837e91d071921dad322e0f79bc5555ca6d8477e5f14889b45a5dba 41457808 ns2-examples_2.35~RC6-4_all.deb
Files: 
 caa9d866208070b6dc4d08e049208d25 1323 net optional ns2_2.35~RC6-4.dsc
 70ebcacfdb99328d9b0123610bf4660a 6879 net optional ns2_2.35~RC6-4.debian.tar.gz
 e56bf9300b0b45181b5e2b7f1be5fb2a 5375704 net optional ns2_2.35~RC6-4_amd64.deb
 7ab0f0c8cf29123d081d2219061c1af9 2035942 doc optional ns2-doc_2.35~RC6-4_all.deb
 efef79d560cf63864fff0c4e26578655 41457808 net optional ns2-examples_2.35~RC6-4_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk2q89QACgkQ5TUK4GCH0vjZKQCcCxMFL3+Ku0bWBIN0Av585l72
nKAAnjjLJerQtP1Q2Lk97S4AN28Ktcem
=OrLN
-----END PGP SIGNATURE-----





Reply sent to YunQiang Su <wzssyqa@gmail.com>:
You have taken responsibility. (Mon, 18 Apr 2011 15:39:12 GMT) Full text and rfc822 format available.

Notification sent to Cyril Brulebois <kibi@debian.org>:
Bug acknowledged by developer. (Mon, 18 Apr 2011 15:39:12 GMT) Full text and rfc822 format available.

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 17 May 2011 07:52:20 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 14:52:30 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.