forked from mirrors/nixpkgs
15 lines
555 B
Diff
15 lines
555 B
Diff
|
|
||
|
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
|
||
|
index 439477b..33bd233 100644
|
||
|
--- a/hw/net/virtio-net.c
|
||
|
+++ b/hw/net/virtio-net.c
|
||
|
<at> <at> -677,7 +677,7 <at> <at> static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd,
|
||
|
goto error;
|
||
|
}
|
||
|
|
||
|
- if (in_use + mac_data.entries <= MAC_TABLE_ENTRIES) {
|
||
|
+ if (mac_data.entries <= MAC_TABLE_ENTRIES - in_use) {
|
||
|
s = iov_to_buf(iov, iov_cnt, 0, &macs[in_use * ETH_ALEN],
|
||
|
mac_data.entries * ETH_ALEN);
|
||
|
if (s != mac_data.entries * ETH_ALEN) {
|