compat: Explicitly include net/ip.h in net/udp.h.
[cascardo/ovs.git] / datapath / compat.h
index f38d38c..c827b11 100644 (file)
 #include <net/route.h>
 #include <net/xfrm.h>
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
-#define GROUP_ID(grp)  0
-#else
+#ifdef HAVE_GENL_MULTICAST_GROUP_WITH_ID
 #define GROUP_ID(grp)  ((grp)->id)
+#else
+#define GROUP_ID(grp)  0
 #endif
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
@@ -49,7 +49,8 @@ static inline struct rtable *find_route(struct net *net,
 {
        struct rtable *rt;
        /* Tunnel configuration keeps DSCP part of TOS bits, But Linux
-        * router expect RT_TOS bits only. */
+        * router expect RT_TOS bits only.
+        */
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)
        struct flowi fl = { .nl_u = { .ip4_u = {
@@ -75,4 +76,14 @@ static inline struct rtable *find_route(struct net *net,
        return rt;
 #endif
 }
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+static inline bool skb_encapsulation(struct sk_buff *skb)
+{
+       return skb->encapsulation;
+}
+#else
+#define skb_encapsulation(skb) false
+#endif
+
 #endif /* compat.h */