diff options
author | Jean-Marc Lenoir | 2023-10-21 15:47:30 +0200 |
---|---|---|
committer | Jean-Marc Lenoir | 2023-10-21 15:47:30 +0200 |
commit | e87f3d1578f7c0cdef7ad60a5a475d5494ba5e4f (patch) | |
tree | bed230894f85ce60b275fd2fe3671c8d9c497cb9 /vmnet.patch | |
parent | 38aefe99bd5b32bc403c948b08df5b444dbbc7ff (diff) | |
download | aur-e87f3d1578f7c0cdef7ad60a5a475d5494ba5e4f.tar.gz |
Update to 17.5.0
Diffstat (limited to 'vmnet.patch')
-rw-r--r-- | vmnet.patch | 110 |
1 files changed, 20 insertions, 90 deletions
diff --git a/vmnet.patch b/vmnet.patch index e32964bdd5e1..e4b5994aa94f 100644 --- a/vmnet.patch +++ b/vmnet.patch @@ -12,84 +12,14 @@ # Header directory for the running kernel ifdef LINUXINCLUDE ---- a/vmnet/userif.c -+++ b/vmnet/userif.c -Fixing VMWare Player on Linux when using DHCP addresses: https://www.nikhef.nl/~janjust/vmnet/ -@@ -1029,6 +1029,9 @@ - userIf = (VNetUserIF *)port->jack.private; - hubJack = port->jack.peer; - -+ /* never send link down events */ -+ if (!linkUp) return 0; -+ - if (port->jack.state == FALSE || hubJack == NULL) { - return -EINVAL; - } ---- a/vmnet/vnetUserListener.c ---- b/vmnet/vnetUserListener.c -@@ -42,10 +42,12 @@ - - struct VNetUserListener_EventNode { - VNetUserListener_EventNode *nextEvent; -- VNet_EventHeader event; -+ union { -+ VNet_EventHeader header; -+ VNet_LinkStateEvent lse; -+ } event; - }; - --#define EVENT_NODE_HEADER_SIZE offsetof(struct VNetUserListener_EventNode, event) - - typedef struct VNetUserListener { - VNetPort port; /* base port/jack */ -@@ -220,7 +222,7 @@ - VNetUserListener_EventNode *t; - - /* allocate and initialize event node */ -- t = kmalloc(EVENT_NODE_HEADER_SIZE + e->size, GFP_ATOMIC); -+ t = kmalloc(sizeof *t, GFP_ATOMIC); - if (t == NULL) { - LOG(0, (KERN_DEBUG "VNetUserListenerEventHandler, out of memory\n")); - return; -@@ -299,7 +301,7 @@ - spin_unlock(&userListener->lock); - - /* return data and free event */ -- n = t->event.size; -+ n = t->event.header.size; - if (count < n) { - n = count; - } -From 0ca979d4bd06144204d720bb82f0a1e29024f9fa Mon Sep 17 00:00:00 2001 -From: Michal Kubecek <mkubecek@suse.cz> -Date: Wed, 18 Jan 2023 00:19:52 +0100 -Subject: [PATCH] vmnet: use explicit module_init() and module_exit() (#187) - -While vmmon module already uses explicit module_init() and module_exit() -for its init and cleanup function, vmnet relies on traditional magic names -init_module() and cleanup_module(). Apparently this has an unfortunate side -effect that the two functions are not identified as indirect call targets -by objdump and they get "sealed" when the module is built against and -loaded into an IBT enabled kernel. - -Starting with 6.3-rc1, objtool is going to warn about this issue, -indicating that the legacy module initialization is deprecated and -module_init() and module_exit() macros should be used instead so do that -for vmnet as well. ---- - vmnet-only/driver.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/vmnet-only/driver.c b/vmnet-only/driver.c -index 197a213..b22cbfb 100644 ---- a/vmnet-only/driver.c -+++ b/vmnet-only/driver.c +--- a/vmnet/driver.c ++++ b/vmnet/driver.c @@ -279,7 +279,7 @@ VNetRemovePortFromList(const VNetPort *port) // IN: port to remove from list /* *---------------------------------------------------------------------- * - * init_module -- -+ * vmnet_init_module -- ++ * LinuxDriverInit -- * * linux module entry point. Called by /sbin/insmod command. * Initializes module and Registers this driver for a @@ -98,7 +28,7 @@ index 197a213..b22cbfb 100644 int -init_module(void) -+vmnet_init_module(void) ++LinuxDriverInit(void) { int retval; @@ -107,7 +37,7 @@ index 197a213..b22cbfb 100644 *---------------------------------------------------------------------- * - * cleanup_module -- -+ * vmnet_cleanup_module -- ++ * LinuxDriverExit -- * * Called by /sbin/rmmod. Unregisters this driver for a * vnet major #, and deinitializes the modules. The 64-bit @@ -116,7 +46,7 @@ index 197a213..b22cbfb 100644 void -cleanup_module(void) -+vmnet_cleanup_module(void) ++LinuxDriverExit(void) { unregister_chrdev(VNET_MAJOR_NUMBER, "vmnet"); VNetProtoUnregister(); @@ -124,18 +54,18 @@ index 197a213..b22cbfb 100644 * by default (i.e., neither mkinitrd nor modprobe will accept it). */ MODULE_INFO(supported, "external"); -+module_init(vmnet_init_module); -+module_exit(vmnet_cleanup_module); -Patch inspired from https://github.com/mkubecek/vmware-host-modules/commit/b75cd616cca0a4c9ff22124c4c91d218e64e6205.patch ---- a/vmnet/bridge.c -+++ b/vmnet/bridge.c -@@ -44,6 +44,9 @@ - #include <linux/if_arp.h> - #include <net/tcp.h> - #include <net/ipv6.h> -+#if !defined(SKB_GSO_CB) -+#include <net/gso.h> -+#endif ++module_init(LinuxDriverInit); ++module_exit(LinuxDriverExit); +--- a/vmnet/userif.c ++++ b/vmnet/userif.c +Fixing VMWare Player on Linux when using DHCP addresses: https://www.nikhef.nl/~janjust/vmnet/ +@@ -1029,6 +1029,9 @@ + userIf = (VNetUserIF *)port->jack.private; + hubJack = port->jack.peer; - #ifdef CONFIG_NET_RADIO - # include <linux/wireless.h> ++ /* never send link down events */ ++ if (!linkUp) return 0; ++ + if (port->jack.state == FALSE || hubJack == NULL) { + return -EINVAL; + } |