rebuild member was removed from headers_ops in kernel release
4.1. Therefore kni module compilation breaks.
This patch add the properly checks to fix it.
Linux:
d476059e77d1 ("net: Kill dev_rebuild_header")
Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
/*
* Re-fill the eth header
*/
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0))
static int
kni_net_rebuild_header(struct sk_buff *skb)
{
return 0;
}
+#endif /* < 4.1.0 */
/**
* kni_net_set_mac - Change the Ethernet Address of the KNI NIC
static const struct header_ops kni_net_header_ops = {
.create = kni_net_header,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0))
.rebuild = kni_net_rebuild_header,
+#endif /* < 4.1.0 */
.cache = NULL, /* disable caching */
};