mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-15 10:10:13 +00:00
Avoid segfault on net_tap_init() failure
Check for fd == -1 there. Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
2f859a3c10
commit
929fe49721
@ -399,6 +399,9 @@ int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan
|
|||||||
}
|
}
|
||||||
|
|
||||||
fd = net_tap_init(opts, &vnet_hdr);
|
fd = net_tap_init(opts, &vnet_hdr);
|
||||||
|
if (fd == -1) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s = net_tap_fd_init(vlan, "tap", name, fd, vnet_hdr);
|
s = net_tap_fd_init(vlan, "tap", name, fd, vnet_hdr);
|
||||||
|
Loading…
Reference in New Issue
Block a user