[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/7] net: Check device passed to host_net_remove
From: |
Mark McLoughlin |
Subject: |
Re: [Qemu-devel] [PATCH 3/7] net: Check device passed to host_net_remove |
Date: |
Wed, 15 Apr 2009 14:09:47 +0100 |
On Tue, 2009-04-14 at 19:29 +0200, Jan Kiszka wrote:
> Make sure that we do not delete guest NICs via host_net_remove.
>
> Signed-off-by: Jan Kiszka <address@hidden>
> ---
>
> net.c | 11 +++++++++--
> 1 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/net.c b/net.c
> index 36c0509..787f249 100644
> --- a/net.c
> +++ b/net.c
> @@ -1861,9 +1861,16 @@ void net_host_device_remove(Monitor *mon, int vlan_id,
> const char *device)
> return;
> }
>
> - for(vc = vlan->first_client; vc != NULL; vc = vc->next)
> - if (!strcmp(vc->name, device))
> + if (!net_host_check_device(device)) {
> + monitor_printf(mon, "invalid host network device %s\n", device);
> + return;
> + }
Doesn't this mean that if you assign a name with e.g. "name=foo1234" you
won't be able to remove it?
Probably makes more sense to find the client, then check vc->model using
net_host_check_device()?
Cheers,
Mark.
- Re: [Qemu-devel] [PATCH 1/7] net: Fix -net socket,listen, (continued)
[Qemu-devel] [PATCH 3/7] net: Check device passed to host_net_remove, Jan Kiszka, 2009/04/14
- Re: [Qemu-devel] [PATCH 3/7] net: Check device passed to host_net_remove,
Mark McLoughlin <=
[Qemu-devel] [PATCH 7/7] slirp: Handle DHCP requests for specific IP, Jan Kiszka, 2009/04/14
[Qemu-devel] [PATCH 5/7] monitor: Improve host_net_add, Jan Kiszka, 2009/04/14
[Qemu-devel] [PATCH 6/7] net: Add support for capturing VLANs, Jan Kiszka, 2009/04/14