Compatibility fixes for 2.6.18 kernel
[openvswitch] / datapath / linux-2.6 / compat-2.6 / include / linux / tcp.h
1 #ifndef __LINUX_TCP_WRAPPER_H
2 #define __LINUX_TCP_WRAPPER_H 1
3
4 #include_next <linux/tcp.h>
5
6 #include <linux/version.h>
7 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
8
9 #ifdef __KERNEL__
10 static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb)
11 {
12         return (struct tcphdr *)skb_transport_header(skb);
13 }
14
15 static inline unsigned int tcp_hdrlen(const struct sk_buff *skb)
16 {
17         return tcp_hdr(skb)->doff * 4;
18 }
19 #endif /* __KERNEL__ */
20
21 #endif /* linux kernel < 2.6.22 */
22
23 #endif