[ovs-dev] [PATCH] sparse: Add guards to prevent FreeBSD-incompatible #include order.

Justin Pettit jpettit at ovn.org
Fri Dec 22 00:50:28 UTC 2017


> On Nov 6, 2017, at 2:42 PM, Ben Pfaff <blp at ovn.org> wrote:

> diff --git a/include/sparse/arpa/inet.h b/include/sparse/arpa/inet.h
> index dd64e61764e8..3634b230c8bb 100644
> --- a/include/sparse/arpa/inet.h
> +++ b/include/sparse/arpa/inet.h
> @@ -18,4 +18,8 @@
> #error "Use this header only with sparse.  It is not a correct implementation."
> #endif
> 
> +#ifndef NETINET_IN_H_INCLUDED
> +#error "Must include <netinet/in.h> before <arpa/inet.h> for FreeBSD support"
> +#endif
> +
> #include <netinet/in.h>

This method was clever.

> diff --git a/lib/lldp/lldpd-structs.h b/lib/lldp/lldpd-structs.h
> index 15e5ce8fa75d..6a3ffb8d33f0 100644
> --- a/lib/lldp/lldpd-structs.h
> +++ b/lib/lldp/lldpd-structs.h
> @@ -20,11 +20,9 @@
> #define _LLDPD_STRUCTS_H
> 
> #include <net/if.h>
> -#ifndef _WIN32
> +#include <sys/types.h>
> #include <netinet/in.h>
> -#endif

Based on other changes, I assume including "<netinet/in.h>" on Windows is fine.  I just wanted to make sure, since it seems like there were some hoops jumped for Windows.

Acked-by: Justin Pettit <jpettit at ovn.org>

--Justin




More information about the dev mailing list