net: vlan clients with no fd_can_read() can always receive
If a vlan client has no fd_can_read(), that means it can always receive packets. The current code assumes it can *never* receive packets. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
This commit is contained in:
parent
5b01e886d9
commit
2e1e064110
12
net.c
12
net.c
@ -389,14 +389,18 @@ VLANClientState *qemu_find_vlan_client(VLANState *vlan, void *opaque)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int qemu_can_send_packet(VLANClientState *vc1)
|
int qemu_can_send_packet(VLANClientState *sender)
|
||||||
{
|
{
|
||||||
VLANState *vlan = vc1->vlan;
|
VLANState *vlan = sender->vlan;
|
||||||
VLANClientState *vc;
|
VLANClientState *vc;
|
||||||
|
|
||||||
for (vc = vlan->first_client; vc != NULL; vc = vc->next) {
|
for (vc = vlan->first_client; vc != NULL; vc = vc->next) {
|
||||||
if (vc != vc1) {
|
if (vc == sender) {
|
||||||
if (vc->fd_can_read && vc->fd_can_read(vc->opaque))
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* no fd_can_read() handler, they can always receive */
|
||||||
|
if (!vc->fd_can_read || vc->fd_can_read(vc->opaque)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user