diff mbox

[ovs-dev,1/2] tc: Fix compile with Glibc < 2.24 and Linux > 4.5.

Message ID 20170619213323.14220-1-joe@ovn.org
State Accepted
Headers show

Commit Message

Joe Stringer June 19, 2017, 9:33 p.m. UTC
linux/pkt_cls.h indirectly includes linux/stddef.h, which may define
__always_inline when using Linux kernel headers 4.6 or later.

netinet/in.h indirectly includes sys/cdefs.h, which before Glibc 2.24
would unconditionally define __always_inline.

This combination of headers causes compilation failure. Resolve the
issue by placing the netinet/in.h include above linux/pkt_cls.h.

Sourceware-BZ: #20215.
Fixes: f98e418fbdb6 ("tc: Add tc flower functions")
Signed-off-by: Joe Stringer <joe@ovn.org>
---
 lib/tc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ben Pfaff July 10, 2017, 6:28 p.m. UTC | #1
On Mon, Jun 19, 2017 at 02:33:22PM -0700, Joe Stringer wrote:
> linux/pkt_cls.h indirectly includes linux/stddef.h, which may define
> __always_inline when using Linux kernel headers 4.6 or later.
> 
> netinet/in.h indirectly includes sys/cdefs.h, which before Glibc 2.24
> would unconditionally define __always_inline.
> 
> This combination of headers causes compilation failure. Resolve the
> issue by placing the netinet/in.h include above linux/pkt_cls.h.
> 
> Sourceware-BZ: #20215.
> Fixes: f98e418fbdb6 ("tc: Add tc flower functions")
> Signed-off-by: Joe Stringer <joe@ovn.org>

Ugh.

Acked-by: Ben Pfaff <blp@ovn.org>
Joe Stringer July 11, 2017, 6:33 p.m. UTC | #2
On 10 July 2017 at 11:28, Ben Pfaff <blp@ovn.org> wrote:
> On Mon, Jun 19, 2017 at 02:33:22PM -0700, Joe Stringer wrote:
>> linux/pkt_cls.h indirectly includes linux/stddef.h, which may define
>> __always_inline when using Linux kernel headers 4.6 or later.
>>
>> netinet/in.h indirectly includes sys/cdefs.h, which before Glibc 2.24
>> would unconditionally define __always_inline.
>>
>> This combination of headers causes compilation failure. Resolve the
>> issue by placing the netinet/in.h include above linux/pkt_cls.h.
>>
>> Sourceware-BZ: #20215.
>> Fixes: f98e418fbdb6 ("tc: Add tc flower functions")
>> Signed-off-by: Joe Stringer <joe@ovn.org>
>
> Ugh.
>
> Acked-by: Ben Pfaff <blp@ovn.org>

Thanks, this was applied to master.
diff mbox

Patch

diff --git a/lib/tc.h b/lib/tc.h
index a472b998f638..61188dd43ec3 100644
--- a/lib/tc.h
+++ b/lib/tc.h
@@ -18,10 +18,10 @@ 
 #ifndef TC_H
 #define TC_H 1
 
+#include <netinet/in.h> /* Must happen before linux/pkt_cls.h - Glibc #20215 */
 #include <linux/pkt_cls.h>
 #include <linux/pkt_sched.h>
 #include <linux/rtnetlink.h>
-#include <netinet/in.h>
 #include "lib/netlink-socket.h"
 #include "odp-netlink.h"
 #include "openvswitch/ofpbuf.h"