summaryrefslogtreecommitdiff
path: root/net-dialup/accel-ppp
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-01-15 15:51:32 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-01-15 15:51:32 +0000
commit21435953e16cda318a82334ddbadb3b5c36d9ea7 (patch)
treee1810a4b135afce04b34862ef0fab2bfaeb8aeca /net-dialup/accel-ppp
parent7bc9c63c9da678a7e6fceb095d56c634afd22c56 (diff)
gentoo resync : 15.01.2020
Diffstat (limited to 'net-dialup/accel-ppp')
-rw-r--r--net-dialup/accel-ppp/Manifest5
-rw-r--r--net-dialup/accel-ppp/accel-ppp-1.11.1_p20180320.ebuild105
-rw-r--r--net-dialup/accel-ppp/accel-ppp-1.12.0.ebuild3
-rw-r--r--net-dialup/accel-ppp/files/accel-ppp-1.12.0-kernel-5.2.patch282
4 files changed, 286 insertions, 109 deletions
diff --git a/net-dialup/accel-ppp/Manifest b/net-dialup/accel-ppp/Manifest
index 3a337f089154..a1917bca9684 100644
--- a/net-dialup/accel-ppp/Manifest
+++ b/net-dialup/accel-ppp/Manifest
@@ -1,9 +1,8 @@
AUX accel-ppp-1.11.1-socklen.patch 483 BLAKE2B efdcc5b2826ab2d45bcd6914efbc65a3ef0ac6987663f8888d2168d61f941de9bd047a30673ee0114955faa121de701f93c1564b2cb8e2c843cfa7ff2030b309 SHA512 6561b95c8cc0ec642c12895426c5b0b8290da9c7e3c9207beb837e50218fec70ead92a680e131f2967d3281a273cc920ccfebbd66aed4579feec61a759b36dd5
+AUX accel-ppp-1.12.0-kernel-5.2.patch 8304 BLAKE2B f28a0720dd9d99948cd4552986fdd9de3e2552d13576ea35a97acbec7f2a91951b37c1222b8b9d2cd048871e6d71af4e5995b9d27e43a2443bd0f94019f7b712 SHA512 b4c544a36724614bd306e05f626f17b9fa88e92d44e4e94a9cc274d3a9815a342bf4bc403b18bc3a5559109cc1b9d0f2682c6a108f7f0edd016f6f12d9e67dc2
AUX accel-ppp.confd 437 BLAKE2B 6b418f528877a46b4b8aba3728405459a567c264b5bb73da79a08649f604f99f6b9d5a665599836b902c554b9fa5c62b8e399cb60bf4e0bcf85e21a0d4959b54 SHA512 66dad6b7b4497c5768206e7990e4034f1de03d9608e1470888e061ba0ff6be934f1dd329336fd3978a43a99a8e3971a00be4da327bfc01a64dadfe91da2cea30
AUX accel-ppp.initd 998 BLAKE2B 974407e0e974fb79b3ea17bd1526d1f6343d7284cb10a93bcb2713f955244a91a664fd7187287a7b090edee340f76181f88645b2d4bf0e5470d825407ddebe83 SHA512 ebee03f6c448f1158831bb563568ce027b2824c185852d380f079456f25dcb69e0fe5c6d6235eed33f028825786f091853c05fcba5eb3c287790353629823764
-DIST accel-ppp-1.11.1_p20180320.tar.bz2 1634359 BLAKE2B 97ca709ef3740c2ac1d75f6fba3acbf9229c3cb48f3a55735eaa14b74c2b0af96d637cbb145bc9e98a5b245704806cdc3d8f9d8692809626e0f73d73702c4a0a SHA512 a8a2420332c02087e45bbaab25831ae5d2d370fd56b29db77c267083badc22b90ca4b0ec7335e13250ac8f150002b2a3c343cfba6c2378932778777dc936d914
DIST accel-ppp-1.12.0.tar 6758400 BLAKE2B 776c0946decec2d88a0dfeb8e840573ae8d53d53d0fe921604667eaf4a5658e7d0cfa57f0b54eb61fcdf62b7a62a94ee405a01ad2a66ab76042d59cc3f79d42b SHA512 f1d3b31ca36395a429214b7599a43755317d89391c5631dfd02df79ed8dd51c39f75fc56ac625fbc6e7d5b0f9c85699c5da612eb4e8af9eae8ad2d9b13a187ba
-EBUILD accel-ppp-1.11.1_p20180320.ebuild 2436 BLAKE2B 0d024f60748291e5e3bad0640f472950088abecaddb9ad46dcefa100ea8fa9a70837871c577cdabc87e984c2c066a66aa8dc18441b2d403ec2cee393d423891d SHA512 cabce32b55c148a02df91e3612002d17b349a0c1da5ca6e72ba610e99d123ce3be2c42a65b6a7ba66cb34a6cbe83d7dc9f1b964494e661e02f90fcdef55d53cf
-EBUILD accel-ppp-1.12.0.ebuild 2555 BLAKE2B e897fd34c01d95efcfd786953766e7da01d1c8b3ab271377a7b2e64460376ee46035182e8dbe4a70bc1dca8be6a04fb6f78752ee86b03ef3aef24161e62ba3d7 SHA512 021b116c2b45908a165a79a2e7654489c741cc4f4616048e42d7de2359ecd38c47a597ca82b3c9e7c02a03436454693955d3bcd90905d221c8ada95d48127fa7
+EBUILD accel-ppp-1.12.0.ebuild 2592 BLAKE2B 3f7daf0250fb68783db2ed77496e55bfdb6cb1cc1e88b82408b3a88eeb98758aca51736824187b42a89daf599d809266509ae5cca236301fe578e63c12d7c014 SHA512 04076ce730fca7993c207c208328c009a62d86f55c21851961356e342cfe5d31e4465b13d9e9fe1915ca8d673716b322b79a8800dedf24fb65e734163f224b63
EBUILD accel-ppp-9999.ebuild 2354 BLAKE2B 95c9c459f2845f5fa5c96530b9b9f47e4cd77e0e5a5fb18da6048973c8d701f8c861bbeab458c9a2226307a7492e9c857da8f6b6d4cfc95cb113f60ebb586315 SHA512 0eeafee53bac5a8e2b377e994cef95588e492a14c822603dc78a79d46a126dd577190349c0d31ff693b613d5d059d1fc923d233b82e40cc1f69c038020cd797d
MISC metadata.xml 507 BLAKE2B 7c0a985830c791f5fe40ed8b624f366eb8e39505fe128b46153740f77ce9c5bd05bf8bf7ffb8939aa42550c9ea08de8f2498d444ef2e930121bbe7f404bf88dd SHA512 6b60c890f172501225ed3da4a229298c2b05601606d047bbe46dbea88246bcce8c15695259063daf73574c9d24048b04d2422c83e2e934015768338120e9154e
diff --git a/net-dialup/accel-ppp/accel-ppp-1.11.1_p20180320.ebuild b/net-dialup/accel-ppp/accel-ppp-1.11.1_p20180320.ebuild
deleted file mode 100644
index 0d27e032077b..000000000000
--- a/net-dialup/accel-ppp/accel-ppp-1.11.1_p20180320.ebuild
+++ /dev/null
@@ -1,105 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit cmake-utils flag-o-matic linux-info linux-mod
-
-DESCRIPTION="High performance PPTP, PPPoE and L2TP server"
-HOMEPAGE="https://sourceforge.net/projects/accel-ppp/"
-SRC_URI="https://dev.gentoo.org/~pinkbyte/distfiles/snapshots/${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="debug doc ipoe lua postgres radius shaper snmp valgrind"
-
-RDEPEND="lua? ( dev-lang/lua:0 )
- postgres? ( dev-db/postgresql:* )
- snmp? ( net-analyzer/net-snmp )
- dev-libs/libpcre
- dev-libs/openssl:0"
-DEPEND="${RDEPEND}
- valgrind? ( dev-util/valgrind )"
-PDEPEND="net-dialup/ppp-scripts"
-
-DOCS=( README )
-
-CONFIG_CHECK="~L2TP ~PPPOE ~PPTP"
-
-REQUIRED_USE="valgrind? ( debug )"
-
-PATCHES=(
- "${FILESDIR}/${PN}-1.11.1-socklen.patch"
-)
-
-S="${WORKDIR}"
-
-pkg_setup() {
- if use ipoe; then
- linux-mod_pkg_setup
- set_arch_to_kernel
- else
- linux-info_pkg_setup
- fi
-}
-
-src_prepare() {
- sed -i -e "/mkdir/d" \
- -e "s: RENAME accel-ppp.conf.dist::" accel-pppd/CMakeLists.txt || die 'sed on accel-pppd/CMakeLists.txt failed'
-
- # Do not install kernel modules like that - breaks sandbox!
- sed -i -e '/modules_install/d' \
- drivers/ipoe/CMakeLists.txt \
- drivers/vlan_mon/CMakeLists.txt || die
-
- # Bug #549918
- append-ldflags -Wl,-z,lazy
-
- cmake-utils_src_prepare
-}
-
-src_configure() {
- local libdir="$(get_libdir)"
- # There must be also dev-libs/tomcrypt (TOMCRYPT) as crypto alternative to OpenSSL
- local mycmakeargs=(
- -DLIB_SUFFIX="${libdir#lib}"
- -DBUILD_IPOE_DRIVER="$(usex ipoe)"
- -DBUILD_PPTP_DRIVER=no
- -DBUILD_VLAN_MON_DRIVER="$(usex ipoe)"
- -DCRYPTO=OPENSSL
- -DLOG_PGSQL="$(usex postgres)"
- -DLUA="$(usex lua)"
- -DMEMDEBUG="$(usex debug)"
- -DNETSNMP="$(usex snmp)"
- -DRADIUS="$(usex radius)"
- -DSHAPER="$(usex shaper)"
- $(use debug && echo "-DVALGRIND=$(usex valgrind)")
- )
- cmake-utils_src_configure
-}
-
-src_compile() {
- cmake-utils_src_compile
-}
-
-src_install() {
- if use ipoe; then
- local MODULE_NAMES="ipoe(accel-ppp:${BUILD_DIR}/drivers/ipoe/driver) vlan_mon(accel-ppp:${BUILD_DIR}/drivers/vlan_mon/driver)"
- linux-mod_src_install
- fi
-
- cmake-utils_src_install
-
- use doc && dodoc -r rfc
-
- if use snmp; then
- insinto /usr/share/snmp/mibs
- doins accel-pppd/extra/net-snmp/ACCEL-PPP-MIB.txt
- fi
-
- newinitd "${FILESDIR}"/${PN}.initd ${PN}d
- newconfd "${FILESDIR}"/${PN}.confd ${PN}d
-
- dodir /var/log/accel-ppp
-}
diff --git a/net-dialup/accel-ppp/accel-ppp-1.12.0.ebuild b/net-dialup/accel-ppp/accel-ppp-1.12.0.ebuild
index f2e7d2b54cce..7362e06b530c 100644
--- a/net-dialup/accel-ppp/accel-ppp-1.12.0.ebuild
+++ b/net-dialup/accel-ppp/accel-ppp-1.12.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -31,6 +31,7 @@ REQUIRED_USE="valgrind? ( debug )"
PATCHES=(
"${FILESDIR}/${PN}-1.11.1-socklen.patch"
+ "${FILESDIR}/${P}-kernel-5.2.patch"
)
pkg_setup() {
diff --git a/net-dialup/accel-ppp/files/accel-ppp-1.12.0-kernel-5.2.patch b/net-dialup/accel-ppp/files/accel-ppp-1.12.0-kernel-5.2.patch
new file mode 100644
index 000000000000..8300908a2d2a
--- /dev/null
+++ b/net-dialup/accel-ppp/files/accel-ppp-1.12.0-kernel-5.2.patch
@@ -0,0 +1,282 @@
+From 4d837cc3bd92493732f2c598560e9e83c82f9b9e Mon Sep 17 00:00:00 2001
+From: Dmitry Kozlov <xeb@mail.ru>
+Date: Tue, 24 Dec 2019 14:50:04 +0300
+Subject: [PATCH] ipoe,vlan_mon: add support for kernels 5.2+
+
+---
+ drivers/ipoe/ipoe.c | 58 +++++++++++++++++++++++++++++--------
+ drivers/vlan_mon/vlan_mon.c | 37 +++++++++++++++++------
+ 2 files changed, 74 insertions(+), 21 deletions(-)
+
+diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c
+index f3acb3f5..6ac6d77a 100644
+--- a/drivers/ipoe/ipoe.c
++++ b/drivers/ipoe/ipoe.c
+@@ -174,6 +174,10 @@ static struct genl_multicast_group ipoe_nl_mcg;
+ #define NETIF_F_HW_VLAN_FILTER NETIF_F_HW_VLAN_CTAG_FILTER
+ #endif
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++#define nla_nest_start_noflag(skb, attr) nla_nest_start(skb, attr)
++#endif
++
+ static inline int hash_addr(__be32 addr)
+ {
+ #ifdef __LITTLE_ENDIAN
+@@ -255,8 +259,13 @@ static int check_nat_required(struct sk_buff *skb, struct net_device *link)
+ if (IS_ERR(rt))
+ return 0;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
+ if (rt->rt_gateway || (rt->dst.dev != link && rt->dst.dev != skb->dev))
+ r = 1;
++#else
++ if (rt->rt_gw4 || (rt->dst.dev != link && rt->dst.dev != skb->dev))
++ r = 1;
++#endif
+
+ ip_rt_put(rt);
+
+@@ -616,7 +625,7 @@ static void ipoe_process_queue(struct work_struct *w)
+ }
+
+ if (report_skb) {
+- ns = nla_nest_start(report_skb, id++);
++ ns = nla_nest_start_noflag(report_skb, id++);
+ if (!ns)
+ goto nl_err;
+
+@@ -1729,7 +1738,7 @@ static int ipoe_nl_cmd_del_net(struct sk_buff *skb, struct genl_info *info)
+ return 0;
+ }
+
+-static struct nla_policy ipoe_nl_policy[IPOE_ATTR_MAX + 1] = {
++static const struct nla_policy ipoe_nl_policy[IPOE_ATTR_MAX + 1] = {
+ [IPOE_ATTR_NONE] = { .type = NLA_UNSPEC, },
+ [IPOE_ATTR_ADDR] = { .type = NLA_U32, },
+ [IPOE_ATTR_PEER_ADDR] = { .type = NLA_U32, },
+@@ -1741,71 +1750,93 @@ static struct nla_policy ipoe_nl_policy[IPOE_ATTR_MAX + 1] = {
+ [IPOE_ATTR_LINK_IFINDEX]= { .type = NLA_U32, },
+ };
+
+-static struct genl_ops ipoe_nl_ops[] = {
++static const struct genl_ops ipoe_nl_ops[] = {
+ {
+ .cmd = IPOE_CMD_NOOP,
+ .doit = ipoe_nl_cmd_noop,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
+ .policy = ipoe_nl_policy,
++#endif
+ /* can be retrieved by unprivileged users */
+ },
+ {
+ .cmd = IPOE_CMD_CREATE,
+ .doit = ipoe_nl_cmd_create,
+- .policy = ipoe_nl_policy,
+ .flags = GENL_ADMIN_PERM,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++ .policy = ipoe_nl_policy,
++#endif
+ },
+ {
+ .cmd = IPOE_CMD_DELETE,
+ .doit = ipoe_nl_cmd_delete,
+- .policy = ipoe_nl_policy,
+ .flags = GENL_ADMIN_PERM,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++ .policy = ipoe_nl_policy,
++#endif
+ },
+ {
+ .cmd = IPOE_CMD_MODIFY,
+ .doit = ipoe_nl_cmd_modify,
+- .policy = ipoe_nl_policy,
+ .flags = GENL_ADMIN_PERM,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++ .policy = ipoe_nl_policy,
++#endif
+ },
+ {
+ .cmd = IPOE_CMD_GET,
+ .dumpit = ipoe_nl_cmd_dump_sessions,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
+ .policy = ipoe_nl_policy,
++#endif
+ },
+ {
+ .cmd = IPOE_CMD_ADD_IF,
+ .doit = ipoe_nl_cmd_add_interface,
+- .policy = ipoe_nl_policy,
+ .flags = GENL_ADMIN_PERM,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++ .policy = ipoe_nl_policy,
++#endif
+ },
+ {
+ .cmd = IPOE_CMD_DEL_IF,
+ .doit = ipoe_nl_cmd_del_interface,
+- .policy = ipoe_nl_policy,
+ .flags = GENL_ADMIN_PERM,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++ .policy = ipoe_nl_policy,
++#endif
+ },
+ {
+ .cmd = IPOE_CMD_ADD_EXCLUDE,
+ .doit = ipoe_nl_cmd_add_exclude,
+- .policy = ipoe_nl_policy,
+ .flags = GENL_ADMIN_PERM,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++ .policy = ipoe_nl_policy,
++#endif
+ },
+ {
+ .cmd = IPOE_CMD_DEL_EXCLUDE,
+ .doit = ipoe_nl_cmd_del_exclude,
+- .policy = ipoe_nl_policy,
+ .flags = GENL_ADMIN_PERM,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++ .policy = ipoe_nl_policy,
++#endif
+ },
+ {
+ .cmd = IPOE_CMD_ADD_NET,
+ .doit = ipoe_nl_cmd_add_net,
+- .policy = ipoe_nl_policy,
+ .flags = GENL_ADMIN_PERM,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++ .policy = ipoe_nl_policy,
++#endif
+ },
+ {
+ .cmd = IPOE_CMD_DEL_NET,
+ .doit = ipoe_nl_cmd_del_net,
+- .policy = ipoe_nl_policy,
+ .flags = GENL_ADMIN_PERM,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++ .policy = ipoe_nl_policy,
++#endif
+ },
+ };
+
+@@ -1834,6 +1865,9 @@ static struct genl_family ipoe_nl_family = {
+ .mcgrps = ipoe_nl_mcgs,
+ .n_mcgrps = ARRAY_SIZE(ipoe_nl_mcgs),
+ #endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)
++ .policy = ipoe_nl_policy,
++#endif
+ };
+
+ static const struct net_device_ops ipoe_netdev_ops = {
+diff --git a/drivers/vlan_mon/vlan_mon.c b/drivers/vlan_mon/vlan_mon.c
+index b6476d4c..271f2ff1 100644
+--- a/drivers/vlan_mon/vlan_mon.c
++++ b/drivers/vlan_mon/vlan_mon.c
+@@ -43,6 +43,10 @@
+ #define vlan_tx_tag_present(skb) skb_vlan_tag_present(skb)
+ #endif
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++#define nla_nest_start_noflag(skb, attr) nla_nest_start(skb, attr)
++#endif
++
+ struct vlan_dev {
+ unsigned int magic;
+ int ifindex;
+@@ -198,13 +202,13 @@ static void vlan_do_notify(struct work_struct *w)
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) && RHEL_MAJOR < 7
+ header = genlmsg_put(report_skb, 0, vlan_mon_nl_mcg.id, &vlan_mon_nl_family, 0, VLAN_MON_NOTIFY);
+ #else
+- header = genlmsg_put(report_skb, 0, vlan_mon_nl_family.mcgrp_offset, &vlan_mon_nl_family, 0, VLAN_MON_NOTIFY);
++ header = genlmsg_put(report_skb, 0, 0, &vlan_mon_nl_family, 0, VLAN_MON_NOTIFY);
+ #endif
+ }
+
+ //pr_info("notify %i vlan %i\n", id, n->vid);
+
+- ns = nla_nest_start(report_skb, id++);
++ ns = nla_nest_start_noflag(report_skb, id++);
+ if (!ns)
+ goto nl_err;
+
+@@ -616,7 +620,7 @@ static int vlan_mon_nl_cmd_check_busy(struct sk_buff *skb, struct genl_info *inf
+ return ret;
+ }
+
+-static struct nla_policy vlan_mon_nl_policy[VLAN_MON_ATTR_MAX + 1] = {
++static const struct nla_policy vlan_mon_nl_policy[VLAN_MON_ATTR_MAX + 1] = {
+ [VLAN_MON_ATTR_NONE] = { .type = NLA_UNSPEC, },
+ [VLAN_MON_ATTR_VLAN_MASK] = { .type = NLA_BINARY, .len = 4096/8 },
+ [VLAN_MON_ATTR_PROTO] = { .type = NLA_U16, },
+@@ -624,42 +628,54 @@ static struct nla_policy vlan_mon_nl_policy[VLAN_MON_ATTR_MAX + 1] = {
+ [VLAN_MON_ATTR_VID] = { .type = NLA_U16, },
+ };
+
+-static struct genl_ops vlan_mon_nl_ops[] = {
++static const struct genl_ops vlan_mon_nl_ops[] = {
+ {
+ .cmd = VLAN_MON_CMD_NOOP,
+ .doit = vlan_mon_nl_cmd_noop,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
+ .policy = vlan_mon_nl_policy,
++#endif
+ /* can be retrieved by unprivileged users */
+ },
+ {
+ .cmd = VLAN_MON_CMD_ADD,
+ .doit = vlan_mon_nl_cmd_add_vlan_mon,
+- .policy = vlan_mon_nl_policy,
+ .flags = GENL_ADMIN_PERM,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++ .policy = vlan_mon_nl_policy,
++#endif
+ },
+ {
+ .cmd = VLAN_MON_CMD_ADD_VID,
+ .doit = vlan_mon_nl_cmd_add_vlan_mon_vid,
+- .policy = vlan_mon_nl_policy,
+ .flags = GENL_ADMIN_PERM,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++ .policy = vlan_mon_nl_policy,
++#endif
+ },
+ {
+ .cmd = VLAN_MON_CMD_DEL,
+ .doit = vlan_mon_nl_cmd_del_vlan_mon,
+- .policy = vlan_mon_nl_policy,
+ .flags = GENL_ADMIN_PERM,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++ .policy = vlan_mon_nl_policy,
++#endif
+ },
+ {
+ .cmd = VLAN_MON_CMD_CHECK_BUSY,
+ .doit = vlan_mon_nl_cmd_check_busy,
+- .policy = vlan_mon_nl_policy,
+ .flags = GENL_ADMIN_PERM,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++ .policy = vlan_mon_nl_policy,
++#endif
+ },
+ {
+ .cmd = VLAN_MON_CMD_DEL_VID,
+ .doit = vlan_mon_nl_cmd_del_vlan_mon_vid,
+- .policy = vlan_mon_nl_policy,
+ .flags = GENL_ADMIN_PERM,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
++ .policy = vlan_mon_nl_policy,
++#endif
+ },
+ };
+
+@@ -688,6 +704,9 @@ static struct genl_family vlan_mon_nl_family = {
+ .mcgrps = vlan_mon_nl_mcgs,
+ .n_mcgrps = ARRAY_SIZE(vlan_mon_nl_mcgs),
+ #endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)
++ .policy = vlan_mon_nl_policy,
++#endif
+ };
+
+ static struct packet_type vlan_pt __read_mostly = {