diff mbox series

[ovs-dev] sparse: Add a guard for netinet/ip6.h header on FreeBSD.

Message ID 20220919115017.1220496-1-i.maximets@ovn.org
State Superseded
Headers show
Series [ovs-dev] sparse: Add a guard for netinet/ip6.h header on FreeBSD. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test fail github build: failed
ovsrobot/intel-ovs-compilation success test: success

Commit Message

Ilya Maximets Sept. 19, 2022, 11:50 a.m. UTC
Same as netinet/in.h, the netinet/ip6.h on FreeBSD requires
sys/types.h to be included first.  So, adding a similar guard.

We do have FreeBSD CI these days, but it is still nice to have
a more clear error message.

Fixes: b2befd5bb2db ("sparse: Add guards to prevent FreeBSD-incompatible #include order.")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 include/sparse/netinet/ip6.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Emma Finn Sept. 20, 2022, 10:01 a.m. UTC | #1
> -----Original Message-----
> From: Ilya Maximets <i.maximets@ovn.org>
> Sent: Monday 19 September 2022 12:50
> To: ovs-dev@openvswitch.org
> Cc: Finn, Emma <emma.finn@intel.com>; Ilya Maximets <i.maximets@ovn.org>
> Subject: [PATCH] sparse: Add a guard for netinet/ip6.h header on FreeBSD.
> 
> Same as netinet/in.h, the netinet/ip6.h on FreeBSD requires sys/types.h to be
> included first.  So, adding a similar guard.
> 
> We do have FreeBSD CI these days, but it is still nice to have a more clear error
> message.
> 
> Fixes: b2befd5bb2db ("sparse: Add guards to prevent FreeBSD-incompatible
> #include order.")
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---
>  include/sparse/netinet/ip6.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/sparse/netinet/ip6.h b/include/sparse/netinet/ip6.h index
> bfa637a46..3beef3705 100644
> --- a/include/sparse/netinet/ip6.h
> +++ b/include/sparse/netinet/ip6.h
> @@ -18,6 +18,10 @@
>  #error "Use this header only with sparse.  It is not a correct implementation."
>  #endif
> 
> +#ifndef SYS_TYPES_H_INCLUDED
> +#error "Must include <sys/types.h> before <netinet/ip6.h> for FreeBSD
> support"
> +#endif
> +
>  #ifndef __NETINET_IP6_SPARSE
>  #define __NETINET_IP6_SPARSE 1
> 
> --
> 2.37.3

The change looks good to me.

Acked-by: Emma Finn <emma.finn@intel.com>
Ilya Maximets Sept. 26, 2022, 8:49 p.m. UTC | #2
On 9/20/22 12:01, Finn, Emma wrote:
>> -----Original Message-----
>> From: Ilya Maximets <i.maximets@ovn.org>
>> Sent: Monday 19 September 2022 12:50
>> To: ovs-dev@openvswitch.org
>> Cc: Finn, Emma <emma.finn@intel.com>; Ilya Maximets <i.maximets@ovn.org>
>> Subject: [PATCH] sparse: Add a guard for netinet/ip6.h header on FreeBSD.
>>
>> Same as netinet/in.h, the netinet/ip6.h on FreeBSD requires sys/types.h to be
>> included first.  So, adding a similar guard.
>>
>> We do have FreeBSD CI these days, but it is still nice to have a more clear error
>> message.
>>
>> Fixes: b2befd5bb2db ("sparse: Add guards to prevent FreeBSD-incompatible
>> #include order.")
>> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
>> ---
>>  include/sparse/netinet/ip6.h | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/include/sparse/netinet/ip6.h b/include/sparse/netinet/ip6.h index
>> bfa637a46..3beef3705 100644
>> --- a/include/sparse/netinet/ip6.h
>> +++ b/include/sparse/netinet/ip6.h
>> @@ -18,6 +18,10 @@
>>  #error "Use this header only with sparse.  It is not a correct implementation."
>>  #endif
>>
>> +#ifndef SYS_TYPES_H_INCLUDED
>> +#error "Must include <sys/types.h> before <netinet/ip6.h> for FreeBSD
>> support"
>> +#endif
>> +
>>  #ifndef __NETINET_IP6_SPARSE
>>  #define __NETINET_IP6_SPARSE 1
>>
>> --
>> 2.37.3
> 
> The change looks good to me.
> 
> Acked-by: Emma Finn <emma.finn@intel.com>
> 
> 

Hmm.  It looks like we actually need netinet/in.h here instead for
ip6 structures.   netinet/in.h by itself requires sys/types.h, so
that will cover basic types.

I'll send an updated patch.

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/include/sparse/netinet/ip6.h b/include/sparse/netinet/ip6.h
index bfa637a46..3beef3705 100644
--- a/include/sparse/netinet/ip6.h
+++ b/include/sparse/netinet/ip6.h
@@ -18,6 +18,10 @@ 
 #error "Use this header only with sparse.  It is not a correct implementation."
 #endif
 
+#ifndef SYS_TYPES_H_INCLUDED
+#error "Must include <sys/types.h> before <netinet/ip6.h> for FreeBSD support"
+#endif
+
 #ifndef __NETINET_IP6_SPARSE
 #define __NETINET_IP6_SPARSE 1