datapath: ipv6_skip_exthdr() is now fully upstream.
authorJesse Gross <jesse@nicira.com>
Wed, 7 Nov 2012 15:35:14 +0000 (07:35 -0800)
committerJesse Gross <jesse@nicira.com>
Thu, 8 Nov 2012 18:12:06 +0000 (10:12 -0800)
OVS required some extensions to ipv6_skip_exthdr() which have
since been accepted upstream.  On kernels with these changes we can
now use the upstream version instead of our compatibility code.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
datapath/linux/compat/exthdrs_core.c
datapath/linux/compat/include/net/ipv6.h

index eb56e6b..e2b4a03 100644 (file)
@@ -1,9 +1,8 @@
 #include <linux/ipv6.h>
+#include <linux/version.h>
 #include <net/ipv6.h>
 
-/* This function is upstream but not the version which supplies the
- * fragment offset.  We plan to propose the extended version.
- */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
 int rpl_ipv6_skip_exthdr(const struct sk_buff *skb, int start,
                         u8 *nexthdrp, __be16 *frag_offp)
 {
@@ -46,6 +45,7 @@ int rpl_ipv6_skip_exthdr(const struct sk_buff *skb, int start,
        *nexthdrp = nexthdr;
        return start;
 }
+#endif /* Kernel version < 3.3 */
 
 /*
  * find the offset to specified header or the protocol number of last header
index 09115a4..d1e3248 100644 (file)
@@ -1,21 +1,22 @@
 #ifndef __NET_IPV6_WRAPPER_H
 #define __NET_IPV6_WRAPPER_H 1
 
+#include <linux/version.h>
+
 #include_next <net/ipv6.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+#define ipv6_skip_exthdr rpl_ipv6_skip_exthdr
+extern int ipv6_skip_exthdr(const struct sk_buff *skb, int start,
+                           u8 *nexthdrp, __be16 *frag_offp);
+#endif
+
 enum {
        OVS_IP6T_FH_F_FRAG      = (1 << 0),
        OVS_IP6T_FH_F_AUTH      = (1 << 1),
        OVS_IP6T_FH_F_SKIP_RH   = (1 << 2),
 };
 
-/* This function is upstream but not the version which supplies the
- * fragment offset.  We plan to propose the extended version.
- */
-#define ipv6_skip_exthdr rpl_ipv6_skip_exthdr
-extern int ipv6_skip_exthdr(const struct sk_buff *skb, int start,
-                               u8 *nexthdrp, __be16 *frag_offp);
-
 /* This function is upstream, but not the version which skips routing
  * headers with 0 segments_left. We plan to propose the extended version. */
 #define ipv6_find_hdr rpl_ipv6_find_hdr