From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35398 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PKBgW-0004hH-A1 for qemu-devel@nongnu.org; Sun, 21 Nov 2010 10:18:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PKBgV-0004AN-0i for qemu-devel@nongnu.org; Sun, 21 Nov 2010 10:18:31 -0500 Received: from mail-yx0-f173.google.com ([209.85.213.173]:62720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PKBgU-0004AD-Ui for qemu-devel@nongnu.org; Sun, 21 Nov 2010 10:18:30 -0500 Received: by yxs7 with SMTP id 7so769201yxs.4 for ; Sun, 21 Nov 2010 07:18:30 -0800 (PST) Message-ID: <4CE93844.4030305@codemonkey.ws> Date: Sun, 21 Nov 2010 09:18:28 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH][RESEND] pcnet: Do not receive external frames in loopback mode References: <4CBDB33C.60002@siemens.com> In-Reply-To: <4CBDB33C.60002@siemens.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel On 10/19/2010 10:03 AM, 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. > > Signed-off-by: Jan Kiszka > Applied. Thanks. Regards, Anthony Liguori > --- > 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 >