diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-02-04 22:15:28 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-02-04 22:15:28 +0000 |
commit | d861b05ea30e6ac177de9b679da96194ebe21afc (patch) | |
tree | 6bb3605e24633c0e64c9b7396873bbe28fe93be1 /hw/lance.c | |
parent | 191abaa2f0aca0c6ebca06f3e985da02ac950d14 (diff) |
Avoid buffer overflow when sending slirp packets.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1744 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/lance.c')
-rw-r--r-- | hw/lance.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/lance.c b/hw/lance.c index 2fef6b1eb0..c0cb0f98d6 100644 --- a/hw/lance.c +++ b/hw/lance.c @@ -283,6 +283,11 @@ static CPUWriteMemoryFunc *lance_mem_write[3] = { #define MIN_BUF_SIZE 60 +static void lance_can_receive(void *opaque) +{ + return 1; +} + static void lance_receive(void *opaque, const uint8_t *buf, int size) { LANCEState *s = opaque; @@ -440,7 +445,7 @@ void lance_init(NICInfo *nd, int irq, uint32_t leaddr, uint32_t ledaddr) lance_reset(s); - s->vc = qemu_new_vlan_client(nd->vlan, lance_receive, s); + s->vc = qemu_new_vlan_client(nd->vlan, lance_receive, lance_can_receive, s); snprintf(s->vc->info_str, sizeof(s->vc->info_str), "lance macaddr=%02x:%02x:%02x:%02x:%02x:%02x", |