* [gentoo-commits] repo/gentoo:master commit in: net-dialup/accel-ppp/files/, net-dialup/accel-ppp/
@ 2016-03-23 10:32 Sergey Popov
0 siblings, 0 replies; 4+ messages in thread
From: Sergey Popov @ 2016-03-23 10:32 UTC (permalink / raw
To: gentoo-commits
commit: 81452b25d5c94c5da502af040d7b546dbc61dfdc
Author: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 23 10:31:25 2016 +0000
Commit: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
CommitDate: Wed Mar 23 10:31:25 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=81452b25
net-dialup/accel-ppp: version bump to 1.10.1
Port to EAPI 6, simplify init script,
unify variable names in conf.d file
Gentoo-Bug: 574414
Package-Manager: portage-2.2.28
net-dialup/accel-ppp/Manifest | 1 +
net-dialup/accel-ppp/accel-ppp-1.10.1.ebuild | 85 ++++++++++++++++++++++++++++
net-dialup/accel-ppp/files/accel-ppp.confd | 6 +-
net-dialup/accel-ppp/files/accel-ppp.initd | 34 ++++-------
4 files changed, 99 insertions(+), 27 deletions(-)
diff --git a/net-dialup/accel-ppp/Manifest b/net-dialup/accel-ppp/Manifest
index d1570a7..57b222e 100644
--- a/net-dialup/accel-ppp/Manifest
+++ b/net-dialup/accel-ppp/Manifest
@@ -1,2 +1,3 @@
DIST accel-ppp-1.10.0.tar.bz2 1585702 SHA256 c990cc195e286d3c0f8063881489608e14f3f826d25ca4c0a4812c261fd9ef14 SHA512 140ff3cf9fb684624c1419946010701d902125ba02a1e931fd5a0083d706ffd32a88d491400e82661a17bd4aacfa07ad620acea0cf4f49816c1060ae184f1084 WHIRLPOOL 749b821e1fc3189f4e2a6979e3ee6e00890a3b72311502a42142f75d5f5afe7c913d2ac7b7bcff39de2b4e3c451c783d42a04be72fe37bec8803f8159845f4e2
+DIST accel-ppp-1.10.1.tar.bz2 1587117 SHA256 2333897563925d719b1b5e6fd05238fe769b967a9bac73d3b1daa1b8ff274b7d SHA512 43dc01992a8298970911d202736af0dcd3b46744d18ecce5d4987bab8d312cfb75d5a72a6f5c1b91ad7943c2c66371063402688cce57106db116b407205f142b WHIRLPOOL 0ce66a3a0daf6f4902baf7bf8ace545c1a2e8e9105bb62dc7dad96d3da131a215da17d6e722488fc9388acfb4a7f028bf9904e62c8c7a43fa7d2cb3aa9a7ca81
DIST accel-ppp-1.8.0.tar.bz2 1566401 SHA256 a90becf1d8a579b55a95d927a35f6f83ce9a3ee1f6a6d67128a29b2fa4fd71b7 SHA512 d78c0ed4a3c51ae5f07c580b813694376fc42484a907d65164bb14409392365e2d8a876b16b15e55a7a7178cf9e573d42e578e6739f1fe9d62887e7316c816c0 WHIRLPOOL cfeb6807e2b8734a263ad3450dce07859e12783015d6f315e09d6868c06dc8680da55df8e06a4b5ddb3c014f8423ca0b08b877f465a2649167955b7c4790f648
diff --git a/net-dialup/accel-ppp/accel-ppp-1.10.1.ebuild b/net-dialup/accel-ppp/accel-ppp-1.10.1.ebuild
new file mode 100644
index 0000000..4ea714a
--- /dev/null
+++ b/net-dialup/accel-ppp/accel-ppp-1.10.1.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit cmake-utils linux-info linux-mod
+
+DESCRIPTION="High performance PPTP, PPPoE and L2TP server"
+HOMEPAGE="http://accel-ppp.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc ipoe postgres radius shaper snmp valgrind"
+
+RDEPEND="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 )"
+
+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 "/echo/d" \
+ -e "s: RENAME accel-ppp.conf.dist::" accel-pppd/CMakeLists.txt || die 'sed on accel-pppd/CMakeLists.txt failed'
+
+ eapply_user
+}
+
+src_configure() {
+ local libdir="$(get_libdir)"
+ # There must be also dev-libs/tomcrypt (TOMCRYPT) as crypto alternative to OpenSSL
+ local mycmakeargs=(
+ -DLIB_PATH_SUFFIX="${libdir#lib}"
+ -DBUILD_IPOE_DRIVER="$(usex ipoe)"
+ -DBUILD_PPTP_DRIVER=no
+ -DCRYPTO=OPENSSL
+ -DLOG_PGSQL="$(usex postgres)"
+ -DMEMDEBUG="$(usex debug)"
+ -DNETSNMP="$(usex snmp)"
+ -DRADIUS="$(usex radius)"
+ -DSHAPER="$(usex shaper)"
+ -DVALGRIND="$(usex valgrind)"
+ )
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+}
+
+src_install() {
+ 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/files/accel-ppp.confd b/net-dialup/accel-ppp/files/accel-ppp.confd
index 7b95dfa..41073c6 100644
--- a/net-dialup/accel-ppp/files/accel-ppp.confd
+++ b/net-dialup/accel-ppp/files/accel-ppp.confd
@@ -1,10 +1,10 @@
-# Config file for /etc/init.d/accel-pppd
+# Config file for accel-pppd
# Pid file
-PID="/var/run/accel-ppp/accel-pppd.pid"
+ACCEL_PPPD_PID="/run/accel-ppp/accel-pppd.pid"
# Directory for radius attributes
-RADATTR_DIR="/var/run/radattr"
+RADATTR_DIR="/run/radattr"
# Daemon options
ACCEL_PPPD_OPTS="-d -c /etc/accel-ppp.conf"
diff --git a/net-dialup/accel-ppp/files/accel-ppp.initd b/net-dialup/accel-ppp/files/accel-ppp.initd
index d3f3891..fd9cbad 100644
--- a/net-dialup/accel-ppp/files/accel-ppp.initd
+++ b/net-dialup/accel-ppp/files/accel-ppp.initd
@@ -1,5 +1,5 @@
#!/sbin/runscript
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# $Id$
@@ -9,45 +9,31 @@ depend() {
need net
}
-check_dir() {
-# Check for directory existance, try to create it(if it's not exist yet)
-# and throw error if it can not be done.
-# Parameters:
-# $1 - directory to check
-# $2 - error message
- if [[ ! -d $1 ]]; then
- mkdir "$1" 2>/dev/null
- if [[ $? != 0 ]]; then
- eerror "$2"
- exit 1
- fi
- fi
-}
-
-start() {
+start_pre() {
# Create directory for PID file
- local piddir=$(dirname ${PID})
- check_dir "${piddir}" "Can not create directory $piddir for PID file"
+ checkpath -d -q "$(dirname ${ACCEL_PPPD_PID})"
# Create default directory for radius attributes
- check_dir "${RADATTR_DIR}" "Can not create directory ${RADATTR_DIR} for radius attributes"
+ checkpath -d -q "${RADATTR_DIR}"
+}
+start() {
ebegin "Starting accel-pppd"
- start-stop-daemon --start --quiet --exec /usr/sbin/accel-pppd -- ${ACCEL_PPPD_OPTS} -p ${PID}
+ start-stop-daemon --start --quiet --exec /usr/sbin/accel-pppd -- ${ACCEL_PPPD_OPTS} -p ${ACCEL_PPPD_PID}
eend $?
}
stop() {
ebegin "Stopping accel-pppd"
- start-stop-daemon --stop --quiet --pidfile ${PID}
+ start-stop-daemon --stop --quiet --pidfile ${ACCEL_PPPD_PID}
eend $?
}
reload() {
- if [ ! -f ${PID} ]; then
+ if [ ! -f ${ACCEL_PPPD_PID} ]; then
eerror "accel-pppd isn't running"
return 1
fi
ebegin "Reloading configuration"
- start-stop-daemon --signal USR1 --pidfile ${PID}
+ start-stop-daemon --signal USR1 --pidfile ${ACCEL_PPPD_PID}
eend $?
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-dialup/accel-ppp/files/, net-dialup/accel-ppp/
@ 2017-05-17 13:05 Sergey Popov
0 siblings, 0 replies; 4+ messages in thread
From: Sergey Popov @ 2017-05-17 13:05 UTC (permalink / raw
To: gentoo-commits
commit: 7ff14d70ffe25bdf0053c5764ff07a4b723a6fe1
Author: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
AuthorDate: Wed May 17 13:04:26 2017 +0000
Commit: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
CommitDate: Wed May 17 13:04:26 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ff14d70
net-dialup/accel-ppp: version bump
Fix vlan handling.
Fix building with kernel 4.10.
Fix building postgresql log driver.
Gentoo-Bug: 591572
Package-Manager: Portage-2.3.5, Repoman-2.3.1
net-dialup/accel-ppp/Manifest | 1 +
.../accel-ppp/accel-ppp-1.11.1_p20170508.ebuild | 107 +++++++++++++++++++++
.../files/accel-ppp-1.11.1-linux-4.10.patch | 80 +++++++++++++++
.../accel-ppp/files/accel-ppp-1.11.1-socklen.patch | 18 ++++
4 files changed, 206 insertions(+)
diff --git a/net-dialup/accel-ppp/Manifest b/net-dialup/accel-ppp/Manifest
index 386a2331579..10bbee8ec99 100644
--- a/net-dialup/accel-ppp/Manifest
+++ b/net-dialup/accel-ppp/Manifest
@@ -1 +1,2 @@
DIST accel-ppp-1.11.0.tar.bz2 1594327 SHA256 1b4f02fb0b264d7144c2b3f81c002983aae5b26bcf26af9cd2cd8492222efffe SHA512 907b484e73a4d70757a3991e6f33873aad5f10f6d5180307ee2f3eb0caacc576795d0e9c7666172a00842e6d31563503250f0e8165f6adb2bc88a1270814ea3c WHIRLPOOL 3975b076961c8ed7e3f207309e941785de26452f6ef5490f0668aca19e404e9f2b4ffa978b2af95897fdb339289d578c52f24493a8130ea38ccabe6846363587
+DIST accel-ppp-1.11.1_p20170508.tar.bz2 1609904 SHA256 672a32b990afd970e21188d65b68b1fa067cb272a35686808f21ac66d74e66c3 SHA512 79f928c9d07891957d12443eaf32e96e826d5bebf241dcfcb31a7777fbce2332078bf0c1dd1e1a55cf96154be1fec610f1afd088fc018f54ebd5d265c037c07a WHIRLPOOL 47faf7ee243385c135766a018a51f322b6a1ea2a522d4d0aad674e157ef86e9aa0c1feb1778f17e5c69e89b944652e45f7631fdae48161290fb1a7e4ee66ccd2
diff --git a/net-dialup/accel-ppp/accel-ppp-1.11.1_p20170508.ebuild b/net-dialup/accel-ppp/accel-ppp-1.11.1_p20170508.ebuild
new file mode 100644
index 00000000000..9bfa8e3834d
--- /dev/null
+++ b/net-dialup/accel-ppp/accel-ppp-1.11.1_p20170508.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2017 Gentoo Foundation
+# 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="http://accel-ppp.sourceforge.net/"
+SRC_URI="http://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-linux-4.10.patch"
+ "${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 "/echo/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_PATH_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)"
+ -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/files/accel-ppp-1.11.1-linux-4.10.patch b/net-dialup/accel-ppp/files/accel-ppp-1.11.1-linux-4.10.patch
new file mode 100644
index 00000000000..568a405fd69
--- /dev/null
+++ b/net-dialup/accel-ppp/files/accel-ppp-1.11.1-linux-4.10.patch
@@ -0,0 +1,80 @@
+--- ./drivers/ipoe/ipoe.c.orig 2016-11-28 14:28:33.000000000 +0300
++++ ./drivers/ipoe/ipoe.c 2017-05-17 11:27:42.030000000 +0300
+@@ -52,6 +52,27 @@
+ #define DEFINE_SEMAPHORE(name) struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
+ #endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
++static inline int
++_genl_register_family_with_ops_grps(struct genl_family *family,
++ const struct genl_ops *ops, size_t n_ops,
++ const struct genl_multicast_group *mcgrps,
++ size_t n_mcgrps)
++{
++ family->module = THIS_MODULE;
++ family->ops = ops;
++ family->n_ops = n_ops;
++ family->mcgrps = mcgrps;
++ family->n_mcgrps = n_mcgrps;
++ return genl_register_family(family);
++}
++
++#define genl_register_family_with_ops_groups(family, ops, grps) \
++ _genl_register_family_with_ops_grps((family), \
++ (ops), ARRAY_SIZE(ops), \
++ (grps), ARRAY_SIZE(grps))
++#endif
++
+ struct ipoe_stats {
+ struct u64_stats_sync sync;
+ u64 packets;
+@@ -1668,7 +1689,9 @@
+ };
+
+ static struct genl_family ipoe_nl_family = {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
+ .id = GENL_ID_GENERATE,
++#endif
+ .name = IPOE_GENL_NAME,
+ .version = IPOE_GENL_VERSION,
+ .hdrsize = 0,
+--- ./drivers/vlan_mon/vlan_mon.c.orig 2017-05-17 11:28:23.320000000 +0300
++++ ./drivers/vlan_mon/vlan_mon.c 2017-05-17 11:29:41.660000000 +0300
+@@ -39,6 +39,27 @@
+ #define vlan_tx_tag_present(skb) skb_vlan_tag_present(skb)
+ #endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
++static inline int
++_genl_register_family_with_ops_grps(struct genl_family *family,
++ const struct genl_ops *ops, size_t n_ops,
++ const struct genl_multicast_group *mcgrps,
++ size_t n_mcgrps)
++{
++ family->module = THIS_MODULE;
++ family->ops = ops;
++ family->n_ops = n_ops;
++ family->mcgrps = mcgrps;
++ family->n_mcgrps = n_mcgrps;
++ return genl_register_family(family);
++}
++
++#define genl_register_family_with_ops_groups(family, ops, grps) \
++ _genl_register_family_with_ops_grps((family), \
++ (ops), ARRAY_SIZE(ops), \
++ (grps), ARRAY_SIZE(grps))
++#endif
++
+ struct vlan_dev {
+ unsigned int magic;
+ int ifindex;
+@@ -660,7 +681,9 @@
+ };
+
+ 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,
diff --git a/net-dialup/accel-ppp/files/accel-ppp-1.11.1-socklen.patch b/net-dialup/accel-ppp/files/accel-ppp-1.11.1-socklen.patch
new file mode 100644
index 00000000000..79f76cae98a
--- /dev/null
+++ b/net-dialup/accel-ppp/files/accel-ppp-1.11.1-socklen.patch
@@ -0,0 +1,18 @@
+commit 68008248259dfaa2fde91f8697db889971056bb3
+Author: lmwangi <lmwangi@gmail.com>
+Date: Tue Jun 7 13:55:04 2016 +0300
+
+ fix build issue where socketlen is not found
+
+diff --git a/accel-pppd/logs/log_pgsql.c b/accel-pppd/logs/log_pgsql.c
+index e4b5a9e..78fa72d 100644
+--- a/accel-pppd/logs/log_pgsql.c
++++ b/accel-pppd/logs/log_pgsql.c
+@@ -1,6 +1,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <sys/socket.h>
+
+ #include <postgresql/libpq-fe.h>
+
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-dialup/accel-ppp/files/, net-dialup/accel-ppp/
@ 2019-10-09 12:39 Sergey Popov
0 siblings, 0 replies; 4+ messages in thread
From: Sergey Popov @ 2019-10-09 12:39 UTC (permalink / raw
To: gentoo-commits
commit: d38ae7dcf2f474c2c6b057dc3a5fb2e7fd50c43a
Author: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 9 12:38:13 2019 +0000
Commit: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
CommitDate: Wed Oct 9 12:38:13 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d38ae7dc
net-dialup/accel-ppp: drop old versions
Signed-off-by: Sergey Popov <pinkbyte <AT> gentoo.org>
Package-Manager: Portage-2.3.66, Repoman-2.3.11
net-dialup/accel-ppp/Manifest | 1 -
.../accel-ppp/accel-ppp-1.11.1_p20170508.ebuild | 107 ---------------------
net-dialup/accel-ppp/accel-ppp-1.11.9999.ebuild | 101 -------------------
.../files/accel-ppp-1.11.1-linux-4.10.patch | 80 ---------------
4 files changed, 289 deletions(-)
diff --git a/net-dialup/accel-ppp/Manifest b/net-dialup/accel-ppp/Manifest
index 23f9de0f93a..8cd346959bb 100644
--- a/net-dialup/accel-ppp/Manifest
+++ b/net-dialup/accel-ppp/Manifest
@@ -1,2 +1 @@
-DIST accel-ppp-1.11.1_p20170508.tar.bz2 1609904 BLAKE2B 5993e25e09e84fa62fde28e6c79b11514eb5e0c365a8cc1a36c4e3e56ac868725b14049e28184188330ac78cb6c128429f2cc89241d871c02e4154c6882a89e2 SHA512 79f928c9d07891957d12443eaf32e96e826d5bebf241dcfcb31a7777fbce2332078bf0c1dd1e1a55cf96154be1fec610f1afd088fc018f54ebd5d265c037c07a
DIST accel-ppp-1.11.1_p20180320.tar.bz2 1634359 BLAKE2B 97ca709ef3740c2ac1d75f6fba3acbf9229c3cb48f3a55735eaa14b74c2b0af96d637cbb145bc9e98a5b245704806cdc3d8f9d8692809626e0f73d73702c4a0a SHA512 a8a2420332c02087e45bbaab25831ae5d2d370fd56b29db77c267083badc22b90ca4b0ec7335e13250ac8f150002b2a3c343cfba6c2378932778777dc936d914
diff --git a/net-dialup/accel-ppp/accel-ppp-1.11.1_p20170508.ebuild b/net-dialup/accel-ppp/accel-ppp-1.11.1_p20170508.ebuild
deleted file mode 100644
index 07366eb315c..00000000000
--- a/net-dialup/accel-ppp/accel-ppp-1.11.1_p20170508.ebuild
+++ /dev/null
@@ -1,107 +0,0 @@
-# Copyright 1999-2019 Gentoo Foundation
-# 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-linux-4.10.patch"
- "${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 "/echo/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_PATH_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)"
- -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.11.9999.ebuild b/net-dialup/accel-ppp/accel-ppp-1.11.9999.ebuild
deleted file mode 100644
index 817a5e3058f..00000000000
--- a/net-dialup/accel-ppp/accel-ppp-1.11.9999.ebuild
+++ /dev/null
@@ -1,101 +0,0 @@
-# Copyright 1999-2019 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-EGIT_REPO_URI="git://git.code.sf.net/p/accel-ppp/code"
-EGIT_BRANCH="1.11"
-inherit cmake-utils flag-o-matic git-r3 linux-info linux-mod
-
-DESCRIPTION="High performance PPTP, PPPoE and L2TP server"
-HOMEPAGE="https://sourceforge.net/projects/accel-ppp/"
-SRC_URI=""
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS=""
-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 )"
-
-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/files/accel-ppp-1.11.1-linux-4.10.patch b/net-dialup/accel-ppp/files/accel-ppp-1.11.1-linux-4.10.patch
deleted file mode 100644
index 568a405fd69..00000000000
--- a/net-dialup/accel-ppp/files/accel-ppp-1.11.1-linux-4.10.patch
+++ /dev/null
@@ -1,80 +0,0 @@
---- ./drivers/ipoe/ipoe.c.orig 2016-11-28 14:28:33.000000000 +0300
-+++ ./drivers/ipoe/ipoe.c 2017-05-17 11:27:42.030000000 +0300
-@@ -52,6 +52,27 @@
- #define DEFINE_SEMAPHORE(name) struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
- #endif
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
-+static inline int
-+_genl_register_family_with_ops_grps(struct genl_family *family,
-+ const struct genl_ops *ops, size_t n_ops,
-+ const struct genl_multicast_group *mcgrps,
-+ size_t n_mcgrps)
-+{
-+ family->module = THIS_MODULE;
-+ family->ops = ops;
-+ family->n_ops = n_ops;
-+ family->mcgrps = mcgrps;
-+ family->n_mcgrps = n_mcgrps;
-+ return genl_register_family(family);
-+}
-+
-+#define genl_register_family_with_ops_groups(family, ops, grps) \
-+ _genl_register_family_with_ops_grps((family), \
-+ (ops), ARRAY_SIZE(ops), \
-+ (grps), ARRAY_SIZE(grps))
-+#endif
-+
- struct ipoe_stats {
- struct u64_stats_sync sync;
- u64 packets;
-@@ -1668,7 +1689,9 @@
- };
-
- static struct genl_family ipoe_nl_family = {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
- .id = GENL_ID_GENERATE,
-+#endif
- .name = IPOE_GENL_NAME,
- .version = IPOE_GENL_VERSION,
- .hdrsize = 0,
---- ./drivers/vlan_mon/vlan_mon.c.orig 2017-05-17 11:28:23.320000000 +0300
-+++ ./drivers/vlan_mon/vlan_mon.c 2017-05-17 11:29:41.660000000 +0300
-@@ -39,6 +39,27 @@
- #define vlan_tx_tag_present(skb) skb_vlan_tag_present(skb)
- #endif
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
-+static inline int
-+_genl_register_family_with_ops_grps(struct genl_family *family,
-+ const struct genl_ops *ops, size_t n_ops,
-+ const struct genl_multicast_group *mcgrps,
-+ size_t n_mcgrps)
-+{
-+ family->module = THIS_MODULE;
-+ family->ops = ops;
-+ family->n_ops = n_ops;
-+ family->mcgrps = mcgrps;
-+ family->n_mcgrps = n_mcgrps;
-+ return genl_register_family(family);
-+}
-+
-+#define genl_register_family_with_ops_groups(family, ops, grps) \
-+ _genl_register_family_with_ops_grps((family), \
-+ (ops), ARRAY_SIZE(ops), \
-+ (grps), ARRAY_SIZE(grps))
-+#endif
-+
- struct vlan_dev {
- unsigned int magic;
- int ifindex;
-@@ -660,7 +681,9 @@
- };
-
- 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,
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-dialup/accel-ppp/files/, net-dialup/accel-ppp/
@ 2020-01-09 12:25 Sergey Popov
0 siblings, 0 replies; 4+ messages in thread
From: Sergey Popov @ 2020-01-09 12:25 UTC (permalink / raw
To: gentoo-commits
commit: 8405112f9e37d099beb627a54af37cae60647ec3
Author: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 9 12:22:49 2020 +0000
Commit: Sergey Popov <pinkbyte <AT> gentoo <DOT> org>
CommitDate: Thu Jan 9 12:25:34 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8405112f
net-dialup/accel-ppp: backport compatibility patch for new kernels
Closes: https://bugs.gentoo.org/704306
Signed-off-by: Sergey Popov <pinkbyte <AT> gentoo.org>
Package-Manager: Portage-2.3.66, Repoman-2.3.11
net-dialup/accel-ppp/Manifest | 1 -
net-dialup/accel-ppp/accel-ppp-1.12.0.ebuild | 3 +-
.../files/accel-ppp-1.12.0-kernel-5.2.patch | 282 +++++++++++++++++++++
3 files changed, 284 insertions(+), 2 deletions(-)
diff --git a/net-dialup/accel-ppp/Manifest b/net-dialup/accel-ppp/Manifest
index e8ecf5cc9a3..2272c95bf67 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 f2e7d2b54cc..e60b57f2e25 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 00000000000..8300908a2d2
--- /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 = {
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-01-09 12:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-17 13:05 [gentoo-commits] repo/gentoo:master commit in: net-dialup/accel-ppp/files/, net-dialup/accel-ppp/ Sergey Popov
-- strict thread matches above, loose matches on Subject: below --
2020-01-09 12:25 Sergey Popov
2019-10-09 12:39 Sergey Popov
2016-03-23 10:32 Sergey Popov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox