Skip to content

Commit

Permalink
[IPV4]: Fix ip_queue_xmit identity increment for TSO packets
Browse files Browse the repository at this point in the history
When ip_queue_xmit calls ip_select_ident_more for IP identity selection
it gives it the wrong packet count for TSO packets.  The ip_select_*
functions expect one less than the number of packets, so we need to
subtract one for TSO packets.

This bug was diagnosed and fixed by Tom Young.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Nov 8, 2005
1 parent a51482b commit 89f5f0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ int ip_queue_xmit(struct sk_buff *skb, int ipfragok)
ip_options_build(skb, opt, inet->daddr, rt, 0);
}

ip_select_ident_more(iph, &rt->u.dst, sk, skb_shinfo(skb)->tso_segs);
ip_select_ident_more(iph, &rt->u.dst, sk,
(skb_shinfo(skb)->tso_segs ?: 1) - 1);

/* Add an IP checksum. */
ip_send_check(iph);
Expand Down

0 comments on commit 89f5f0a

Please sign in to comment.