Re: [Qemu-devel] [PATCH v3] slirp: fix ICMP handling on macOS hosts

2018-08-15 Thread Andrew Oates via Qemu-devel
On Wed, Aug 15, 2018 at 7:03 AM Samuel Thibault wrote: > Andrew Oates, le mar. 14 août 2018 22:35:21 -0400, a ecrit: > > On Linux, SOCK_DGRAM+IPPROTO_ICMP sockets give only the ICMP packet when > > read from. On macOS, however, the socket acts like a SOCK_RAW socket > > and includes the IP

[Qemu-devel] [PATCH v3] slirp: fix ICMP handling on macOS hosts

2018-08-14 Thread Andrew Oates via Qemu-devel
On Linux, SOCK_DGRAM+IPPROTO_ICMP sockets give only the ICMP packet when read from. On macOS, however, the socket acts like a SOCK_RAW socket and includes the IP header as well. This change strips the extra IP header from the received packet on macOS before sending it to the guest. SOCK_DGRAM

Re: [Qemu-devel] [PULL 1/1] slirp: fix ICMP handling on macOS hosts

2018-08-14 Thread Andrew Oates via Qemu-devel
On Tue, Aug 14, 2018 at 11:52 AM Peter Maydell wrote: > On 12 August 2018 at 04:11, Andrew Oates wrote: > > Ping --- would you like me to resubmit the patch using CONFIG_BSD? > > Yes, that seems our best option. Could you please also include > a comment that summarises the behaviour of the

Re: [Qemu-devel] [PATCH] target-i386: Fix lcall to call gate in IA-32e mode

2018-08-12 Thread Andrew Oates via Qemu-devel
On Sun, Aug 12, 2018 at 6:17 AM Paolo Bonzini wrote: > On 12/08/2018 05:07, Andrew Oates via Qemu-devel wrote: > > Currently call gates are always treated as 32-bit gates. In IA-32e mode > > (either compatibility or 64-bit submode), system segment descriptors are > > alw

Re: [Qemu-devel] [PULL 1/1] slirp: fix ICMP handling on macOS hosts

2018-08-11 Thread Andrew Oates via Qemu-devel
Ping --- would you like me to resubmit the patch using CONFIG_BSD? Cheers, ~Andrew On Wed, Aug 1, 2018 at 10:39 AM Andrew Oates wrote: > > > > On Wed, Aug 1, 2018 at 6:10 AM Peter Maydell > wrote: > >> On 1 August 2018 at 00:25, Andrew Oates wrote: >> > Both CONFIG_BSD and not-CONFIG_LINUX

[Qemu-devel] [PATCH] target-i386: Fix lcall to call gate in IA-32e mode

2018-08-11 Thread Andrew Oates via Qemu-devel
Currently call gates are always treated as 32-bit gates. In IA-32e mode (either compatibility or 64-bit submode), system segment descriptors are always 64-bit. Treating them as 32-bit has the expected unfortunate effect: only the lower 32 bits of the offset are loaded, the stack pointer is

Re: [Qemu-devel] [PULL 1/1] slirp: fix ICMP handling on macOS hosts

2018-08-01 Thread Andrew Oates via Qemu-devel
On Wed, Aug 1, 2018 at 6:10 AM Peter Maydell wrote: > On 1 August 2018 at 00:25, Andrew Oates wrote: > > Both CONFIG_BSD and not-CONFIG_LINUX work on macOS. I unfortunately > don't > > have access to any other BSDs to test them, though. > > Is there an easy way to test it? The QEMU makefiles

Re: [Qemu-devel] [PULL 1/1] slirp: fix ICMP handling on macOS hosts

2018-07-31 Thread Andrew Oates via Qemu-devel
On Tue, Jul 31, 2018 at 6:22 AM Peter Maydell wrote: > On 31 July 2018 at 02:16, Andrew Oates wrote: > > Yeah, I suspect (but haven't tested) that this applies to all BSDs. We > > could switch CONFIG_DARWIN to CONFIG_BSD (happy to resend the patch, just > > LMK). > > > > Agreed that

Re: [Qemu-devel] [PULL 1/1] slirp: fix ICMP handling on macOS hosts

2018-07-30 Thread Andrew Oates via Qemu-devel
Yeah, I suspect (but haven't tested) that this applies to all BSDs. We could switch CONFIG_DARWIN to CONFIG_BSD (happy to resend the patch, just LMK). Agreed that platform-specific ifdefs are gross, but I don't see a better way here :/ One option would be to look at the packet length and

Re: [Qemu-devel] [PATCH] slirp: fix ICMP handling on macOS hosts

2018-07-28 Thread Andrew Oates via Qemu-devel
On Sat, Jul 28, 2018, 13:53 Samuel Thibault wrote: > Hello, > > aoa...@google.com, le mer. 25 juil. 2018 21:08:12 -0400, a ecrit: > > From: Andrew Oates > > > > On Linux, SOCK_DGRAM+IPPROTO_ICMP sockets give only the ICMP packet when > > read from. On macOS, however, the socket acts like a