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/bnx2.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/bnx2.c')
-rw-r--r-- | drivers/net/bnx2.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index eb0c4f1d4483..73512fb16452 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -4521,13 +4521,12 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4521 | return NETDEV_TX_OK; | 4521 | return NETDEV_TX_OK; |
4522 | } | 4522 | } |
4523 | 4523 | ||
4524 | tcp_opt_len = ((skb->h.th->doff - 5) * 4); | ||
4525 | vlan_tag_flags |= TX_BD_FLAGS_SW_LSO; | 4524 | vlan_tag_flags |= TX_BD_FLAGS_SW_LSO; |
4526 | 4525 | ||
4527 | tcp_opt_len = 0; | 4526 | tcp_opt_len = 0; |
4528 | if (skb->h.th->doff > 5) { | 4527 | if (skb->h.th->doff > 5) |
4529 | tcp_opt_len = (skb->h.th->doff - 5) << 2; | 4528 | tcp_opt_len = tcp_optlen(skb); |
4530 | } | 4529 | |
4531 | ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr); | 4530 | ip_tcp_len = ip_hdrlen(skb) + sizeof(struct tcphdr); |
4532 | 4531 | ||
4533 | iph = ip_hdr(skb); | 4532 | iph = ip_hdr(skb); |