mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-11 10:30:09 +00:00
Fix sk_alloc function change since 4.2 Linux kernel.
This commit is contained in:
parent
58eb2560c8
commit
212b8237b6
@ -23,6 +23,15 @@
|
||||
#include <linux/version.h>
|
||||
#include <linux/init.h>
|
||||
|
||||
/* wrap up socket object allocation */
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 00)
|
||||
#define compat_sk_alloc(_net, _family, _priority, _proto) \
|
||||
sk_alloc(_net, _family, _priority, _proto, 0)
|
||||
#else
|
||||
#define compat_sk_alloc(_net, _family, _priority, _proto) \
|
||||
sk_alloc(_net, _family, _priority, _proto)
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)
|
||||
#define LINUX_3_15
|
||||
#endif
|
||||
@ -587,7 +596,7 @@ static int sheep_net_ioctl(struct inode *inode, struct file *f, unsigned int cod
|
||||
|
||||
/* Allocate socket */
|
||||
#ifdef LINUX_26
|
||||
v->skt = sk_alloc(dev_net(v->ether), GFP_USER, 1, &sheep_proto);
|
||||
v->skt = compat_sk_alloc(dev_net(v->ether), GFP_USER, 1, &sheep_proto);
|
||||
#else
|
||||
v->skt = sk_alloc(0, GFP_USER, 1);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user