aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-18 17:43:48 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-25 22:25:24 -0700
commitab6a5bb6b28a970104a34f0f6959b73cf61bdc72 (patch)
tree54cfa7d4fe00d0c28a60022b075afc0856d6fc2b /drivers/net/tg3.c
parent[SK_BUFF]: Introduce icmp_hdr(), remove skb->h.icmph (diff)
downloadlinux-dev-ab6a5bb6b28a970104a34f0f6959b73cf61bdc72.tar.xz
linux-dev-ab6a5bb6b28a970104a34f0f6959b73cf61bdc72.zip
[TCP]: Introduce tcp_hdrlen() and tcp_optlen()
The ip_hdrlen() buddy, created to reduce the number of skb->h.th-> uses and to avoid the longer, open coded equivalent. Ditched a no-op in bnx2 in the process. I wonder if we should have a BUG_ON(skb->h.th->doff < 5) in tcp_optlen()... Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 76a31afe20de..7ca30d76bf6f 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -3911,7 +3911,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
else {
struct iphdr *iph = ip_hdr(skb);
- tcp_opt_len = ((skb->h.th->doff - 5) * 4);
+ tcp_opt_len = tcp_optlen(skb);
ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr);
iph->check = 0;
@@ -4065,7 +4065,7 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)
goto out_unlock;
}
- tcp_opt_len = ((skb->h.th->doff - 5) * 4);
+ tcp_opt_len = tcp_optlen(skb);
ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr);
hdr_len = ip_tcp_len + tcp_opt_len;