qemu 0.10.1 PCAP networking on CURRENT
Jung-uk Kim
jkim at FreeBSD.org
Thu Mar 26 09:49:09 PDT 2009
[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
More information about the freebsd-emulation
mailing list