]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/ethoc.c
ethoc: align received packet to make IP header at word boundary
[mv-sheeva.git] / drivers / net / ethoc.c
index f92747fc5f8b005ba5943964773e47012cc72738..0c6c7f47ace4c21ad3c024f26bc83c3534258ce0 100644 (file)
@@ -399,6 +399,10 @@ static int ethoc_rx(struct net_device *dev, int limit)
                if (ethoc_update_rx_stats(priv, &bd) == 0) {
                        int size = bd.stat >> 16;
                        struct sk_buff *skb = netdev_alloc_skb(dev, size);
+
+                       size -= 4; /* strip the CRC */
+                       skb_reserve(skb, 2); /* align TCP/IP header */
+
                        if (likely(skb)) {
                                void *src = phys_to_virt(bd.addr);
                                memcpy_fromio(skb_put(skb, size), src, size);