diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-18 17:43:48 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-25 22:25:24 -0700 |
commit | ab6a5bb6b28a970104a34f0f6959b73cf61bdc72 (patch) | |
tree | 54cfa7d4fe00d0c28a60022b075afc0856d6fc2b /include/linux/tcp.h | |
parent | 88c7664f13bd1a36acb8566b93892a4c58759ac6 (diff) | |
download | kernel_samsung_espresso10-ab6a5bb6b28a970104a34f0f6959b73cf61bdc72.zip kernel_samsung_espresso10-ab6a5bb6b28a970104a34f0f6959b73cf61bdc72.tar.gz kernel_samsung_espresso10-ab6a5bb6b28a970104a34f0f6959b73cf61bdc72.tar.bz2 |
[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 'include/linux/tcp.h')
-rw-r--r-- | include/linux/tcp.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 18a468d..244ae0d 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -178,6 +178,16 @@ struct tcp_md5sig { #include <net/inet_connection_sock.h> #include <net/inet_timewait_sock.h> +static inline unsigned int tcp_hdrlen(const struct sk_buff *skb) +{ + return skb->h.th->doff * 4; +} + +static inline unsigned int tcp_optlen(const struct sk_buff *skb) +{ + return (skb->h.th->doff - 5) * 4; +} + /* This defines a selective acknowledgement block. */ struct tcp_sack_block_wire { __be32 start_seq; |