Commit 043e397e authored by Xin Long's avatar Xin Long Committed by Jakub Kicinski

net: sched: use skb_ip_totlen and iph_totlen

There are 1 action and 1 qdisc that may process IPv4 TCP GSO packets
and access iph->tot_len, replace them with skb_ip_totlen() and
iph_totlen() accordingly.

Note that we don't need to replace the one in tcf_csum_ipv4(), as it
will return for TCP GSO packets in tcf_csum_ipv4_tcp().
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ec84c955
...@@ -707,7 +707,7 @@ static int tcf_ct_skb_network_trim(struct sk_buff *skb, int family) ...@@ -707,7 +707,7 @@ static int tcf_ct_skb_network_trim(struct sk_buff *skb, int family)
switch (family) { switch (family) {
case NFPROTO_IPV4: case NFPROTO_IPV4:
len = ntohs(ip_hdr(skb)->tot_len); len = skb_ip_totlen(skb);
break; break;
case NFPROTO_IPV6: case NFPROTO_IPV6:
len = sizeof(struct ipv6hdr) len = sizeof(struct ipv6hdr)
......
...@@ -1209,7 +1209,7 @@ static struct sk_buff *cake_ack_filter(struct cake_sched_data *q, ...@@ -1209,7 +1209,7 @@ static struct sk_buff *cake_ack_filter(struct cake_sched_data *q,
iph_check->daddr != iph->daddr) iph_check->daddr != iph->daddr)
continue; continue;
seglen = ntohs(iph_check->tot_len) - seglen = iph_totlen(skb, iph_check) -
(4 * iph_check->ihl); (4 * iph_check->ihl);
} else if (iph_check->version == 6) { } else if (iph_check->version == 6) {
ipv6h = (struct ipv6hdr *)iph; ipv6h = (struct ipv6hdr *)iph;
......
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