Backport of upstream commit 2c7a88c252bf3381958cf716f31b6b2e0f2f3fa7:
"etherdev: Fix sparse error, make test usable by other functions"

Signed-off-by: Joe Stringer <joestrin...@nicira.com>
---
 datapath/linux/compat/include/linux/etherdevice.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/datapath/linux/compat/include/linux/etherdevice.h 
b/datapath/linux/compat/include/linux/etherdevice.h
index c6e8e92..c9c0a99 100644
--- a/datapath/linux/compat/include/linux/etherdevice.h
+++ b/datapath/linux/compat/include/linux/etherdevice.h
@@ -51,4 +51,17 @@ static inline void ether_addr_copy(u8 *dst, const u8 *src)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+#define eth_proto_is_802_3 rpl_eth_proto_is_802_3
+static inline bool eth_proto_is_802_3(__be16 proto)
+{
+#ifndef __BIG_ENDIAN
+       /* if CPU is little endian mask off bits representing LSB */
+       proto &= htons(0xFF00);
+#endif
+       /* cast both to u16 and compare since LSB can be ignored */
+       return (__force u16)proto >= (__force u16)htons(ETH_P_802_3_MIN);
+}
+#endif
+
 #endif
-- 
2.1.4

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to