Fix compatibility back to Linux 2.6.15 and 2.4.32.
[sliver-openvswitch.git] / datapath / linux-2.6 / compat-2.6 / include / linux / ip.h
1 #ifndef __LINUX_IP_WRAPPER_H
2 #define __LINUX_IP_WRAPPER_H 1
3
4 #include_next <linux/ip.h>
5
6 #include <linux/version.h>
7 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
8
9 #ifdef __KERNEL__
10 #include <linux/skbuff.h>
11
12 static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
13 {
14         return (struct iphdr *)skb_network_header(skb);
15 }
16
17 static inline unsigned int ip_hdrlen(const struct sk_buff *skb)
18 {
19         return ip_hdr(skb)->ihl * 4;
20 }
21 #endif /* __KERNEL__ */
22
23 #endif /* linux kernel < 2.6.22 */
24
25 #endif