Commit 4cc5fdec authored by Paul Blakey's avatar Paul Blakey Committed by David S. Miller

net/sched: act_ct: Use pskb_network_may_pull()

To make the filler functions more generic, use network
relative skb pulling.
Signed-off-by: default avatarPaul Blakey <paulb@mellanox.com>
Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 07ac9d16
...@@ -195,7 +195,7 @@ tcf_ct_flow_table_fill_tuple_ipv4(struct sk_buff *skb, ...@@ -195,7 +195,7 @@ tcf_ct_flow_table_fill_tuple_ipv4(struct sk_buff *skb,
unsigned int thoff; unsigned int thoff;
struct iphdr *iph; struct iphdr *iph;
if (!pskb_may_pull(skb, sizeof(*iph))) if (!pskb_network_may_pull(skb, sizeof(*iph)))
return false; return false;
iph = ip_hdr(skb); iph = ip_hdr(skb);
...@@ -212,9 +212,9 @@ tcf_ct_flow_table_fill_tuple_ipv4(struct sk_buff *skb, ...@@ -212,9 +212,9 @@ tcf_ct_flow_table_fill_tuple_ipv4(struct sk_buff *skb,
if (iph->ttl <= 1) if (iph->ttl <= 1)
return false; return false;
if (!pskb_may_pull(skb, iph->protocol == IPPROTO_TCP ? if (!pskb_network_may_pull(skb, iph->protocol == IPPROTO_TCP ?
thoff + sizeof(struct tcphdr) : thoff + sizeof(struct tcphdr) :
thoff + sizeof(*ports))) thoff + sizeof(*ports)))
return false; return false;
iph = ip_hdr(skb); iph = ip_hdr(skb);
...@@ -241,7 +241,7 @@ tcf_ct_flow_table_fill_tuple_ipv6(struct sk_buff *skb, ...@@ -241,7 +241,7 @@ tcf_ct_flow_table_fill_tuple_ipv6(struct sk_buff *skb,
struct ipv6hdr *ip6h; struct ipv6hdr *ip6h;
unsigned int thoff; unsigned int thoff;
if (!pskb_may_pull(skb, sizeof(*ip6h))) if (!pskb_network_may_pull(skb, sizeof(*ip6h)))
return false; return false;
ip6h = ipv6_hdr(skb); ip6h = ipv6_hdr(skb);
...@@ -254,9 +254,9 @@ tcf_ct_flow_table_fill_tuple_ipv6(struct sk_buff *skb, ...@@ -254,9 +254,9 @@ tcf_ct_flow_table_fill_tuple_ipv6(struct sk_buff *skb,
return false; return false;
thoff = sizeof(*ip6h); thoff = sizeof(*ip6h);
if (!pskb_may_pull(skb, ip6h->nexthdr == IPPROTO_TCP ? if (!pskb_network_may_pull(skb, ip6h->nexthdr == IPPROTO_TCP ?
thoff + sizeof(struct tcphdr) : thoff + sizeof(struct tcphdr) :
thoff + sizeof(*ports))) thoff + sizeof(*ports)))
return false; return false;
ip6h = ipv6_hdr(skb); ip6h = ipv6_hdr(skb);
......
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