summaryrefslogtreecommitdiff
blob: 1bf22077b727e19b8636cb40b5f0f9380c7dcc39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
the new API to get the hooknum
origionally from http://forums.gentoo.org/viewtopic-t-979802-start-25.html

--- work/vmnet-only/filter.c   2013-08-27 20:29:04.000000000 +0100
+++ patched/vmnet-only/filter.c   2014-01-26 01:09:05.184893854 +0000
@@ -27,6 +27,7 @@
 #include "compat_module.h"
 #include <linux/mutex.h>
 #include <linux/netdevice.h>
+#include <linux/version.h>
 #if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0)
 #   include <linux/module.h>
 #else
@@ -203,7 +204,11 @@
 #endif

 static unsigned int
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
 VNetFilterHookFn(unsigned int hooknum,                 // IN:
+#else
+VNetFilterHookFn(const struct nf_hook_ops *ops,        // IN:
+#endif
 #ifdef VMW_NFHOOK_USES_SKB
                  struct sk_buff *skb,                  // IN:
 #else
@@ -252,7 +257,12 @@

    /* When the host transmits, hooknum is VMW_NF_INET_POST_ROUTING. */
    /* When the host receives, hooknum is VMW_NF_INET_LOCAL_IN. */
-   transmit = (hooknum == VMW_NF_INET_POST_ROUTING);
+
+   #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
+      transmit = (hooknum == VMW_NF_INET_POST_ROUTING);
+   #else
+      transmit = (ops->hooknum == VMW_NF_INET_POST_ROUTING);
+   #endif

    packetHeader = compat_skb_network_header(skb);
    ip = (struct iphdr*)packetHeader;