diff options
author | Paul Blakey <paulb@mellanox.com> | 2020-03-04 14:49:39 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-04 22:05:04 +0300 |
commit | 4cc5fdec6dfe92f50ef2c6a565dfce694161c769 (patch) | |
tree | ae8b8d5c9207e8bdda7fe8780f6f0791a4ac96d4 /net/sched | |
parent | 07ac9d16b4a5d1cf303215ad7e9829824246be55 (diff) | |
download | linux-4cc5fdec6dfe92f50ef2c6a565dfce694161c769.tar.xz |
net/sched: act_ct: Use pskb_network_may_pull()
To make the filler functions more generic, use network
relative skb pulling.
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/act_ct.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index f434db750328..23eba61f0f81 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -195,7 +195,7 @@ tcf_ct_flow_table_fill_tuple_ipv4(struct sk_buff *skb, unsigned int thoff; struct iphdr *iph; - if (!pskb_may_pull(skb, sizeof(*iph))) + if (!pskb_network_may_pull(skb, sizeof(*iph))) return false; iph = ip_hdr(skb); @@ -212,9 +212,9 @@ tcf_ct_flow_table_fill_tuple_ipv4(struct sk_buff *skb, if (iph->ttl <= 1) return false; - if (!pskb_may_pull(skb, iph->protocol == IPPROTO_TCP ? - thoff + sizeof(struct tcphdr) : - thoff + sizeof(*ports))) + if (!pskb_network_may_pull(skb, iph->protocol == IPPROTO_TCP ? + thoff + sizeof(struct tcphdr) : + thoff + sizeof(*ports))) return false; iph = ip_hdr(skb); @@ -241,7 +241,7 @@ tcf_ct_flow_table_fill_tuple_ipv6(struct sk_buff *skb, struct ipv6hdr *ip6h; unsigned int thoff; - if (!pskb_may_pull(skb, sizeof(*ip6h))) + if (!pskb_network_may_pull(skb, sizeof(*ip6h))) return false; ip6h = ipv6_hdr(skb); @@ -254,9 +254,9 @@ tcf_ct_flow_table_fill_tuple_ipv6(struct sk_buff *skb, return false; thoff = sizeof(*ip6h); - if (!pskb_may_pull(skb, ip6h->nexthdr == IPPROTO_TCP ? - thoff + sizeof(struct tcphdr) : - thoff + sizeof(*ports))) + if (!pskb_network_may_pull(skb, ip6h->nexthdr == IPPROTO_TCP ? + thoff + sizeof(struct tcphdr) : + thoff + sizeof(*ports))) return false; ip6h = ipv6_hdr(skb); |