[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] linux-user: add SIOCADDRT/SIOCDELRT support
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] linux-user: add SIOCADDRT/SIOCDELRT support |
Date: |
Thu, 13 Jun 2013 17:53:04 +0100 |
On 27 May 2013 19:48, Laurent Vivier <address@hidden> wrote:
> This allows to pass the device name.
>
> You can test this with the "route" command.
>
> WITHOUT this patch:
>
> $ sudo route add -net default gw 10.0.3.1 eth0
> SIOCADDRT: Bad address
> $ netstat -nr
> Kernel IP routing table
> Destination Gateway Genmask Flags MSS Window irtt Ifa
> 10.0.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth
>
> WITH this patch:
>
> $ sudo route add -net default gw 10.0.3.1 eth0
> $ netstat -nr
> Kernel IP routing table
> Destination Gateway Genmask Flags MSS Window irtt Ifa
> 0.0.0.0 10.0.3.1 0.0.0.0 UG 0 0 0 eth
> 10.0.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth
>
> Signed-off-by: Laurent Vivier <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Incidentally, the command works without the patch if the
guest base is zero (eg x86_64-on-x86_64); but now we use
guest base more often so the patch is required.
(Having thunk_convert treat pointers in structs just like
longs, ie simple byteswap, is a bit dubious. I'd be tempted
to put in a warning at least if we hit that code path,
except I suspect we have some current uses which do a
thunk_convert of the whole struct and then fix up the
pointer afterwards.)
thanks
-- PMM