]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/bnx2.c
[TCP]: Introduce tcp_hdrlen() and tcp_optlen()
[net-next-2.6.git] / drivers / net / bnx2.c
index eb0c4f1d448313fea0db44ab62d2c85602f64d4e..73512fb164527e6d0ac075ff6a64f4a6800786c1 100644 (file)
@@ -4521,13 +4521,12 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        return NETDEV_TX_OK;
                }
 
-               tcp_opt_len = ((skb->h.th->doff - 5) * 4);
                vlan_tag_flags |= TX_BD_FLAGS_SW_LSO;
 
                tcp_opt_len = 0;
-               if (skb->h.th->doff > 5) {
-                       tcp_opt_len = (skb->h.th->doff - 5) << 2;
-               }
+               if (skb->h.th->doff > 5)
+                       tcp_opt_len = tcp_optlen(skb);
+
                ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr);
 
                iph = ip_hdr(skb);