In Linux 4.5, when CONFIG_NET_CLS_ACT is defined, compilation of out of
tree modules breaks with undeclared functions/constants. The culprit is:

commit fdc5432a7b44ab7de17141beec19d946b9344e91
Author: Daniel Borkmann <dan...@iogearbox.net>
Date:   Thu Jan 7 15:50:22 2016 +0100

    net, sched: add skb_at_tc_ingress helper

which uses G_TC_AT and AT_INGRESS but only includes linux/pkt_cls.h,
which does not include these #defines for oot builds. Unfortunately I'm
not sure what the correct fix is, maybe the uapi folks could help, but i
attached a simple testcase and build log (Makefile is straight from
kernelnewbies).

    Ingo
-- 
 ╭─╮  Kennedy's Lemma:
╭│───╮  If you can parse Perl, you can solve the Halting Problem.
│╰─│─╯
╰──╯  http://www.perlmonks.org/?node_id=663393
#include <net/ipv6.h>
obj-m := fail.o

all:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
make -C /lib/modules/4.5.0-pinguin20160314/build 
M=/home/ingo/src/linux/pkt_cls-bug modules
make[1]: Entering directory '/usr/src/linux-headers-4.5.0-pinguin20160314'
  CC [M]  /home/ingo/src/linux/pkt_cls-bug/fail.o
In file included from include/linux/filter.h:16:0,
                 from include/net/sock.h:64,
                 from include/linux/tcp.h:22,
                 from include/linux/ipv6.h:72,
                 from include/net/ipv6.h:16,
                 from /home/ingo/src/linux/pkt_cls-bug/fail.c:1:
include/net/sch_generic.h: In function ‘skb_at_tc_ingress’:
include/net/sch_generic.h:413:9: error: implicit declaration of function 
‘G_TC_AT’ [-Werror=implicit-function-declaration]
  return G_TC_AT(skb->tc_verd) & AT_INGRESS;
         ^
include/net/sch_generic.h:413:33: error: ‘AT_INGRESS’ undeclared (first use in 
this function)
  return G_TC_AT(skb->tc_verd) & AT_INGRESS;
                                 ^
include/net/sch_generic.h:413:33: note: each undeclared identifier is reported 
only once for each function it appears in
cc1: some warnings being treated as errors
scripts/Makefile.build:264: recipe for target 
'/home/ingo/src/linux/pkt_cls-bug/fail.o' failed
make[2]: *** [/home/ingo/src/linux/pkt_cls-bug/fail.o] Error 1
Makefile:1391: recipe for target '_module_/home/ingo/src/linux/pkt_cls-bug' 
failed
make[1]: *** [_module_/home/ingo/src/linux/pkt_cls-bug] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.5.0-pinguin20160314'
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 2

Reply via email to