Same as arpa/inet.h, the netinet/ip6.h on FreeBSD requires
netinet/in.h to be included first.  So, adding a similar guard.

Also fixing one instance where this is not respected at the moment.

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 <[email protected]>
---

Version 2:
  - Switched the guard from sys/types.h to netinet/in.h since
    struct ip6_addr is defined there.  Fixed one instance where
    this is not respected at the moment.

 include/sparse/netinet/ip6.h | 4 ++++
 lib/netdev-offload-dpdk.c    | 1 +
 2 files changed, 5 insertions(+)

diff --git a/include/sparse/netinet/ip6.h b/include/sparse/netinet/ip6.h
index bfa637a46..b2b6f47d9 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 NETINET_IN_H_INCLUDED
+#error "Must include <netinet/in.h> before <netinet/ip6.h> for FreeBSD support"
+#endif
+
 #ifndef __NETINET_IP6_SPARSE
 #define __NETINET_IP6_SPARSE 1
 
diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index cceefbc50..80a64a6cc 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -17,6 +17,7 @@
 #include <config.h>
 
 #include <sys/types.h>
+#include <netinet/in.h>
 #include <netinet/ip6.h>
 #include <rte_ethdev.h>
 #include <rte_flow.h>
-- 
2.37.3

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to