Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Mar 2009 12:48:56 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        freebsd-emulation@FreeBSD.org
Cc:        =?utf-8?q?J=C4=99drzej_Kalinowski?= <kalinoj1@iem.pw.edu.pl>, rpaulo@FreeBSD.org
Subject:   Re: qemu 0.10.1 PCAP networking on CURRENT
Message-ID:  <200903261249.00104.jkim@FreeBSD.org>
In-Reply-To: <962f2e5dc273dac6f2a2aaf017763bb2@iem.pw.edu.pl>
References:  <962f2e5dc273dac6f2a2aaf017763bb2@iem.pw.edu.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
[CC added]

On Thursday 26 March 2009 04:55 am, Jędrzej Kalinowski wrote:
> Hi,
>
> I'm working with latest qemu port (0.10.1) submitted by Juergen
> Lock. Pcap networking didn't work ok for me - it was terribly slow.
>
> I'm on a 8.0-CURRENT system, so I don't know if it is also the case
> in older releases. Nevertheless, if someone experiences similiar
> problems, you can try this patch - it helped me:

--- (PATCH removed) ---

libpcap 1.0.0 was imported few days ago but it didn't merge the 
following local hack:

http://www.freebsd.org/cgi/cvsweb.cgi/src/contrib/libpcap/pcap.h.diff?r1=1.13;r2=1.14

Your patch is harmless but it should be fixed in pcap.h and/or 
net/bpf.h properly not to step on each other unless the plan is to 
add PCAP_DONT_INCLUDE_PCAP_BPF_H everywhere in our ports tree to get 
FreeBSD-specific definitions.  For example, the QEMU patch needs at 
least two ioctl definitions to get it really working, i.e., 
BIOCIMMEDIATE and BIOCFEEDBACK, which are only present in net/bpf.h.  
In fact, pcap-bpf.c itself has a hack for AIX like this:

#ifdef _AIX

/*
 * Make "pcap.h" not include "pcap/bpf.h"; we are going to include the
 * native OS version, as we need "struct bpf_config" from it.
 */
#define PCAP_DONT_INCLUDE_PCAP_BPF_H

#include <sys/types.h>

/*
 * Prevent bpf.h from redefining the DLT_ values to their
 * IFT_ values, as we're going to return the standard libpcap
 * values, not IBM's non-standard IFT_ values.
 */
#undef _AIX
#include <net/bpf.h>
#define _AIX

...

#else /* _AIX */

#include <net/bpf.h>

#endif /* _AIX */

This is absolutely disgusting.  IMHO, I don't think it is a good idea 
to pollute ports tree with local patches like that.

Jung-uk Kim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903261249.00104.jkim>