Skip to content

Instantly share code, notes, and snippets.

@jazzl0ver
Last active April 6, 2017 14:59
Show Gist options
  • Save jazzl0ver/954aa1c4078b548dcfecaeea8d1d1ce1 to your computer and use it in GitHub Desktop.
Save jazzl0ver/954aa1c4078b548dcfecaeea8d1d1ce1 to your computer and use it in GitHub Desktop.
Fix kcompat.h in ixgbevf-2.16.4 to be able to compile under CentOS 6.8 2.6.32-642.15.1.el6.x86_64 kernel
--- src/kcompat.h.org 2015-09-21 23:09:52.000000000 +0000
+++ src/kcompat.h 2017-04-03 10:31:09.000000000 +0000
@@ -3347,7 +3347,7 @@
#ifndef vlan_get_protocol
static inline __be16 __kc_vlan_get_protocol(const struct sk_buff *skb)
{
- if (vlan_tx_tag_present(skb) ||
+ if (skb_vlan_tag_get(skb) ||
skb->protocol != cpu_to_be16(ETH_P_8021Q))
return skb->protocol;
@@ -4508,12 +4508,6 @@
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,20,0) )
/* vlan_tx_xx functions got renamed to skb_vlan */
-#ifndef skb_vlan_tag_get
-#define skb_vlan_tag_get vlan_tx_tag_get
-#endif
-#ifndef skb_vlan_tag_present
-#define skb_vlan_tag_present vlan_tx_tag_present
-#endif
#if RHEL_RELEASE_CODE && (RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(7,1))
#define HAVE_INCLUDE_LINUX_TIMECOUNTER_H
#endif
@jazzl0ver
Copy link
Author

Fix for this kind of error:

make -C /lib/modules/2.6.32-642.15.1.el6.x86_64/build SUBDIRS=/usr/src/ixgbevf-2.16.4/src modules
make[1]: Entering directory `/usr/src/kernels/2.6.32-642.15.1.el6.x86_64'
  CC [M]  /usr/src/ixgbevf-2.16.4/src/ixgbevf_main.o
In file included from /usr/src/ixgbevf-2.16.4/src/ixgbevf.h:41,
                 from /usr/src/ixgbevf-2.16.4/src/ixgbevf_main.c:53:
/usr/src/ixgbevf-2.16.4/src/kcompat.h: In function ‘__kc_vlan_get_protocol’:
/usr/src/ixgbevf-2.16.4/src/kcompat.h:3350: error: implicit declaration of function ‘vlan_tx_tag_present’
make[2]: *** [/usr/src/ixgbevf-2.16.4/src/ixgbevf_main.o] Error 1
make[1]: *** [_module_/usr/src/ixgbevf-2.16.4/src] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.32-642.15.1.el6.x86_64'
make: *** [default] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment