[dpdk-dev] [PATCH 2/2] net: fix header include order for FreeBSD
Ben Pfaff
blp at ovn.org
Fri May 7 21:12:09 CEST 2021
On Fri, May 07, 2021 at 11:06:38AM +0200, David Marchand wrote:
> On Fri, May 7, 2021 at 12:24 AM Dmitry Kozlyuk <dmitry.kozliuk at gmail.com> wrote:
> >
> > 2021-05-06 17:14 (UTC+0200), David Marchand:
> > > Spotted by sparse in OVS build:
> > > ../../lib/netdev-dpdk.c: note: in included file (through
> > > /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_ip.h,
> > > /home/runner/work/ovs/ovs/dpdk-dir/build/include/rte_flow.h, ...):
> > > ../../include/sparse/arpa/inet.h:22:2: error: "Must include
> > > <netinet/in.h> before <arpa/inet.h> for FreeBSD support"
> > >
> > > This is a check enforced by OVS itself.
> > > See [1] for some context.
> > >
> > > 1: https://github.com/openvswitch/ovs/commit/b2befd5bb2db
> > >
> > > Fixes: 89813a522e68 ("net: provide IP-related API on any OS")
> > >
> > > Signed-off-by: David Marchand <david.marchand at redhat.com>
> > > ---
> > > lib/net/rte_ip.h | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h
> > > index 8c189009b0..4b728969c1 100644
> > > --- a/lib/net/rte_ip.h
> > > +++ b/lib/net/rte_ip.h
> > > @@ -22,8 +22,8 @@
> > > #else
> > > #include <sys/socket.h>
> > > #include <sys/types.h>
> > > -#include <arpa/inet.h>
> > > #include <netinet/in.h>
> > > +#include <arpa/inet.h>
> > > #include <netinet/ip.h>
> > > #endif
> > >
> >
> > Acked-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
> >
> > It would be interesting to know exact issue this solves for OVS.
> > Referenced commit only says FreeBSD "insists" on this include order,
> > but DPDK and standalone files with these includes build either way.
>
> Indeed, I tried building with FreeBSD 13.0 and I can see no pb.
> This might be something that has been fixed in FreeBSD.
>
> Ben, would you have details on this header inclusion order?
Using the wrong order caused a compiler error on whatever version of
FreeBSD was current at the time of those commits. I think it was a
historical BSD issue, since I remember running into this for many years
across multiple BSD versions.
If it's fixed now, we can drop the constraint.
More information about the dev
mailing list