summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-10 21:04:22 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-25 22:25:26 -0700
commitaa8223c7bb0b05183e1737881ed21827aa5b9e73 (patch)
tree05c9832326edfeb878472f15cf8133ed9f014cdf /include/linux
parentab6a5bb6b28a970104a34f0f6959b73cf61bdc72 (diff)
[SK_BUFF]: Introduce tcp_hdr(), remove skb->h.th
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/skbuff.h1
-rw-r--r--include/linux/tcp.h9
2 files changed, 7 insertions, 3 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index e580416de78..8f158d66d2a 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -237,7 +237,6 @@ struct sk_buff {
/* 4 byte hole on 64 bit*/
union {
- struct tcphdr *th;
struct iphdr *ipiph;
struct ipv6hdr *ipv6h;
unsigned char *raw;
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 244ae0dacf4..911d937fb4c 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -178,14 +178,19 @@ struct tcp_md5sig {
#include <net/inet_connection_sock.h>
#include <net/inet_timewait_sock.h>
+static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb)
+{
+ return (struct tcphdr *)skb->h.raw;
+}
+
static inline unsigned int tcp_hdrlen(const struct sk_buff *skb)
{
- return skb->h.th->doff * 4;
+ return tcp_hdr(skb)->doff * 4;
}
static inline unsigned int tcp_optlen(const struct sk_buff *skb)
{
- return (skb->h.th->doff - 5) * 4;
+ return (tcp_hdr(skb)->doff - 5) * 4;
}
/* This defines a selective acknowledgement block. */