[PATCH] QEMU networking with libpcap

Jung-uk Kim jkim at FreeBSD.org
Tue Feb 6 22:48:08 UTC 2007

I was trying to fix slirp but I have given up because the slirp is 
very 64-bit unfriendly.  In fact, it was taken from FreeBSD's 
src/sys/netinet but it was well before the following commit:


Unfortunately there were too many changes between slirp code fork and 
this fix.  On top of that, the author bastardized mbuf chain, so that 
we cannot merge this directly.

Instead I found this:


and re-wrote most of the code:


The option to use is '-net nic -net pcap' and it should be able to 
pick up right network interface for you.  If not, use '-net nic -net 
pcap,ifname=<YOUR_NIC_HERE>' instead.  But of course, you need access 
to /dev/bpf*.  Modify /etc/devfs.conf or /etc/devfs.rules to set 
permissions right for you.  Downside is host and guest cannot talk 
directly because it uses bpf(4).  And it seems slow for an unknown 
reason on my FreeBSD/amd64 -CURRENT host. :-(  Let me know if anyone 
knows why.


Jung-uk Kim

More information about the freebsd-emulation mailing list