Commit 1b9cd769 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: flowtable: refresh timeout after dst and writable checks

Refresh the timeout (and retry hardware offload) once the skbuff dst
is confirmed to be current and after the skbuff is made writable.
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent e5075c0b
...@@ -246,8 +246,6 @@ nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb, ...@@ -246,8 +246,6 @@ nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb,
if (nf_flow_state_check(flow, iph->protocol, skb, thoff)) if (nf_flow_state_check(flow, iph->protocol, skb, thoff))
return NF_ACCEPT; return NF_ACCEPT;
flow_offload_refresh(flow_table, flow);
if (!dst_check(&rt->dst, 0)) { if (!dst_check(&rt->dst, 0)) {
flow_offload_teardown(flow); flow_offload_teardown(flow);
return NF_ACCEPT; return NF_ACCEPT;
...@@ -256,6 +254,8 @@ nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb, ...@@ -256,6 +254,8 @@ nf_flow_offload_ip_hook(void *priv, struct sk_buff *skb,
if (skb_try_make_writable(skb, thoff + hdrsize)) if (skb_try_make_writable(skb, thoff + hdrsize))
return NF_DROP; return NF_DROP;
flow_offload_refresh(flow_table, flow);
iph = ip_hdr(skb); iph = ip_hdr(skb);
nf_flow_nat_ip(flow, skb, thoff, dir, iph); nf_flow_nat_ip(flow, skb, thoff, dir, iph);
...@@ -466,8 +466,6 @@ nf_flow_offload_ipv6_hook(void *priv, struct sk_buff *skb, ...@@ -466,8 +466,6 @@ nf_flow_offload_ipv6_hook(void *priv, struct sk_buff *skb,
sizeof(*ip6h))) sizeof(*ip6h)))
return NF_ACCEPT; return NF_ACCEPT;
flow_offload_refresh(flow_table, flow);
if (!dst_check(&rt->dst, 0)) { if (!dst_check(&rt->dst, 0)) {
flow_offload_teardown(flow); flow_offload_teardown(flow);
return NF_ACCEPT; return NF_ACCEPT;
...@@ -476,6 +474,8 @@ nf_flow_offload_ipv6_hook(void *priv, struct sk_buff *skb, ...@@ -476,6 +474,8 @@ nf_flow_offload_ipv6_hook(void *priv, struct sk_buff *skb,
if (skb_try_make_writable(skb, sizeof(*ip6h) + hdrsize)) if (skb_try_make_writable(skb, sizeof(*ip6h) + hdrsize))
return NF_DROP; return NF_DROP;
flow_offload_refresh(flow_table, flow);
ip6h = ipv6_hdr(skb); ip6h = ipv6_hdr(skb);
nf_flow_nat_ipv6(flow, skb, dir, ip6h); nf_flow_nat_ipv6(flow, skb, dir, ip6h);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment