qlge: Fixed invalid reference to ip header
authorJitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Fri, 3 Feb 2012 14:06:49 +0000 (14:06 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 4 Feb 2012 20:59:30 +0000 (15:59 -0500)
we have copied skb into addr(page), skb->data doesn't contain ip
header information.

Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlge/qlge_main.c

index b54898737284199183c1c6708b184763c648f057..582b23746876bd9cfef9bdf923b4d69e77af3a51 100644 (file)
@@ -1576,13 +1576,14 @@ static void ql_process_mac_rx_page(struct ql_adapter *qdev,
                } else if ((ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_U) &&
                                (ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_V4)) {
                        /* Unfragmented ipv4 UDP frame. */
-                       struct iphdr *iph = (struct iphdr *) skb->data;
+                       struct iphdr *iph =
+                               (struct iphdr *) ((u8 *)addr + ETH_HLEN);
                        if (!(iph->frag_off &
                                cpu_to_be16(IP_MF|IP_OFFSET))) {
                                skb->ip_summed = CHECKSUM_UNNECESSARY;
                                netif_printk(qdev, rx_status, KERN_DEBUG,
                                             qdev->ndev,
-                                            "TCP checksum done!\n");
+                                            "UDP checksum done!\n");
                        }
                }
        }
@@ -1690,7 +1691,7 @@ static void ql_process_mac_rx_skb(struct ql_adapter *qdev,
                                skb->ip_summed = CHECKSUM_UNNECESSARY;
                                netif_printk(qdev, rx_status, KERN_DEBUG,
                                             qdev->ndev,
-                                            "TCP checksum done!\n");
+                                            "UDP checksum done!\n");
                        }
                }
        }