]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/netxen/netxen_nic_main.c
[IP]: Introduce ip_hdrlen()
[net-next-2.6.git] / drivers / net / netxen / netxen_nic_main.c
index 7d2525e76abbedcbc6cf1584c3207239b40c8944..b548a30e5c8eea4b7d62d42fbb89feb99b6a202c 100644 (file)
@@ -41,6 +41,7 @@
 
 #include <linux/dma-mapping.h>
 #include <linux/vmalloc.h>
+#include <net/ip.h>
 
 MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver");
 MODULE_LICENSE("GPL");
@@ -778,9 +779,8 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
                if (skb_shinfo(skb)->gso_size > 0) {
 
                        no_of_desc++;
-                       if (((skb->nh.iph)->ihl * sizeof(u32)) +
-                           ((skb->h.th)->doff * sizeof(u32)) +
-                           sizeof(struct ethhdr) >
+                       if ((ip_hdrlen(skb) + skb->h.th->doff * 4 +
+                            sizeof(struct ethhdr)) >
                            (sizeof(struct cmd_desc_type0) - 2)) {
                                no_of_desc++;
                        }