mirror of
https://github.com/qemu/qemu.git
synced 2025-08-08 17:04:34 +00:00
net: Fix -net socket,listen (Jan Kiszka)
In case no symbolic name is provided when requesting VLAN connection via listening TCP socket ('-net socket,listen=...'), qemu crashes. This fixes the cause. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7196 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
e8f1f9db87
commit
ea053add70
2
net.c
2
net.c
@ -1472,7 +1472,7 @@ static int net_socket_listen_init(VLANState *vlan,
|
|||||||
}
|
}
|
||||||
s->vlan = vlan;
|
s->vlan = vlan;
|
||||||
s->model = strdup(model);
|
s->model = strdup(model);
|
||||||
s->name = strdup(name);
|
s->name = name ? strdup(name) : NULL;
|
||||||
s->fd = fd;
|
s->fd = fd;
|
||||||
qemu_set_fd_handler(fd, net_socket_accept, NULL, s);
|
qemu_set_fd_handler(fd, net_socket_accept, NULL, s);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user