diff options
Diffstat (limited to 'net.c')
-rw-r--r-- | net.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1858,14 +1858,20 @@ void net_host_device_remove(Monitor *mon, int vlan_id, const char *device) vlan = qemu_find_vlan(vlan_id); - for(vc = vlan->first_client; vc != NULL; vc = vc->next) - if (!strcmp(vc->name, device)) + for (vc = vlan->first_client; vc != NULL; vc = vc->next) { + if (!strcmp(vc->name, device)) { break; + } + } if (!vc) { monitor_printf(mon, "can't find device %s\n", device); return; } + if (!net_host_check_device(vc->model)) { + monitor_printf(mon, "invalid host network device %s\n", device); + return; + } qemu_del_vlan_client(vc); } |