Skip to content

Commit

Permalink
tc: Fix compile with Glibc < 2.24 and Linux > 4.5.
Browse files Browse the repository at this point in the history
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: f98e418 ("tc: Add tc flower functions")
Signed-off-by: Joe Stringer <[email protected]>
Tested-by: Greg Rose <[email protected]>
Acked-by: Greg Rose <[email protected]>
  • Loading branch information
joestringer committed Jun 19, 2017
1 parent 2a85b7c commit de4a611
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit de4a611

Please sign in to comment.