summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Popov <pinkbyte@gentoo.org>2020-01-09 15:22:49 +0300
committerSergey Popov <pinkbyte@gentoo.org>2020-01-09 15:25:34 +0300
commit8405112f9e37d099beb627a54af37cae60647ec3 (patch)
tree6b4a788ca3291d365d29d5bd3fecdc794127eda0 /net-dialup/accel-ppp
parentnet-dialup/accel-ppp: drop old version (diff)
downloadgentoo-8405112f9e37d099beb627a54af37cae60647ec3.tar.gz
gentoo-8405112f9e37d099beb627a54af37cae60647ec3.tar.bz2
gentoo-8405112f9e37d099beb627a54af37cae60647ec3.zip
net-dialup/accel-ppp: backport compatibility patch for new kernels
Closes: https://bugs.gentoo.org/704306 Signed-off-by: Sergey Popov <pinkbyte@gentoo.org> Package-Manager: Portage-2.3.66, Repoman-2.3.11
Diffstat (limited to 'net-dialup/accel-ppp')
-rw-r--r--net-dialup/accel-ppp/Manifest1
-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
3 files changed, 284 insertions, 2 deletions
diff --git a/net-dialup/accel-ppp/Manifest b/net-dialup/accel-ppp/Manifest
index e8ecf5cc9a3b..2272c95bf67f 100644
--- a/net-dialup/accel-ppp/Manifest
+++ b/net-dialup/accel-ppp/Manifest
@@ -1,2 +1 @@
-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
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..e60b57f2e258 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}/${PV}-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 = {