mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-06 17:31:06 +00:00
Merge remote branch 'mst/for_anthony' into staging
This commit is contained in:
commit
a287916c71
10
hw/e1000.c
10
hw/e1000.c
@ -55,6 +55,7 @@ static int debugflags = DBGBIT(TXERR) | DBGBIT(GENERAL);
|
|||||||
|
|
||||||
#define IOPORT_SIZE 0x40
|
#define IOPORT_SIZE 0x40
|
||||||
#define PNPMMIO_SIZE 0x20000
|
#define PNPMMIO_SIZE 0x20000
|
||||||
|
#define MIN_BUF_SIZE 60 /* Min. octets in an ethernet frame sans FCS */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* HW models:
|
* HW models:
|
||||||
@ -635,10 +636,19 @@ e1000_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
|
|||||||
uint32_t rdh_start;
|
uint32_t rdh_start;
|
||||||
uint16_t vlan_special = 0;
|
uint16_t vlan_special = 0;
|
||||||
uint8_t vlan_status = 0, vlan_offset = 0;
|
uint8_t vlan_status = 0, vlan_offset = 0;
|
||||||
|
uint8_t min_buf[MIN_BUF_SIZE];
|
||||||
|
|
||||||
if (!(s->mac_reg[RCTL] & E1000_RCTL_EN))
|
if (!(s->mac_reg[RCTL] & E1000_RCTL_EN))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
/* Pad to minimum Ethernet frame length */
|
||||||
|
if (size < sizeof(min_buf)) {
|
||||||
|
memcpy(min_buf, buf, size);
|
||||||
|
memset(&min_buf[size], 0, sizeof(min_buf) - size);
|
||||||
|
buf = min_buf;
|
||||||
|
size = sizeof(min_buf);
|
||||||
|
}
|
||||||
|
|
||||||
if (size > s->rxbuf_size) {
|
if (size > s->rxbuf_size) {
|
||||||
DBGOUT(RX, "packet too large for buffers (%lu > %d)\n",
|
DBGOUT(RX, "packet too large for buffers (%lu > %d)\n",
|
||||||
(unsigned long)size, s->rxbuf_size);
|
(unsigned long)size, s->rxbuf_size);
|
||||||
|
@ -151,7 +151,7 @@ int vhost_net_start(struct vhost_net *net,
|
|||||||
return 0;
|
return 0;
|
||||||
fail:
|
fail:
|
||||||
file.fd = -1;
|
file.fd = -1;
|
||||||
while (--file.index >= 0) {
|
while (file.index-- > 0) {
|
||||||
int r = ioctl(net->dev.control, VHOST_NET_SET_BACKEND, &file);
|
int r = ioctl(net->dev.control, VHOST_NET_SET_BACKEND, &file);
|
||||||
assert(r >= 0);
|
assert(r >= 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user