Skip to content

Commit 043e397

Browse files
lxinkuba-moo
authored andcommitted
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: Xin Long <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ec84c95 commit 043e397

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

net/sched/act_ct.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ static int tcf_ct_skb_network_trim(struct sk_buff *skb, int family)
707707

708708
switch (family) {
709709
case NFPROTO_IPV4:
710-
len = ntohs(ip_hdr(skb)->tot_len);
710+
len = skb_ip_totlen(skb);
711711
break;
712712
case NFPROTO_IPV6:
713713
len = sizeof(struct ipv6hdr)

net/sched/sch_cake.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ static struct sk_buff *cake_ack_filter(struct cake_sched_data *q,
12091209
iph_check->daddr != iph->daddr)
12101210
continue;
12111211

1212-
seglen = ntohs(iph_check->tot_len) -
1212+
seglen = iph_totlen(skb, iph_check) -
12131213
(4 * iph_check->ihl);
12141214
} else if (iph_check->version == 6) {
12151215
ipv6h = (struct ipv6hdr *)iph;

0 commit comments

Comments
 (0)