On Tue, Jul 31, 2018 at 6:22 AM Peter Maydell <peter.mayd...@linaro.org>
wrote:

> On 31 July 2018 at 02:16, Andrew Oates <aoa...@google.com> 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 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 contents to
> > try to determine if there's an IP header before the ICMP header, but that
> > seems pretty iffy.  Creating ICMP sockets often requires special
> privileges
> > or configuration (e.g. on Linux) so I don't think it could easily be
> done at
> > configure-time to test the host machine's configuration.
>
> Mmm. I guess using CONFIG_BSD, or perhaps even not-CONFIG_LINUX,
> would be best. Is there an easy way to test this?
> (Our other two supported host OSes are the Solarises and Haiku;
> no idea if either of those support ICMP sockets or what their
> behaviour is here...)
>

Both CONFIG_BSD and not-CONFIG_LINUX work on macOS.  I unfortunately don't
have access to any other BSDs to test them, though.

~Andrew

>
> thanks
> -- PMM
>

Reply via email to