#include "vport-internal_dev.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) || \
- LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
-#error Kernels before 2.6.18 or after 3.2 are not supported by this version of Open vSwitch.
+ LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
+#error Kernels before 2.6.18 or after 3.3 are not supported by this version of Open vSwitch.
#endif
#define REHASH_FLOW_INTERVAL (10 * 60 * HZ)
#ifndef __LINUX_ETHERDEVICE_WRAPPER_H
#define __LINUX_ETHERDEVICE_WRAPPER_H 1
-#include_next <linux/etherdevice.h>
#include <linux/version.h>
+#include_next <linux/etherdevice.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
static inline void eth_hw_addr_random(struct net_device *dev)
{
random_ether_addr(dev->dev_addr);
}
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
static inline void eth_hw_addr_random(struct net_device *dev)
{
dev_hw_addr_random(dev, dev->dev_addr);
#ifndef __GENETLINK_WRAPPER_H
#define __GENETLINK_WRAPPER_H 1
+#include <linux/version.h>
#include_next <linux/genetlink.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
#ifdef CONFIG_PROVE_LOCKING
-/* No version of the kernel has this function, but our locking scheme depends
- * on genl_mutex so for clarity we use it where appropriate. */
static inline int lockdep_genl_is_held(void)
{
return 1;
}
#endif
+#endif
-/* This is also not upstream yet. */
#ifndef genl_dereference
#include <linux/rcupdate.h>
#ifndef __LINUX_IF_VLAN_WRAPPER_H
#define __LINUX_IF_VLAN_WRAPPER_H 1
-#include_next <linux/if_vlan.h>
#include <linux/skbuff.h>
+#include <linux/version.h>
+#include_next <linux/if_vlan.h>
/*
* The behavior of __vlan_put_tag() has changed over time:
#define VLAN_TAG_PRESENT VLAN_CFI_MASK
#endif
-/* This function is not exported from kernel. OVS Upstreaming patch will
- * fix that. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0)
static inline void vlan_set_encap_proto(struct sk_buff *skb, struct vlan_hdr *vhdr)
{
__be16 proto;
*/
skb->protocol = htons(ETH_P_802_2);
}
+#endif
#endif /* linux/if_vlan.h wrapper */
#ifndef __NET_DST_WRAPPER_H
#define __NET_DST_WRAPPER_H 1
+#include <linux/version.h>
#include_next <net/dst.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) && \
+ LINUX_VERSION_CODE > KERNEL_VERSION(3,0,20)
+
+#define dst_get_neighbour_noref dst_get_neighbour
+
+#endif
+
#ifndef HAVE_SKB_DST_ACCESSOR_FUNCS
static inline void skb_dst_drop(struct sk_buff *skb)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)
static struct hh_cache *rt_hh(struct rtable *rt)
{
- struct neighbour *neigh = dst_get_neighbour(&rt->dst);
+ struct neighbour *neigh = dst_get_neighbour_noref(&rt->dst);
if (!neigh || !(neigh->nud_state & NUD_CONNECTED) ||
!neigh->hh.hh_len)
return NULL;