diff mbox

[RFC,v2,3/5] ne2k: work without vlan.

Message ID 1254918996-26050-4-git-send-email-kraxel@redhat.com
State RFC
Headers show

Commit Message

Gerd Hoffmann Oct. 7, 2009, 12:36 p.m. UTC
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/ne2000.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Anthony Liguori Oct. 7, 2009, 1:06 p.m. UTC | #1
Gerd Hoffmann wrote:
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/ne2000.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/hw/ne2000.c b/hw/ne2000.c
> index 87f1e59..0ed6eec 100644
> --- a/hw/ne2000.c
> +++ b/hw/ne2000.c
> @@ -322,7 +322,8 @@ void ne2000_ioport_write(void *opaque, uint32_t addr, uint32_t val)
>                      index -= NE2000_PMEM_SIZE;
>                  /* fail safe: check range on the transmitted length  */
>                  if (index + s->tcnt <= NE2000_PMEM_END) {
> -                    qemu_send_packet(s->vc, s->mem + index, s->tcnt);
> +                    if (s->vc)
> +                        qemu_send_packet(s->vc, s->mem + index, s->tcnt);
>                  }
>   

Perhaps we should just push the s->vc check into qemu_send_packet since 
we want this behavior consistently.

Regards,

Anthony Liguori
Gerd Hoffmann Oct. 7, 2009, 1:15 p.m. UTC | #2
On 10/07/09 15:06, Anthony Liguori wrote:
>> - qemu_send_packet(s->vc, s->mem + index, s->tcnt);
>> + if (s->vc)
>> + qemu_send_packet(s->vc, s->mem + index, s->tcnt);
>> }
>
> Perhaps we should just push the s->vc check into qemu_send_packet since
> we want this behavior consistently.

Makes sense indeed.  Will change it.

cheers,
   Gerd
diff mbox

Patch

diff --git a/hw/ne2000.c b/hw/ne2000.c
index 87f1e59..0ed6eec 100644
--- a/hw/ne2000.c
+++ b/hw/ne2000.c
@@ -322,7 +322,8 @@  void ne2000_ioport_write(void *opaque, uint32_t addr, uint32_t val)
                     index -= NE2000_PMEM_SIZE;
                 /* fail safe: check range on the transmitted length  */
                 if (index + s->tcnt <= NE2000_PMEM_END) {
-                    qemu_send_packet(s->vc, s->mem + index, s->tcnt);
+                    if (s->vc)
+                        qemu_send_packet(s->vc, s->mem + index, s->tcnt);
                 }
                 /* signal end of transfer */
                 s->tsr = ENTSR_PTX;