Skip to content

Commit

Permalink
netfilter: flowtable: remove nf_ct_l4proto_find() call
Browse files Browse the repository at this point in the history
TCP and UDP are built-in conntrack protocol trackers and the flowtable
only supports for TCP and UDP, remove this call.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
ummakynes authored and intel-lab-lkp committed Jul 18, 2021
1 parent 2c7664f commit 5f2c0c9
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions net/netfilter/nf_flow_table_core.c
Expand Up @@ -180,15 +180,10 @@ static void flow_offload_fixup_tcp(struct ip_ct_tcp *tcp)

static void flow_offload_fixup_ct_timeout(struct nf_conn *ct)
{
const struct nf_conntrack_l4proto *l4proto;
struct net *net = nf_ct_net(ct);
int l4num = nf_ct_protonum(ct);
unsigned int timeout;

l4proto = nf_ct_l4proto_find(l4num);
if (!l4proto)
return;

if (l4num == IPPROTO_TCP) {
struct nf_tcp_net *tn = nf_tcp_pernet(net);

Expand All @@ -197,8 +192,6 @@ static void flow_offload_fixup_ct_timeout(struct nf_conn *ct)
struct nf_udp_net *tn = nf_udp_pernet(net);

timeout = tn->offload_pickup;
} else {
return;
}

if (nf_flow_timeout_delta(ct->timeout) > (__s32)timeout)
Expand Down Expand Up @@ -273,15 +266,10 @@ static const struct rhashtable_params nf_flow_offload_rhash_params = {

unsigned long flow_offload_get_timeout(struct flow_offload *flow)
{
const struct nf_conntrack_l4proto *l4proto;
unsigned long timeout = NF_FLOW_TIMEOUT;
struct net *net = nf_ct_net(flow->ct);
int l4num = nf_ct_protonum(flow->ct);

l4proto = nf_ct_l4proto_find(l4num);
if (!l4proto)
return timeout;

if (l4num == IPPROTO_TCP) {
struct nf_tcp_net *tn = nf_tcp_pernet(net);

Expand Down

0 comments on commit 5f2c0c9

Please sign in to comment.