Support changed sock_create_kern() interface from Linux 4.2.

This commit is contained in:
Florian Pose 2016-10-18 10:20:47 +02:00
parent 8ab3c676cd
commit 95c2be2a37
1 changed files with 5 additions and 0 deletions

View File

@ -212,8 +212,13 @@ int ec_gen_device_create_socket(
return -ENOMEM;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
ret = sock_create_kern(&init_net, PF_PACKET, SOCK_RAW,
htons(ETH_P_ETHERCAT), &dev->socket);
#else
ret = sock_create_kern(PF_PACKET, SOCK_RAW, htons(ETH_P_ETHERCAT),
&dev->socket);
#endif
if (ret) {
printk(KERN_ERR PFX "Failed to create socket (ret = %i).\n", ret);
return ret;