From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54315 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PIf6P-0000uz-Gh for qemu-devel@nongnu.org; Wed, 17 Nov 2010 05:19:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PIf6N-0006aV-0k for qemu-devel@nongnu.org; Wed, 17 Nov 2010 05:18:56 -0500 Received: from david.siemens.de ([192.35.17.14]:23559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PIf6M-0006ZZ-NQ for qemu-devel@nongnu.org; Wed, 17 Nov 2010 05:18:54 -0500 Message-ID: <4CE3AC09.1090901@siemens.com> Date: Wed, 17 Nov 2010 11:18:49 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4CBDB33C.60002@siemens.com> In-Reply-To: <4CBDB33C.60002@siemens.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH][RESEND] pcnet: Do not receive external frames in loopback mode List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel Am 19.10.2010 17:03, Jan Kiszka wrote: > While not explicitly stated in the spec, it was observed on real systems > that enabling loopback testing on the pcnet controller disables > reception of external frames. And some legacy software relies on it, so > provide this behavior. Ping. > > Signed-off-by: Jan Kiszka > --- > hw/pcnet.c | 5 +++-- > 1 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/hw/pcnet.c b/hw/pcnet.c > index b52935a..f970bda 100644 > --- a/hw/pcnet.c > +++ b/hw/pcnet.c > @@ -1048,9 +1048,10 @@ ssize_t pcnet_receive(VLANClientState *nc, const uint8_t *buf, size_t size_) > int crc_err = 0; > int size = size_; > > - if (CSR_DRX(s) || CSR_STOP(s) || CSR_SPND(s) || !size) > + if (CSR_DRX(s) || CSR_STOP(s) || CSR_SPND(s) || !size || > + (CSR_LOOP(s) && !s->looptest)) { > return -1; > - > + } > #ifdef PCNET_DEBUG > printf("pcnet_receive size=%d\n", size); > #endif