[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1429724760-10075-1-git-send-email-xiyou.wangcong@gmail.com>
Date: Wed, 22 Apr 2015 10:45:57 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: netdev@...r.kernel.org
Cc: intel-wired-lan@...ts.osuosl.org,
Cong Wang <xiyou.wangcong@...il.com>,
Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Subject: [Patch net] igb: pass the correct maxlen for eth_get_headlen()
The second parameter of eth_get_headlen() is the length of
the frame buffer, not the header length of skb.
Cc: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index a0a9b1f..7b3a370 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -6852,7 +6852,9 @@ static void igb_pull_tail(struct igb_ring *rx_ring,
/* we need the header to contain the greater of either ETH_HLEN or
* 60 bytes if the skb->len is less than 60 for skb_pad.
*/
- pull_len = eth_get_headlen(va, IGB_RX_HDR_LEN);
+ pull_len = eth_get_headlen(va, skb_frag_size(frag));
+ if (unlikely(pull_len > IGB_RX_HDR_LEN))
+ pull_len = IGB_RX_HDR_LEN;
/* align pull length to size of long to optimize memcpy performance */
skb_copy_to_linear_data(skb, va, ALIGN(pull_len, sizeof(long)));
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists