netdev
[Top] [All Lists]

[PATCH] NET: Fix calculation for collapsed skb size

To: "David S. Miller" <davem@xxxxxxxxxxxxx>
Subject: [PATCH] NET: Fix calculation for collapsed skb size
From: Thomas Graf <tgraf@xxxxxxx>
Date: Mon, 7 Feb 2005 15:27:42 +0100
Cc: kuznet@xxxxxxxxxxxxx, herbert@xxxxxxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20050206223239.5dc4e325.davem@xxxxxxxxxxxxx>
References: <20050128230327.GV31837@xxxxxxxxxxxxxx> <E1CufRB-0000zf-00@xxxxxxxxxxxxxxxxxxxxxxxx> <20050128234828.GA24868@xxxxxxxxxxxxxxx> <20050129002128.GX31837@xxxxxxxxxxxxxx> <20050129002701.GY31837@xxxxxxxxxxxxxx> <20050206223239.5dc4e325.davem@xxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
patch also applies to 2.4 with some fuzz.

Noticed by Denis V. Lunev <den@xxxxxxxxxxx>

Signed-off-by: Thomas Graf <tgraf@xxxxxxx>

--- linux-2.6.11-rc3-bk3.orig/net/ipv4/tcp_input.c      2005-02-07 
09:47:02.000000000 -0500
+++ linux-2.6.11-rc3-bk3/net/ipv4/tcp_input.c   2005-02-07 09:50:20.000000000 
-0500
@@ -3760,8 +3760,7 @@
        while (before(start, end)) {
                struct sk_buff *nskb;
                int header = skb_headroom(skb);
-               int copy = (PAGE_SIZE - sizeof(struct sk_buff) -
-                           sizeof(struct skb_shared_info) - header - 31)&~15;
+               int copy = SKB_MAX_ORDER(header, 0);
 
                /* Too big header? This can happen with IPv6. */
                if (copy < 0)

<Prev in Thread] Current Thread [Next in Thread>