From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LwM4j-0006Ri-Qn for qemu-devel@nongnu.org; Tue, 21 Apr 2009 15:56:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LwM4i-0006RF-P7 for qemu-devel@nongnu.org; Tue, 21 Apr 2009 15:56:12 -0400 Received: from [199.232.76.173] (port=39621 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwM4i-0006RB-Kw for qemu-devel@nongnu.org; Tue, 21 Apr 2009 15:56:12 -0400 Received: from savannah.gnu.org ([199.232.41.3]:35647 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LwM4h-0001zq-H4 for qemu-devel@nongnu.org; Tue, 21 Apr 2009 15:56:11 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LwM4f-0007iS-0w for qemu-devel@nongnu.org; Tue, 21 Apr 2009 19:56:09 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LwM4e-0007iO-OR for qemu-devel@nongnu.org; Tue, 21 Apr 2009 19:56:08 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Tue, 21 Apr 2009 19:56:08 +0000 Subject: [Qemu-devel] [7195] net: Check device passed to host_net_remove (Jan Kiszka) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Signed-off-by: Anthony Liguori 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); }