netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net_sched: fix qdisc_pkt_len_init()
@ 2013-01-16  5:14 Eric Dumazet
  2013-01-16  5:41 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2013-01-16  5:14 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Yuval Mintz

From: Eric Dumazet <edumazet@google.com>

commit 1def9238d4aa2 (net_sched: more precise pkt_len computation)
does a wrong computation of mac + network headers length, as it includes
the padding before the frame.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Yuval Mintz <yuvalmin@broadcom.com>
---
 net/core/dev.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 862eaa7..b6d2b32 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2776,8 +2776,12 @@ static void qdisc_pkt_len_init(struct sk_buff *skb)
 	 * we add to pkt_len the headers size of all segments
 	 */
 	if (shinfo->gso_size)  {
-		unsigned int hdr_len = skb_transport_offset(skb);
+		unsigned int hdr_len;
 
+		/* mac layer + network layer */
+		hdr_len = skb_transport_header(skb) - skb_mac_header(skb);
+
+		/* + transport layer */
 		if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)))
 			hdr_len += tcp_hdrlen(skb);
 		else

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net_sched: fix qdisc_pkt_len_init()
  2013-01-16  5:14 [PATCH net-next] net_sched: fix qdisc_pkt_len_init() Eric Dumazet
@ 2013-01-16  5:41 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-01-16  5:41 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, yuvalmin

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 15 Jan 2013 21:14:21 -0800

> From: Eric Dumazet <edumazet@google.com>
> 
> commit 1def9238d4aa2 (net_sched: more precise pkt_len computation)
> does a wrong computation of mac + network headers length, as it includes
> the padding before the frame.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Yuval Mintz <yuvalmin@broadcom.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-16  5:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-16  5:14 [PATCH net-next] net_sched: fix qdisc_pkt_len_init() Eric Dumazet
2013-01-16  5:41 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).