# HG changeset patch # User Florian Pose # Date 1476778847 -7200 # Node ID 161c675135f0fba93bf6fb17ce3cbc3adfa879d7 # Parent 8e6fad4f9a74adebb14b4a5faffc0dbc8c9ef268 Support changed sock_create_kern() interface from Linux 4.2. diff -r 8e6fad4f9a74 -r 161c675135f0 devices/generic.c --- a/devices/generic.c Tue Oct 18 10:20:21 2016 +0200 +++ b/devices/generic.c Tue Oct 18 10:20:47 2016 +0200 @@ -212,8 +212,13 @@ 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;