From owner-freebsd-emulation@FreeBSD.ORG Sun Jul 19 09:08:02 2009 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 5C450106564A; Sun, 19 Jul 2009 09:08:01 +0000 (UTC) (envelope-from nork@FreeBSD.org) Date: Sun, 19 Jul 2009 18:07:53 +0900 From: Norikatsu Shigemura To: Christophe Fillot Message-Id: <20090719180754.eaeebccb.nork@FreeBSD.org> In-Reply-To: <20090719152407.c9f3b912.nork@FreeBSD.org> References: <20090719152407.c9f3b912.nork@FreeBSD.org> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.16.4; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Sun__19_Jul_2009_18_07_54_+0900_+d0PAEx6tyl4SbUZ" Cc: Max, freebsd-emulation@FreeBSD.org, Pavel Volkov , Norikatsu Shigemura , Khon Subject: Re: Dynamips has two minor bugs. X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 09:08:02 -0000 This is a multi-part message in MIME format. --Multipart=_Sun__19_Jul_2009_18_07_54_+0900_+d0PAEx6tyl4SbUZ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sun, 19 Jul 2009 15:24:07 +0900 Norikatsu Shigemura wrote: > 2. dynamips can't communicate to real world via FreeBSD's gen_eth > (libpcap). In this case, bpf(4) requires BIOCFEEDBACK. So I > investigated like attached 'patch-gen_eth.c'. Oops, I missed! I re-made a new patch. Please see attached file. --Multipart=_Sun__19_Jul_2009_18_07_54_+0900_+d0PAEx6tyl4SbUZ Content-Type: text/plain; name="patch-gen_eth.c" Content-Disposition: attachment; filename="patch-gen_eth.c" Content-Transfer-Encoding: 7bit --- gen_eth.c.orig 2007-10-14 17:43:08.000000000 +0900 +++ gen_eth.c 2009-07-19 15:46:08.291856897 +0900 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -45,8 +46,13 @@ pcap_t *gen_eth_init(char *device) if (!(p = pcap_open_live(device,2048,TRUE,10,pcap_errbuf))) goto pcap_error; - /* Accept only incoming packets */ - pcap_setdirection(p,PCAP_D_IN); + pcap_setdirection(p,PCAP_D_INOUT); +#ifdef BIOCFEEDBACK + { + int on = 1; + ioctl(pcap_fileno(p), BIOCFEEDBACK, &on); + } +#endif #else p = pcap_open(device,2048, PCAP_OPENFLAG_PROMISCUOUS | --Multipart=_Sun__19_Jul_2009_18_07_54_+0900_+d0PAEx6tyl4SbUZ--