[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 02/11] net: Check device passed to host_net_remov
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH v2 02/11] net: Check device passed to host_net_remove |
Date: |
Sun, 19 Apr 2009 12:04:25 +0200 |
User-agent: |
StGIT/0.14.2 |
Make sure that we do not delete guest NICs via host_net_remove.
Signed-off-by: Jan Kiszka <address@hidden>
---
net.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/net.c b/net.c
index 77c5820..ff6230c 100644
--- a/net.c
+++ b/net.c
@@ -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);
}
- [Qemu-devel] [PATCH v2 00/11] Various small networking improvements, Jan Kiszka, 2009/04/19
- [Qemu-devel] [PATCH v2 03/11] net: Prevent multiple slirp instances, Jan Kiszka, 2009/04/19
- [Qemu-devel] [PATCH v2 02/11] net: Check device passed to host_net_remove,
Jan Kiszka <=
- [Qemu-devel] [PATCH v2 01/11] net: Fix -net socket,listen, Jan Kiszka, 2009/04/19
- [Qemu-devel] [PATCH v2 07/11] net: Add parameter checks for VLAN clients, Jan Kiszka, 2009/04/19
- [Qemu-devel] [PATCH v2 10/11] slirp: Handle DHCP requests for specific IP, Jan Kiszka, 2009/04/19
- [Qemu-devel] [PATCH v2 06/11] Allow empty params for check_params, Jan Kiszka, 2009/04/19
- [Qemu-devel] [PATCH v2 09/11] net: Add support for capturing VLANs, Jan Kiszka, 2009/04/19
- [Qemu-devel] [PATCH v2 04/11] monitor: Improve host_net_add, Jan Kiszka, 2009/04/19
- [Qemu-devel] [PATCH v2 05/11] monitor: Allow host_net_add/remove for all targets, Jan Kiszka, 2009/04/19
- [Qemu-devel] [PATCH v2 11/11] slirp: Enhance host-guest redirection setup, Jan Kiszka, 2009/04/19