Skip to content

Commit

Permalink
fec: align receive packets
Browse files Browse the repository at this point in the history
Otherwise we get a lot of alignment errors

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sascha Hauer authored and David S. Miller committed Apr 16, 2009
1 parent 4f1ceb4 commit 8549889
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,14 @@ fec_enet_rx(struct net_device *dev)
* include that when passing upstream as it messes up
* bridging applications.
*/
skb = dev_alloc_skb(pkt_len - 4);
skb = dev_alloc_skb(pkt_len - 4 + NET_IP_ALIGN);

if (skb == NULL) {
if (unlikely(!skb)) {
printk("%s: Memory squeeze, dropping packet.\n",
dev->name);
dev->stats.rx_dropped++;
} else {
skb_reserve(skb, NET_IP_ALIGN);
skb_put(skb, pkt_len - 4); /* Make room */
skb_copy_to_linear_data(skb, data, pkt_len - 4);
skb->protocol = eth_type_trans(skb, dev);
Expand Down

0 comments on commit 8549889

Please sign in to comment.