summaryrefslogtreecommitdiff
path: root/drivers/vlan_mon
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2017-12-27 23:52:31 +0300
committerDmitry Kozlov <xeb@mail.ru>2017-12-27 23:52:31 +0300
commitd7c91b0e301375c06feecbb2e714b13860e2c35f (patch)
tree2d4dada8813486d9151f23b5914c37195f7bd76d /drivers/vlan_mon
parent5ed4291f41c8f493f5cf6737e871ca1bf4e7f2a5 (diff)
downloadaccel-ppp-d7c91b0e301375c06feecbb2e714b13860e2c35f.tar.gz
accel-ppp-d7c91b0e301375c06feecbb2e714b13860e2c35f.zip
ipoe,vlan_mon: updated up to kernel 4.14
Diffstat (limited to 'drivers/vlan_mon')
-rw-r--r--drivers/vlan_mon/vlan_mon.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/vlan_mon/vlan_mon.c b/drivers/vlan_mon/vlan_mon.c
index db6d022f..b6476d4c 100644
--- a/drivers/vlan_mon/vlan_mon.c
+++ b/drivers/vlan_mon/vlan_mon.c
@@ -663,14 +663,6 @@ static struct genl_ops vlan_mon_nl_ops[] = {
},
};
-static struct genl_family vlan_mon_nl_family = {
- .id = GENL_ID_GENERATE,
- .name = VLAN_MON_GENL_NAME,
- .version = VLAN_MON_GENL_VERSION,
- .hdrsize = 0,
- .maxattr = VLAN_MON_ATTR_MAX,
-};
-
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) && RHEL_MAJOR < 7
static struct genl_multicast_group vlan_mon_nl_mcg = {
.name = VLAN_MON_GENL_MCG,
@@ -681,6 +673,23 @@ static struct genl_multicast_group vlan_mon_nl_mcgs[] = {
};
#endif
+static struct genl_family vlan_mon_nl_family = {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
+ .id = GENL_ID_GENERATE,
+#endif
+ .name = VLAN_MON_GENL_NAME,
+ .version = VLAN_MON_GENL_VERSION,
+ .hdrsize = 0,
+ .maxattr = VLAN_MON_ATTR_MAX,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
+ .module = THIS_MODULE,
+ .ops = vlan_mon_nl_ops,
+ .n_ops = ARRAY_SIZE(vlan_mon_nl_ops),
+ .mcgrps = vlan_mon_nl_mcgs,
+ .n_mcgrps = ARRAY_SIZE(vlan_mon_nl_mcgs),
+#endif
+};
+
static struct packet_type vlan_pt __read_mostly = {
.type = __constant_htons(ETH_P_ALL),
.func = vlan_pt_recv,
@@ -699,8 +708,10 @@ static int __init vlan_mon_init(void)
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) && RHEL_MAJOR < 7
err = genl_register_family_with_ops(&vlan_mon_nl_family, vlan_mon_nl_ops, ARRAY_SIZE(vlan_mon_nl_ops));
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
err = genl_register_family_with_ops_groups(&vlan_mon_nl_family, vlan_mon_nl_ops, vlan_mon_nl_mcgs);
+#else
+ err = genl_register_family(&vlan_mon_nl_family);
#endif
if (err < 0) {
printk(KERN_INFO "vlan_mon: can't register netlink interface\n");