Line
Link Here
|
0 |
-- vmnet-only/filter.c 2013-10-18 23:11:55.000000000 +0400 |
0 |
++ vmnet-only/filter.c 2013-12-03 04:16:31.751352170 +0400 |
Lines 27-32
Link Here
|
27 |
#include "compat_module.h" |
27 |
#include "compat_module.h" |
28 |
#include <linux/mutex.h> |
28 |
#include <linux/mutex.h> |
29 |
#include <linux/netdevice.h> |
29 |
#include <linux/netdevice.h> |
|
|
30 |
#include <linux/version.h> |
30 |
#if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0) |
31 |
#if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0) |
31 |
# include <linux/module.h> |
32 |
# include <linux/module.h> |
32 |
#else |
33 |
#else |
Lines 203-209
Link Here
|
203 |
#endif |
204 |
#endif |
204 |
|
205 |
|
205 |
static unsigned int |
206 |
static unsigned int |
|
|
207 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0) |
206 |
VNetFilterHookFn(unsigned int hooknum, // IN: |
208 |
VNetFilterHookFn(unsigned int hooknum, // IN: |
|
|
209 |
#else |
210 |
VNetFilterHookFn(const struct nf_hook_ops *ops, // IN: |
211 |
#endif |
207 |
#ifdef VMW_NFHOOK_USES_SKB |
212 |
#ifdef VMW_NFHOOK_USES_SKB |
208 |
struct sk_buff *skb, // IN: |
213 |
struct sk_buff *skb, // IN: |
209 |
#else |
214 |
#else |
Lines 252-258
Link Here
|
252 |
|
252 |
|
253 |
/* When the host transmits, hooknum is VMW_NF_INET_POST_ROUTING. */ |
253 |
/* When the host transmits, hooknum is VMW_NF_INET_POST_ROUTING. */ |
254 |
/* When the host receives, hooknum is VMW_NF_INET_LOCAL_IN. */ |
254 |
/* When the host receives, hooknum is VMW_NF_INET_LOCAL_IN. */ |
|
|
255 |
|
256 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0) |
255 |
transmit = (hooknum == VMW_NF_INET_POST_ROUTING); |
257 |
transmit = (hooknum == VMW_NF_INET_POST_ROUTING); |
|
|
258 |
#else |
259 |
transmit = (ops->hooknum == VMW_NF_INET_POST_ROUTING); |
260 |
#endif |
256 |
|
261 |
|
257 |
packetHeader = compat_skb_network_header(skb); |
262 |
packetHeader = compat_skb_network_header(skb); |
258 |
ip = (struct iphdr*)packetHeader; |
263 |
ip = (struct iphdr*)packetHeader; |