diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-18 20:43:48 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:25:24 -0400 |
commit | ab6a5bb6b28a970104a34f0f6959b73cf61bdc72 (patch) | |
tree | 54cfa7d4fe00d0c28a60022b075afc0856d6fc2b /drivers/net/tg3.c | |
parent | 88c7664f13bd1a36acb8566b93892a4c58759ac6 (diff) |
[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.c | 4 |
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) | |||
3911 | else { | 3911 | else { |
3912 | struct iphdr *iph = ip_hdr(skb); | 3912 | struct iphdr *iph = ip_hdr(skb); |
3913 | 3913 | ||
3914 | tcp_opt_len = ((skb->h.th->doff - 5) * 4); | 3914 | tcp_opt_len = tcp_optlen(skb); |
3915 | ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr); | 3915 | ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr); |
3916 | 3916 | ||
3917 | iph->check = 0; | 3917 | iph->check = 0; |
@@ -4065,7 +4065,7 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev) | |||
4065 | goto out_unlock; | 4065 | goto out_unlock; |
4066 | } | 4066 | } |
4067 | 4067 | ||
4068 | tcp_opt_len = ((skb->h.th->doff - 5) * 4); | 4068 | tcp_opt_len = tcp_optlen(skb); |
4069 | ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr); | 4069 | ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr); |
4070 | 4070 | ||
4071 | hdr_len = ip_tcp_len + tcp_opt_len; | 4071 | hdr_len = ip_tcp_len + tcp_opt_len; |