72accec50c05931891ae4b8993fc00b5967aaf02
[openwrt/staging/blogic.git] /
1 From 92fb15513edc6ae1eb51f717e70d4d3d538c2d09 Mon Sep 17 00:00:00 2001
2 From: Pablo Neira Ayuso <pablo@netfilter.org>
3 Date: Mon, 19 Jul 2021 18:04:01 +0200
4 Subject: [PATCH] netfilter: flowtable: remove nf_ct_l4proto_find() call
5
6 TCP and UDP are built-in conntrack protocol trackers and the flowtable
7 only supports for TCP and UDP, remove this call.
8
9 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
10 ---
11 net/netfilter/nf_flow_table_core.c | 10 ----------
12 1 file changed, 10 deletions(-)
13
14 --- a/net/netfilter/nf_flow_table_core.c
15 +++ b/net/netfilter/nf_flow_table_core.c
16 @@ -180,15 +180,10 @@ static void flow_offload_fixup_tcp(struc
17
18 static void flow_offload_fixup_ct_timeout(struct nf_conn *ct)
19 {
20 - const struct nf_conntrack_l4proto *l4proto;
21 struct net *net = nf_ct_net(ct);
22 int l4num = nf_ct_protonum(ct);
23 unsigned int timeout;
24
25 - l4proto = nf_ct_l4proto_find(l4num);
26 - if (!l4proto)
27 - return;
28 -
29 if (l4num == IPPROTO_TCP) {
30 struct nf_tcp_net *tn = nf_tcp_pernet(net);
31
32 @@ -273,15 +268,10 @@ static const struct rhashtable_params nf
33
34 unsigned long flow_offload_get_timeout(struct flow_offload *flow)
35 {
36 - const struct nf_conntrack_l4proto *l4proto;
37 unsigned long timeout = NF_FLOW_TIMEOUT;
38 struct net *net = nf_ct_net(flow->ct);
39 int l4num = nf_ct_protonum(flow->ct);
40
41 - l4proto = nf_ct_l4proto_find(l4num);
42 - if (!l4proto)
43 - return timeout;
44 -
45 if (l4num == IPPROTO_TCP) {
46 struct nf_tcp_net *tn = nf_tcp_pernet(net);
47