summaryrefslogtreecommitdiff
path: root/net-dialup/accel-ppp/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-dialup/accel-ppp/files
reinit the tree, so we can have metadata
Diffstat (limited to 'net-dialup/accel-ppp/files')
-rw-r--r--net-dialup/accel-ppp/files/accel-ppp-1.11.1-linux-4.10.patch80
-rw-r--r--net-dialup/accel-ppp/files/accel-ppp-1.11.1-socklen.patch18
-rw-r--r--net-dialup/accel-ppp/files/accel-ppp.confd10
-rw-r--r--net-dialup/accel-ppp/files/accel-ppp.initd44
4 files changed, 152 insertions, 0 deletions
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 000000000000..568a405fd69c
--- /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 000000000000..79f76cae98a3
--- /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>
+
diff --git a/net-dialup/accel-ppp/files/accel-ppp.confd b/net-dialup/accel-ppp/files/accel-ppp.confd
new file mode 100644
index 000000000000..41073c6529c6
--- /dev/null
+++ b/net-dialup/accel-ppp/files/accel-ppp.confd
@@ -0,0 +1,10 @@
+# Config file for accel-pppd
+
+# Pid file
+ACCEL_PPPD_PID="/run/accel-ppp/accel-pppd.pid"
+
+# Directory for radius attributes
+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
new file mode 100644
index 000000000000..abbc4286228a
--- /dev/null
+++ b/net-dialup/accel-ppp/files/accel-ppp.initd
@@ -0,0 +1,44 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+extra_started_commands="reload"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ # Create directory for PID file
+ checkpath -d -q "$(dirname ${ACCEL_PPPD_PID})"
+ # Create default directory 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 ${ACCEL_PPPD_PID}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping accel-pppd"
+ accel-cmd shutdown
+ [ $? -ne 0 ] && kill -9 $(pidof accel-pppd)
+ PID="$(cat ${ACCEL_PPPD_PID})"
+ while [ -n "${PID}" -a -d "/proc/${PID}" ]; do
+ sleep 1
+ done
+ rm -f ${ACCEL_PPPD_PID}
+ eend 0
+}
+
+reload() {
+ if [ ! -f ${ACCEL_PPPD_PID} ]; then
+ eerror "accel-pppd isn't running"
+ return 1
+ fi
+ ebegin "Reloading configuration"
+ start-stop-daemon --signal USR1 --pidfile ${ACCEL_PPPD_PID}
+ eend $?
+}