datapath: Add support for kernels 3.13
[sliver-openvswitch.git] / datapath / linux / compat / include / net / ip.h
1 #ifndef __NET_IP_WRAPPER_H
2 #define __NET_IP_WRAPPER_H 1
3
4 #include_next <net/ip.h>
5
6 #include <linux/version.h>
7
8 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)
9 static inline bool ip_is_fragment(const struct iphdr *iph)
10 {
11         return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0;
12 }
13 #endif
14
15 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)
16 static inline void rpl_inet_get_local_port_range(struct net *net, int *low,
17                                              int *high)
18 {
19         inet_get_local_port_range(low, high);
20 }
21 #define inet_get_local_port_range rpl_inet_get_local_port_range
22
23 #endif
24
25 #endif