aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan P. Stanić <mps@arvanta.net>2020-02-03 22:08:51 +0100
committerLeo <thinkabit.ukim@gmail.com>2020-02-17 22:55:00 -0300
commita8ec4b78e11d61f19c0928514a9bbe8d8123dbc6 (patch)
tree235584c562fb9b150d319f163ba1869310c7d738
parent6643152a7873b35bf460de9006da472ad9f50c29 (diff)
downloadaports-a8ec4b78e11d61f19c0928514a9bbe8d8123dbc6.tar.bz2
aports-a8ec4b78e11d61f19c0928514a9bbe8d8123dbc6.tar.xz
main/ppp: upgrade to 2.4.8
change source to github ppp repository remove defaultroute-metric.3.patch, fixed upstream remove prepare() function and use default change builddir and remove _builddir fix musl-fix-headers.patch add fix-pppd-magic.h.patch (split out of the musl-fix-headers.patch and addapted) add fix-pppd-pppoe.h.patch (split out of the musl-fix-headers.patch and addapted) enable USE_CRYPT=y in pppd/Makefile.linux to use libcrypto, else it try to use des.h (which does not exist on Alpine).
-rw-r--r--main/ppp/APKBUILD33
-rw-r--r--main/ppp/defaultroute-metric.3.patch140
-rw-r--r--main/ppp/fix-pppd-magic.h.patch11
-rw-r--r--main/ppp/fix-pppd-pppoe.h.patch21
-rw-r--r--main/ppp/musl-fix-headers.patch38
5 files changed, 46 insertions, 197 deletions
diff --git a/main/ppp/APKBUILD b/main/ppp/APKBUILD
index a51e463a73..f9188f86fa 100644
--- a/main/ppp/APKBUILD
+++ b/main/ppp/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=ppp
-pkgver=2.4.7
-pkgrel=6
+pkgver=2.4.8
+pkgrel=0
pkgdesc="A daemon which implements the PPP protocol for dial-up networking"
url="http://www.samba.org/ppp/"
arch="all"
@@ -21,28 +21,19 @@ depends="$pkgname-chat $pkgname-radius
$pkgname-daemon
"
-source="https://ftp.samba.org/pub/ppp/ppp-$pkgver.tar.gz
- defaultroute-metric.3.patch
+source="https://github.com/paulusmack/ppp/archive/ppp-$pkgver.tar.gz
musl-fix-headers.patch
fix-paths.patch
0011-build-sys-don-t-put-connect-errors-log-to-etc-ppp.patch
+ fix-pppd-magic.h.patch
+ fix-pppd-pppoe.h.patch
ip-down
ip-up
pppd.initd"
-_builddir="$srcdir"/$pkgname-$pkgver
-prepare() {
- local i
- cd "$_builddir"
- for i in $source; do
- case $i in
- *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
- esac
- done
-}
+builddir="$srcdir"/$pkgname-$pkgname-$pkgver
build () {
- cd "$_builddir"
# fix CFLAGS
# -D_GNU_SOURCE is needed for IPv6 to work apparently
@@ -58,6 +49,8 @@ build () {
sed -i "s:^#HAVE_INET6=y:HAVE_INET6=y:" pppd/Makefile.linux
# Enable Microsoft proprietary Callback Control Protocol
sed -i "s:^#CBCP=y:CBCP=y:" pppd/Makefile.linux
+ sed -i "s:^#CBCP=y:CBCP=y:" pppd/Makefile.linux
+ sed -i "s:^#USE_CRYPT=y:USE_CRYPT=y:" pppd/Makefile.linux
./configure \
--build=$CBUILD \
--host=$CHOST \
@@ -68,7 +61,6 @@ build () {
}
package() {
- cd "$_builddir"
make INSTROOT="$pkgdir" install || return 1
install -Dm644 include/net/ppp_defs.h \
"$pkgdir"/usr/include/net/ppp_defs.h || return 1
@@ -154,7 +146,7 @@ radius() {
_mv usr/lib/pppd/$pkgver/radattr.so 755
_mv usr/lib/pppd/$pkgver/radrealms.so 755
install -d "$subpkgdir"/etc/radiusclient
- cp -r "$_builddir"/pppd/plugins/radius/etc/* "$subpkgdir"/etc/radiusclient
+ cp -r "$builddir"/pppd/plugins/radius/etc/* "$subpkgdir"/etc/radiusclient
mv "$subpkgdir"/etc/radiusclient/radiusclient.conf.in "$subpkgdir"/etc/radiusclient/radiusclient.conf
sed -i "s:@pkgsysconfdir@:/etc/radiusclient:g" "$subpkgdir"/etc/radiusclient/radiusclient.conf
sed -i "s:@sbindir@:/usr/sbin:g" "$subpkgdir"/etc/radiusclient/radiusclient.conf
@@ -172,11 +164,12 @@ daemon() {
mv "$pkgdir"/* "$subpkgdir"/ || return 1
}
-sha512sums="e34ce24020af6a73e7a26c83c4f73a9c83fa455b7b363794dba27bf01f70368be06bff779777843949bd77f4bc9385d6ad455ea48bf8fff4e0d73cc8fef16ae2 ppp-2.4.7.tar.gz
-fccc7a6809ae4a617796ccf1d2132de8edb1cc0c71d76a95393585a5970b92be2a54da558702db355c8aea8d37b4dfffc64406129a2b3322f0b10e8f0481f685 defaultroute-metric.3.patch
-2f071ea9db15e4abf1bed6cce8130dc81b710a31bfef5fa8f9370c353f845dbc47674b1551b8e040478e5156add6f98d480530206125e8bb308f0f4288d1eec6 musl-fix-headers.patch
+sha512sums="a99b3b6c7bd80cd133bda4e29d33c793a76f3b67e1f8db774547e88932ce29564fad390a4f51d3fe30a75e006499b95000b042ae0f64cd360548426f8091a478 ppp-2.4.8.tar.gz
+55642ce365a7cf7dda05366ac6e74f6badba3cc7bc980760e0a2ee7bfa768ea033c4a3880b3387e0787d719742698f627c624f890d68800344d31c0309c0374d musl-fix-headers.patch
8384afb992a98a7f97b484866e6aa1b1de51e901d7837f84f7ce2beba6815591450fab43957f03b65804424c4940c59640a9cd878979240a171aa77427e9c4ff fix-paths.patch
b490971d03fef4de66b61123f80a0087270bcb88466ae8ed98ea9a08b35d4c7c46b2dadd304e2970a4206bb5760a14370d7e3873de6240119d88e927ecef840c 0011-build-sys-don-t-put-connect-errors-log-to-etc-ppp.patch
+d1067defff79d6c9f67121a9214e41a1bcca1e3b8a345ad905d223fdb8835142bad7cc3b556a3eca509ddf51cf808741773f31f4dca74e834b612a15854a5e6b fix-pppd-magic.h.patch
+d76237c82af0a3ed7ede9e814d6849b94221f1fd15e4ee68cadd33a308a32d87d635acd14f84508c9e38a10ad0a9e96ce391044da37e217d11b89a4f6631abf7 fix-pppd-pppoe.h.patch
160260bd2a788beaac395eadb38efbfd1e0e1a458fe151555acacf2c4f3a12381d644672c664f9793db6e3459a4f05a54e3ff6d407b0d37e8014b15bd0f11bcc ip-down
8258c95a6b6e8e94d6001b5cd3a99bd3270f29ba0f2e5050a26c8d5f1b67eead8d039e71ce86a784d45e620047b0a2bb14b258d80a9ea62084ba588a4c2e2d84 ip-up
bd6f43588b037367ffdb57f5e331492dcaa5969003e219c2dc8b90e6be1aa407282ff6114b91d1379ebeff766983fa0622456520cc0ac592b4f0b1496acf21bf pppd.initd"
diff --git a/main/ppp/defaultroute-metric.3.patch b/main/ppp/defaultroute-metric.3.patch
deleted file mode 100644
index d4dc5df325..0000000000
--- a/main/ppp/defaultroute-metric.3.patch
+++ /dev/null
@@ -1,140 +0,0 @@
-From ddea82ad5cb547f3582060d6a0265bb96a0634ea Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Tue, 3 Jun 2014 08:53:47 +0000
-Subject: [PATCH] pppd: add support for defaultroute-metric option
-
-This allows user to specify the 'metric' (or 'prio') for the default
-route set by pppd. This is useful in multi-ISP setups where there
-might be more than one default gateway.
-
-Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
----
- pppd/options.c | 5 +++++
- pppd/pppd.8 | 6 ++++++
- pppd/sys-linux.c | 24 ++++++++++++++++--------
- 3 files changed, 27 insertions(+), 8 deletions(-)
-
-diff --git a/pppd/options.c b/pppd/options.c
-index 45fa742..ca3f875 100644
---- a/pppd/options.c
-+++ b/pppd/options.c
-@@ -121,6 +121,7 @@ bool dryrun; /* print out option values and exit */
- char *domain; /* domain name set by domain option */
- int child_wait = 5; /* # seconds to wait for children at exit */
- struct userenv *userenv_list; /* user environment variables */
-+int dfl_route_metric = -1; /* metric of the default route to set over the PPP link */
-
- #ifdef MAXOCTETS
- unsigned int maxoctets = 0; /* default - no limit */
-@@ -299,6 +300,10 @@ option_t general_options[] = {
- "Unset user environment variable",
- OPT_A2PRINTER | OPT_NOPRINT, (void *)user_unsetprint },
-
-+ { "defaultroute-metric", o_int, &dfl_route_metric,
-+ "Metric to use for the default route (Linux only; -1 for default behavior)",
-+ OPT_PRIV|OPT_LLIMIT|OPT_INITONLY, NULL, 0, -1 },
-+
- #ifdef HAVE_MULTILINK
- { "multilink", o_bool, &multilink,
- "Enable multilink operation", OPT_PRIO | 1 },
-diff --git a/pppd/pppd.8 b/pppd/pppd.8
-index e2768b1..c508d27 100644
---- a/pppd/pppd.8
-+++ b/pppd/pppd.8
-@@ -121,6 +121,12 @@ the gateway, when IPCP negotiation is successfully completed.
- This entry is removed when the PPP connection is broken. This option
- is privileged if the \fInodefaultroute\fR option has been specified.
- .TP
-+.B defaultroute-metric
-+Define the metric of the \fIdefaultroute\fR and only add it if there
-+is no other default route with the same metric. With the default
-+value of -1, the route is only added if there is no default route at
-+all.
-+.TP
- .B disconnect \fIscript
- Execute the command specified by \fIscript\fR, by passing it to a
- shell, after
-diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
-index 72a7727..6d71530 100644
---- a/pppd/sys-linux.c
-+++ b/pppd/sys-linux.c
-@@ -232,7 +232,7 @@ static int baud_rate_of (int speed);
- static void close_route_table (void);
- static int open_route_table (void);
- static int read_route_table (struct rtentry *rt);
--static int defaultroute_exists (struct rtentry *rt);
-+static int defaultroute_exists (struct rtentry *rt, int metric);
- static int get_ether_addr (u_int32_t ipaddr, struct sockaddr *hwaddr,
- char *name, int namelen);
- static void decode_version (char *buf, int *version, int *mod, int *patch);
-@@ -242,6 +242,8 @@ static int make_ppp_unit(void);
-
- extern u_char inpacket_buf[]; /* borrowed from main.c */
-
-+extern int dfl_route_metric;
-+
- /*
- * SET_SA_FAMILY - set the sa_family field of a struct sockaddr,
- * if it exists.
-@@ -1550,9 +1552,10 @@ static int read_route_table(struct rtentry *rt)
- /********************************************************************
- *
- * defaultroute_exists - determine if there is a default route
-+ * with the given metric (or negative for any)
- */
-
--static int defaultroute_exists (struct rtentry *rt)
-+static int defaultroute_exists (struct rtentry *rt, int metric)
- {
- int result = 0;
-
-@@ -1565,7 +1568,8 @@ static int defaultroute_exists (struct rtentry *rt)
-
- if (kernel_version > KVERSION(2,1,0) && SIN_ADDR(rt->rt_genmask) != 0)
- continue;
-- if (SIN_ADDR(rt->rt_dst) == 0L) {
-+ if (SIN_ADDR(rt->rt_dst) == 0L && (metric < 0 ||
-+ (metric >= 0 && (rt->rt_metric + 1) == metric))) {
- result = 1;
- break;
- }
-@@ -1612,13 +1616,13 @@ int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
- {
- struct rtentry rt;
-
-- if (defaultroute_exists(&rt) && strcmp(rt.rt_dev, ifname) != 0) {
-+ if (defaultroute_exists(&rt, dfl_route_metric) && strcmp(rt.rt_dev, ifname) != 0) {
- if (rt.rt_flags & RTF_GATEWAY)
-- error("not replacing existing default route via %I",
-- SIN_ADDR(rt.rt_gateway));
-+ error("not replacing existing default route via %I with metric %d",
-+ SIN_ADDR(rt.rt_gateway), dfl_route_metric);
- else
-- error("not replacing existing default route through %s",
-- rt.rt_dev);
-+ error("not replacing existing default route through %s with metric %d",
-+ rt.rt_dev, dfl_route_metric);
- return 0;
- }
-
-@@ -1626,6 +1630,7 @@ int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
- SET_SA_FAMILY (rt.rt_dst, AF_INET);
-
- rt.rt_dev = ifname;
-+ rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */
-
- if (kernel_version > KVERSION(2,1,0)) {
- SET_SA_FAMILY (rt.rt_genmask, AF_INET);
-@@ -1660,6 +1665,9 @@ int cifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
-
- rt.rt_dev = ifname;
-
-+ rt.rt_dev = ifname;
-+ rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */
-+
- if (kernel_version > KVERSION(2,1,0)) {
- SET_SA_FAMILY (rt.rt_genmask, AF_INET);
- SIN_ADDR(rt.rt_genmask) = 0L;
---
-2.0.0
-
diff --git a/main/ppp/fix-pppd-magic.h.patch b/main/ppp/fix-pppd-magic.h.patch
new file mode 100644
index 0000000000..01a89d5204
--- /dev/null
+++ b/main/ppp/fix-pppd-magic.h.patch
@@ -0,0 +1,11 @@
+--- a/pppd/magic.h 2019-12-31 02:31:26.000000000 +0100
++++ b/pppd/magic.h 2020-02-06 20:52:49.263657502 +0100
+@@ -42,6 +42,8 @@
+ * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $
+ */
+
++#include <sys/cdefs.h>
++
+ void magic_init (void); /* Initialize the magic number generator */
+ u_int32_t magic (void); /* Returns the next magic number */
+
diff --git a/main/ppp/fix-pppd-pppoe.h.patch b/main/ppp/fix-pppd-pppoe.h.patch
new file mode 100644
index 0000000000..1fc452a894
--- /dev/null
+++ b/main/ppp/fix-pppd-pppoe.h.patch
@@ -0,0 +1,21 @@
+--- a/pppd/plugins/rp-pppoe/pppoe.h 2020-02-06 09:59:38.086103782 +0100
++++ b/pppd/plugins/rp-pppoe/pppoe.h 2020-02-06 20:50:20.159705281 +0100
+@@ -84,18 +84,6 @@
+ #include <linux/if_ether.h>
+ #endif
+
+-#ifdef HAVE_NETINET_IF_ETHER_H
+-#include <sys/types.h>
+-
+-#ifdef HAVE_SYS_SOCKET_H
+-#include <sys/socket.h>
+-#endif
+-#ifndef HAVE_SYS_DLPI_H
+-#include <netinet/if_ether.h>
+-#endif
+-#endif
+-
+-
+ /* Ethernet frame types according to RFC 2516 */
+ #define ETH_PPPOE_DISCOVERY 0x8863
+ #define ETH_PPPOE_SESSION 0x8864
diff --git a/main/ppp/musl-fix-headers.patch b/main/ppp/musl-fix-headers.patch
index d24f628968..47042dc674 100644
--- a/main/ppp/musl-fix-headers.patch
+++ b/main/ppp/musl-fix-headers.patch
@@ -24,19 +24,6 @@ index a74c914..7acd2cf 100644
LIBS += -lutil
endif
-diff --git a/pppd/magic.h b/pppd/magic.h
-index c81213b..305aece 100644
---- a/pppd/magic.h
-+++ b/pppd/magic.h
-@@ -42,6 +42,8 @@
- * $Id: magic.h,v 1.5 2003/06/11 23:56:26 paulus Exp $
- */
-
-+#include <sys/cdefs.h>
-+
- void magic_init __P((void)); /* Initialize the magic number generator */
- u_int32_t magic __P((void)); /* Returns the next magic number */
-
diff --git a/pppd/plugins/rp-pppoe/if.c b/pppd/plugins/rp-pppoe/if.c
index 91e9a57..9c0fac3 100644
--- a/pppd/plugins/rp-pppoe/if.c
@@ -88,29 +75,6 @@ index 3d3bf4e..b5f82d3 100644
/* Initialize frame types to RFC 2516 values. Some broken peers apparently
use different frame types... sigh... */
-diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
-index 9ab2eee..4d68147 100644
---- a/pppd/plugins/rp-pppoe/pppoe.h
-+++ b/pppd/plugins/rp-pppoe/pppoe.h
-@@ -86,18 +86,6 @@ typedef unsigned long UINT32_t;
-
- #include <netinet/in.h>
-
--#ifdef HAVE_NETINET_IF_ETHER_H
--#include <sys/types.h>
--
--#ifdef HAVE_SYS_SOCKET_H
--#include <sys/socket.h>
--#endif
--#ifndef HAVE_SYS_DLPI_H
--#include <netinet/if_ether.h>
--#endif
--#endif
--
--
-
- /* Ethernet frame types according to RFC 2516 */
- #define ETH_PPPOE_DISCOVERY 0x8863
diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
index 6d71530..86d224e 100644
--- a/pppd/sys-linux.c
@@ -119,7 +83,7 @@ index 6d71530..86d224e 100644
#define MAX_ADDR_LEN 7
#endif
--#if __GLIBC__ >= 2
+-#if !defined(__GLIBC__) || __GLIBC__ >= 2
#include <asm/types.h> /* glibc 2 conflicts with linux/types.h */
#include <net/if.h>
#include <net/if_arp.h>