datapath: Add support for kernel 3.14.
[sliver-openvswitch.git] / datapath / linux / compat / include / linux / etherdevice.h
index eb7123e..c6e8e92 100644 (file)
@@ -34,4 +34,21 @@ static inline int eth_mac_addr(struct net_device *dev, void *p)
 }
 #endif
 
+#ifndef HAVE_ETHER_ADDR_COPY
+static inline void ether_addr_copy(u8 *dst, const u8 *src)
+{
+#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
+       *(u32 *)dst = *(const u32 *)src;
+       *(u16 *)(dst + 4) = *(const u16 *)(src + 4);
+#else
+       u16 *a = (u16 *)dst;
+       const u16 *b = (const u16 *)src;
+
+       a[0] = b[0];
+       a[1] = b[1];
+       a[2] = b[2];
+#endif
+}
+#endif
+
 #endif