fix dhcp with multiple nics an SLIRP
PATCH 1/1 fix dhcp with multiple nics an SLIRP
The check in qemu_can_send_packet() does not work correctly when using multiple nics. I found the problem when using -boot n and having more than one nic in use with the SLIRP networking. The qemu_can_send_packet() is only called as a part of the SLIRP networking check to see if there is a valid interface that packets can be sent on.
Using the attached patch, a pxe boot can be used with more than one nic, in particular using nics of different types. I also tested to make sure it still worked with a single nic as well.
Signed-off-by Jason Wessel <[email protected]>
Jason.
--- vl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
vl.c +3 -3
@@ -3195,11 +3195,11 @@ int qemu_can_send_packet(VLANClientStatefor (vc = vlan->first_client; vc !=NULL ; vc = vc->next) {if (vc != vc1) { -if (vc->fd_can_read && !vc->fd_can_read (vc->opaque)) -return 0 ; +if (vc->fd_can_read && vc->fd_can_read (vc->opaque)) +return 1 ; } } -return 1 ; +return 0 ; }void qemu_send_packet (VLANClientState *vc1,const uint8_t *buf,int size)