qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [7195] net: Check device passed to host_net_remove (Jan Kis


From: Anthony Liguori
Subject: [Qemu-devel] [7195] net: Check device passed to host_net_remove (Jan Kiszka)
Date: Tue, 21 Apr 2009 19:56:08 +0000

Revision: 7195
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7195
Author:   aliguori
Date:     2009-04-21 19:56:08 +0000 (Tue, 21 Apr 2009)
Log Message:
-----------
net: Check device passed to host_net_remove (Jan Kiszka)

Make sure that we do not delete guest NICs via host_net_remove.

Signed-off-by: Jan Kiszka <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>

Modified Paths:
--------------
    trunk/net.c

Modified: trunk/net.c
===================================================================
--- trunk/net.c 2009-04-21 01:41:10 UTC (rev 7194)
+++ trunk/net.c 2009-04-21 19:56:08 UTC (rev 7195)
@@ -1858,14 +1858,20 @@
 
     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);
 }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]