summaryrefslogtreecommitdiffstats
path: root/include/linux/tcp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/tcp.h')
-rw-r--r--include/linux/tcp.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 244ae0dacf4a..911d937fb4c1 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. */