aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/inet_ecn.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/inet_ecn.h')
-rw-r--r--include/net/inet_ecn.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index aab73757bc4d..3bd22795c3e2 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -134,12 +134,14 @@ static inline int INET_ECN_set_ce(struct sk_buff *skb)
134{ 134{
135 switch (skb->protocol) { 135 switch (skb->protocol) {
136 case cpu_to_be16(ETH_P_IP): 136 case cpu_to_be16(ETH_P_IP):
137 if (skb->network_header + sizeof(struct iphdr) <= skb->tail) 137 if (skb_network_header(skb) + sizeof(struct iphdr) <=
138 skb_tail_pointer(skb))
138 return IP_ECN_set_ce(ip_hdr(skb)); 139 return IP_ECN_set_ce(ip_hdr(skb));
139 break; 140 break;
140 141
141 case cpu_to_be16(ETH_P_IPV6): 142 case cpu_to_be16(ETH_P_IPV6):
142 if (skb->network_header + sizeof(struct ipv6hdr) <= skb->tail) 143 if (skb_network_header(skb) + sizeof(struct ipv6hdr) <=
144 skb_tail_pointer(skb))
143 return IP6_ECN_set_ce(ipv6_hdr(skb)); 145 return IP6_ECN_set_ce(ipv6_hdr(skb));
144 break; 146 break;
145 } 147 }