在Linux内安装虚拟机安装vmnet.tar 报错
编译报错如下:
/usr/lib/vmware/modules/source/vmnet-only/userif.c: 在函数‘VNetCsumCopyDatagram’中: /usr/lib/vmware/modules/source/vmnet-only/userif.c:88:39: 错误:‘skb_frag_t {或称 const struct bio_vec}’ has no member named ‘page_offset’; did you mean ‘bv_offset’?
define skb_frag_off(frag) (frag)->page_offset
^
/usr/lib/vmware/modules/source/vmnet-only/userif.c:623:50: 附注:in expansion of macro ‘skb_frag_off’ tmpCsum = VNetCsumAndCopyToUser(vaddr + skb_frag_off(frag),
修改定义宏前:
#if COMPAT_LINUX_VERSION_CHECK_LT(5, 4, 0) && \!(defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 15 && \defined(CONFIG_SUSE_PATCHLEVEL) && CONFIG_SUSE_PATCHLEVEL >= 2)
# define skb_frag_off(frag) (frag)->page_offset
#endif
修改后:
#if COMPAT_LINUX_VERSION_CHECK_LT(5, 4, 0) && \!(defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 15 && \defined(CONFIG_SUSE_PATCHLEVEL) && CONFIG_SUSE_PATCHLEVEL >= 2)
# define skb_frag_off(frag) (frag)->bv_offset
#endif
网上找过原因说是linux 内核函数变了?
参考资料:
Ubuntu 18.04 编译安装 kernel 5.5.4 之后修复 vmware 网络驱动 - 0xCAFEBABE - 博客园