kernel: mark source kernel for netfilter backports
[openwrt/staging/wigyori.git] / target / linux / generic / backport-4.14 / 346-v4.16-netfilter-flowtable-infrastructure-depends-on-NETFIL.patch
1 From: Pablo Neira Ayuso <pablo@netfilter.org>
2 Date: Wed, 31 Jan 2018 18:13:39 +0100
3 Subject: [PATCH] netfilter: flowtable infrastructure depends on
4 NETFILTER_INGRESS
5
6 config NF_FLOW_TABLE depends on NETFILTER_INGRESS. If users forget to
7 enable this toggle, flowtable registration fails with EOPNOTSUPP.
8
9 Moreover, turn 'select NF_FLOW_TABLE' in every flowtable family flavour
10 into dependency instead, otherwise this new dependency on
11 NETFILTER_INGRESS causes a warning. This also allows us to remove the
12 explicit dependency between family flowtables <-> NF_TABLES and
13 NF_CONNTRACK, given they depend on the NF_FLOW_TABLE core that already
14 expresses the general dependencies for this new infrastructure.
15
16 Moreover, NF_FLOW_TABLE_INET depends on NF_FLOW_TABLE_IPV4 and
17 NF_FLOWTABLE_IPV6, which already depends on NF_FLOW_TABLE. So we can get
18 rid of direct dependency with NF_FLOW_TABLE.
19
20 In general, let's avoid 'select', it just makes things more complicated.
21
22 Reported-by: John Crispin <john@phrozen.org>
23 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
24 ---
25
26 --- a/net/ipv4/netfilter/Kconfig
27 +++ b/net/ipv4/netfilter/Kconfig
28 @@ -79,8 +79,7 @@ endif # NF_TABLES
29
30 config NF_FLOW_TABLE_IPV4
31 tristate "Netfilter flow table IPv4 module"
32 - depends on NF_CONNTRACK && NF_TABLES
33 - select NF_FLOW_TABLE
34 + depends on NF_FLOW_TABLE
35 help
36 This option adds the flow table IPv4 support.
37
38 --- a/net/ipv6/netfilter/Kconfig
39 +++ b/net/ipv6/netfilter/Kconfig
40 @@ -73,8 +73,7 @@ endif # NF_TABLES
41
42 config NF_FLOW_TABLE_IPV6
43 tristate "Netfilter flow table IPv6 module"
44 - depends on NF_CONNTRACK && NF_TABLES
45 - select NF_FLOW_TABLE
46 + depends on NF_FLOW_TABLE
47 help
48 This option adds the flow table IPv6 support.
49
50 --- a/net/netfilter/Kconfig
51 +++ b/net/netfilter/Kconfig
52 @@ -670,8 +670,8 @@ endif # NF_TABLES
53
54 config NF_FLOW_TABLE_INET
55 tristate "Netfilter flow table mixed IPv4/IPv6 module"
56 - depends on NF_FLOW_TABLE_IPV4 && NF_FLOW_TABLE_IPV6
57 - select NF_FLOW_TABLE
58 + depends on NF_FLOW_TABLE_IPV4
59 + depends on NF_FLOW_TABLE_IPV6
60 help
61 This option adds the flow table mixed IPv4/IPv6 support.
62
63 @@ -679,7 +679,9 @@ config NF_FLOW_TABLE_INET
64
65 config NF_FLOW_TABLE
66 tristate "Netfilter flow table module"
67 - depends on NF_CONNTRACK && NF_TABLES
68 + depends on NETFILTER_INGRESS
69 + depends on NF_CONNTRACK
70 + depends on NF_TABLES
71 help
72 This option adds the flow table core infrastructure.
73