* [ptxdist] [PATCH 2/4] ppp: version bump to 2.4.7
2017-06-02 12:56 [ptxdist] version bumps for some packages Sascha Hauer
2017-06-02 12:56 ` [ptxdist] [PATCH 1/4] dnsmasq: Version bump to 2.76 Sascha Hauer
@ 2017-06-02 12:56 ` Sascha Hauer
2017-06-15 7:38 ` Ladislav Michl
2017-06-02 12:56 ` [ptxdist] [PATCH 3/4] sqlite: version bump to 3.19.2 Sascha Hauer
2017-06-02 12:56 ` [ptxdist] [PATCH 4/4] bzip2: Fix CVE-2016-3189 Sascha Hauer
3 siblings, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2017-06-02 12:56 UTC (permalink / raw)
To: ptxdist
This updates ppp to version 2.4.7. The former 2.4.5 version had the
Debian package patches applied plus some ptxdist specific patches. The
Debian patches have been updated to the recent 2.4.7 Debian patches, the
ptxdist specific patches have been forward ported from the 2.4.5 ptxdist
package.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
patches/ppp-2.4.5/0001-git-20100307.patch | 134 ------
patches/ppp-2.4.5/0002-pppoatm_no_modprobe.patch | 21 -
patches/ppp-2.4.5/0004-use_system_logwtmp.patch | 28 --
patches/ppp-2.4.5/0005-update_if_pppol2tp.patch | 61 ---
.../ppp-2.4.5/0006-dont-exit-pado-timeout.patch | 50 ---
patches/ppp-2.4.5/0007-fix_warnings.patch | 38 --
patches/ppp-2.4.5/0008-man_syntax_errors.patch | 63 ---
patches/ppp-2.4.5/0009-makefiles_cleanup.patch | 499 ---------------------
patches/ppp-2.4.5/0010-always_setsid.patch | 45 --
patches/ppp-2.4.5/0012-chat_man.patch | 31 --
patches/ppp-2.4.5/0013-documentation_typos.patch | 95 ----
patches/ppp-2.4.5/0015-fix_null_pppdb.patch | 35 --
patches/ppp-2.4.5/0024-radius_enanchements.patch | 166 -------
patches/ppp-2.4.5/0030-no_crypt_hack.patch | 62 ---
.../0035-use-CPPFLAGS-when-compiling.patch | 64 ---
...Remove-old-version-of-Linux-if_pppol2tp.h.patch | 104 -----
patches/ppp-2.4.5/series | 39 --
.../0001-adaptive_echos.patch} | 12 +-
patches/ppp-2.4.7/0002-Makefiles-cleanup.patch | 291 ++++++++++++
...ppd-does-not-properly-close-dev-ppp-on-p.patch} | 15 +-
...pp-linkpidfile-is-not-created-upon-detac.patch} | 19 +-
...rt-building-pppdump-with-the-system-zlib.patch} | 28 +-
...able-unneeded-code-in-the-pppoatm-plugin.patch} | 22 +-
...7-cosmetic-cleanup-of-the-pppoatm-plugin.patch} | 10 +-
.../0008-pppoe_noads.patch} | 8 +-
.../0009-make-_PATH_CONNERRS-world-readable.patch} | 12 +-
.../0010-Correct-unkown-unknown-typo.patch | 39 ++
.../0011-pppoe-custom-host-uniq-tag.patch | 298 ++++++++++++
.../0012-scripts_redialer.patch} | 8 +-
.../0013-Add-replacedefaultroute-option.patch} | 215 +++++----
.../0014-ppp-2.3.11-oedod.patch} | 24 +-
...port-for-the-Framed-MTU-Radius-attribute.patch} | 25 +-
.../0016-ip-up_option.patch} | 36 +-
.../0017-ppp-2.4.2-stripMSdomain.patch} | 6 +-
...018-export-CALL_FILE-to-the-link-scripts.patch} | 19 +-
patches/ppp-2.4.7/0019-ipv6-accept-remote.patch | 70 +++
...20-allow-use-of-arbitrary-interface-names.patch | 210 +++++++++
...tial-buffer-overflow-in-clientid.c-rc_map.patch | 38 ++
.../0022-scripts-README.patch} | 8 +-
patches/ppp-2.4.7/0023-no_crypt_hack.patch | 61 +++
.../0024-resolv.conf_no_log.patch} | 8 +-
.../0025-Debian-specific-changes.patch} | 45 +-
.../0026-secure-card-interpreter-fix.patch | 26 ++
.../0027-Fix-buffer-overflow-in-rc_mksid.patch | 30 ++
.../0028-Add-a-SONAME-to-the-pppd-binary.patch | 38 ++
patches/ppp-2.4.7/0029-Fix-FTBFS-in-rp-pppoe.patch | 36 ++
.../0030-pppd-make-makefile-sysroot-aware.patch} | 19 +-
...make-the-self-made-configure-cross-aware.patch} | 10 +-
patches/ppp-2.4.7/series | 34 ++
rules/ppp.make | 4 +-
50 files changed, 1424 insertions(+), 1835 deletions(-)
delete mode 100644 patches/ppp-2.4.5/0001-git-20100307.patch
delete mode 100644 patches/ppp-2.4.5/0002-pppoatm_no_modprobe.patch
delete mode 100644 patches/ppp-2.4.5/0004-use_system_logwtmp.patch
delete mode 100644 patches/ppp-2.4.5/0005-update_if_pppol2tp.patch
delete mode 100644 patches/ppp-2.4.5/0006-dont-exit-pado-timeout.patch
delete mode 100644 patches/ppp-2.4.5/0007-fix_warnings.patch
delete mode 100644 patches/ppp-2.4.5/0008-man_syntax_errors.patch
delete mode 100644 patches/ppp-2.4.5/0009-makefiles_cleanup.patch
delete mode 100644 patches/ppp-2.4.5/0010-always_setsid.patch
delete mode 100644 patches/ppp-2.4.5/0012-chat_man.patch
delete mode 100644 patches/ppp-2.4.5/0013-documentation_typos.patch
delete mode 100644 patches/ppp-2.4.5/0015-fix_null_pppdb.patch
delete mode 100644 patches/ppp-2.4.5/0024-radius_enanchements.patch
delete mode 100644 patches/ppp-2.4.5/0030-no_crypt_hack.patch
delete mode 100644 patches/ppp-2.4.5/0035-use-CPPFLAGS-when-compiling.patch
delete mode 100644 patches/ppp-2.4.5/0036-Remove-old-version-of-Linux-if_pppol2tp.h.patch
delete mode 100644 patches/ppp-2.4.5/series
rename patches/{ppp-2.4.5/0003-adaptive_echos.patch => ppp-2.4.7/0001-adaptive_echos.patch} (90%)
create mode 100644 patches/ppp-2.4.7/0002-Makefiles-cleanup.patch
rename patches/{ppp-2.4.5/0011-close_dev_ppp.patch => ppp-2.4.7/0003-Bug-306261-pppd-does-not-properly-close-dev-ppp-on-p.patch} (75%)
rename patches/{ppp-2.4.5/0014-fix_linkpidfile.patch => ppp-2.4.7/0004-Bug-284382-ppp-linkpidfile-is-not-created-upon-detac.patch} (74%)
rename patches/{ppp-2.4.5/0016-pppdump_use_zlib.patch => ppp-2.4.7/0005-support-building-pppdump-with-the-system-zlib.patch} (60%)
rename patches/{ppp-2.4.5/0017-pppoatm_resolver_light.patch => ppp-2.4.7/0006-disable-unneeded-code-in-the-pppoatm-plugin.patch} (87%)
rename patches/{ppp-2.4.5/0018-pppoatm_cleanup.patch => ppp-2.4.7/0007-cosmetic-cleanup-of-the-pppoatm-plugin.patch} (92%)
rename patches/{ppp-2.4.5/0019-pppoe_noads.patch => ppp-2.4.7/0008-pppoe_noads.patch} (72%)
rename patches/{ppp-2.4.5/0020-readable_connerrs.patch => ppp-2.4.7/0009-make-_PATH_CONNERRS-world-readable.patch} (67%)
create mode 100644 patches/ppp-2.4.7/0010-Correct-unkown-unknown-typo.patch
create mode 100644 patches/ppp-2.4.7/0011-pppoe-custom-host-uniq-tag.patch
rename patches/{ppp-2.4.5/0021-011_scripts_redialer.diff.patch => ppp-2.4.7/0012-scripts_redialer.patch} (96%)
rename patches/{ppp-2.4.5/0022-cifdefroute.dif.patch => ppp-2.4.7/0013-Add-replacedefaultroute-option.patch} (64%)
rename patches/{ppp-2.4.5/0023-ppp-2.3.11-oedod.dif.patch => ppp-2.4.7/0014-ppp-2.3.11-oedod.patch} (92%)
rename patches/{ppp-2.4.5/0025-radius_mtu.patch => ppp-2.4.7/0015-add-support-for-the-Framed-MTU-Radius-attribute.patch} (52%)
rename patches/{ppp-2.4.5/0026-018_ip-up_option.diff.patch => ppp-2.4.7/0016-ip-up_option.patch} (79%)
rename patches/{ppp-2.4.5/0027-ppp-2.4.2-stripMSdomain.patch => ppp-2.4.7/0017-ppp-2.4.2-stripMSdomain.patch} (91%)
rename patches/{ppp-2.4.5/0028-setenv_call_file.patch => ppp-2.4.7/0018-export-CALL_FILE-to-the-link-scripts.patch} (65%)
create mode 100644 patches/ppp-2.4.7/0019-ipv6-accept-remote.patch
create mode 100644 patches/ppp-2.4.7/0020-allow-use-of-arbitrary-interface-names.patch
create mode 100644 patches/ppp-2.4.7/0021-fix-a-potential-buffer-overflow-in-clientid.c-rc_map.patch
rename patches/{ppp-2.4.5/0029-010_scripts_README.diff.patch => ppp-2.4.7/0022-scripts-README.patch} (87%)
create mode 100644 patches/ppp-2.4.7/0023-no_crypt_hack.patch
rename patches/{ppp-2.4.5/0031-resolv.conf_no_log.patch => ppp-2.4.7/0024-resolv.conf_no_log.patch} (71%)
rename patches/{ppp-2.4.5/0032-zzz_config.patch => ppp-2.4.7/0025-Debian-specific-changes.patch} (66%)
create mode 100644 patches/ppp-2.4.7/0026-secure-card-interpreter-fix.patch
create mode 100644 patches/ppp-2.4.7/0027-Fix-buffer-overflow-in-rc_mksid.patch
create mode 100644 patches/ppp-2.4.7/0028-Add-a-SONAME-to-the-pppd-binary.patch
create mode 100644 patches/ppp-2.4.7/0029-Fix-FTBFS-in-rp-pppoe.patch
rename patches/{ppp-2.4.5/0033-pppd-make-makefile-sysroot-aware.patch => ppp-2.4.7/0030-pppd-make-makefile-sysroot-aware.patch} (70%)
rename patches/{ppp-2.4.5/0034-pppd-make-the-self-made-configure-cross-aware.patch => ppp-2.4.7/0031-pppd-make-the-self-made-configure-cross-aware.patch} (84%)
create mode 100644 patches/ppp-2.4.7/series
diff --git a/patches/ppp-2.4.5/0001-git-20100307.patch b/patches/ppp-2.4.5/0001-git-20100307.patch
deleted file mode 100644
index d0d0e5b4a..000000000
--- a/patches/ppp-2.4.5/0001-git-20100307.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] git-20100307
-
----
- pppd/lcp.c | 28 +++++++++++++++++++---------
- pppd/plugins/pppol2tp/Makefile.linux | 2 +-
- pppd/plugins/rp-pppoe/plugin.c | 4 ++--
- pppd/pppd.8 | 8 ++++++++
- 4 files changed, 30 insertions(+), 12 deletions(-)
-
-diff --git a/pppd/lcp.c b/pppd/lcp.c
-index 5c77490..8ed2778 100644
---- a/pppd/lcp.c
-+++ b/pppd/lcp.c
-@@ -397,21 +397,29 @@ lcp_close(unit, reason)
- char *reason;
- {
- fsm *f = &lcp_fsm[unit];
-+ int oldstate;
-
- if (phase != PHASE_DEAD && phase != PHASE_MASTER)
- new_phase(PHASE_TERMINATE);
-- if (f->state == STOPPED && f->flags & (OPT_PASSIVE|OPT_SILENT)) {
-+
-+ if (f->flags & DELAYED_UP) {
-+ untimeout(lcp_delayed_up, f);
-+ f->state = STOPPED;
-+ }
-+ oldstate = f->state;
-+
-+ fsm_close(f, reason);
-+ if (oldstate == STOPPED && f->flags & (OPT_PASSIVE|OPT_SILENT|DELAYED_UP)) {
- /*
- * This action is not strictly according to the FSM in RFC1548,
- * but it does mean that the program terminates if you do a
-- * lcp_close() in passive/silent mode when a connection hasn't
-- * been established.
-+ * lcp_close() when a connection hasn't been established
-+ * because we are in passive/silent mode or because we have
-+ * delayed the fsm_lowerup() call and it hasn't happened yet.
- */
-- f->state = CLOSED;
-+ f->flags &= ~DELAYED_UP;
- lcp_finished(f);
--
-- } else
-- fsm_close(f, reason);
-+ }
- }
-
-
-@@ -453,9 +461,10 @@ lcp_lowerdown(unit)
- {
- fsm *f = &lcp_fsm[unit];
-
-- if (f->flags & DELAYED_UP)
-+ if (f->flags & DELAYED_UP) {
- f->flags &= ~DELAYED_UP;
-- else
-+ untimeout(lcp_delayed_up, f);
-+ } else
- fsm_lowerdown(&lcp_fsm[unit]);
- }
-
-@@ -489,6 +498,7 @@ lcp_input(unit, p, len)
-
- if (f->flags & DELAYED_UP) {
- f->flags &= ~DELAYED_UP;
-+ untimeout(lcp_delayed_up, f);
- fsm_lowerup(f);
- }
- fsm_input(f, p, len);
-diff --git a/pppd/plugins/pppol2tp/Makefile.linux b/pppd/plugins/pppol2tp/Makefile.linux
-index 19eff67..ea3538e 100644
---- a/pppd/plugins/pppol2tp/Makefile.linux
-+++ b/pppd/plugins/pppol2tp/Makefile.linux
-@@ -20,7 +20,7 @@ all: $(PLUGINS)
-
- install: all
- $(INSTALL) -d -m 755 $(LIBDIR)
-- $(INSTALL) -c -m 4550 $(PLUGINS) $(LIBDIR)
-+ $(INSTALL) -c -m 755 $(PLUGINS) $(LIBDIR)
-
- clean:
- rm -f *.o *.so
-diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
-index e94494b..9bd6643 100644
---- a/pppd/plugins/rp-pppoe/plugin.c
-+++ b/pppd/plugins/rp-pppoe/plugin.c
-@@ -108,8 +108,6 @@ PPPOEInitDevice(void)
- novm("PPPoE session data");
- }
- memset(conn, 0, sizeof(PPPoEConnection));
-- conn->acName = acName;
-- conn->serviceName = pppd_pppoe_service;
- conn->ifName = devnam;
- conn->discoverySocket = -1;
- conn->sessionSocket = -1;
-@@ -133,6 +131,8 @@ PPPOEConnectDevice(void)
- {
- struct sockaddr_pppox sp;
-
-+ conn->acName = acName;
-+ conn->serviceName = pppd_pppoe_service;
- strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam));
- if (existingSession) {
- unsigned int mac[ETH_ALEN];
-diff --git a/pppd/pppd.8 b/pppd/pppd.8
-index 8ea8200..b7adc77 100644
---- a/pppd/pppd.8
-+++ b/pppd/pppd.8
-@@ -193,6 +193,9 @@ will not accept a different value from the peer in the IPCP
- negotiation, unless the \fIipcp\-accept\-local\fR and/or
- \fIipcp\-accept\-remote\fR options are given, respectively.
- .TP
-+.B +ipv6
-+Enable the IPv6CP and IPv6 protocols.
-+.TP
- .B ipv6 \fI<local_interface_identifier>\fR,\fI<remote_interface_identifier>
- Set the local and/or remote 64-bit interface identifier. Either one may be
- omitted. The identifier must be specified in standard ascii notation of
-@@ -449,6 +452,11 @@ scripts. If this
- option is given, the \fIstring\fR supplied is given as the 6th
- parameter to those scripts.
- .TP
-+.B ipv6cp\-accept\-local
-+With this option, pppd will accept the peer's idea of our local IPv6
-+interface identifier, even if the local IPv6 interface identifier
-+was specified in an option.
-+.TP
- .B ipv6cp\-max\-configure \fIn
- Set the maximum number of IPv6CP configure-request transmissions to
- \fIn\fR (default 10).
diff --git a/patches/ppp-2.4.5/0002-pppoatm_no_modprobe.patch b/patches/ppp-2.4.5/0002-pppoatm_no_modprobe.patch
deleted file mode 100644
index ed8390f06..000000000
--- a/patches/ppp-2.4.5/0002-pppoatm_no_modprobe.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] pppoatm_no_modprobe
-
----
- pppd/plugins/pppoatm/pppoatm.c | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/pppd/plugins/pppoatm/pppoatm.c b/pppd/plugins/pppoatm/pppoatm.c
-index 7712c6d..d693350 100644
---- a/pppd/plugins/pppoatm/pppoatm.c
-+++ b/pppd/plugins/pppoatm/pppoatm.c
-@@ -133,8 +133,6 @@ static int connect_pppoatm(void)
- int fd;
- struct atm_qos qos;
-
-- system ("/sbin/modprobe -q pppoatm");
--
- if (!device_got_set)
- no_device_given_pppoatm();
- fd = socket(AF_ATMPVC, SOCK_DGRAM, 0);
diff --git a/patches/ppp-2.4.5/0004-use_system_logwtmp.patch b/patches/ppp-2.4.5/0004-use_system_logwtmp.patch
deleted file mode 100644
index edc6ec9e3..000000000
--- a/patches/ppp-2.4.5/0004-use_system_logwtmp.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] use_system_logwtmp
-
----
- pppd/sys-linux.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
-index b675c97..1643ac5 100644
---- a/pppd/sys-linux.c
-+++ b/pppd/sys-linux.c
-@@ -2153,6 +2153,7 @@ int ppp_available(void)
- * Update the wtmp file with the appropriate user name and tty device.
- */
-
-+#ifndef linux
- void logwtmp (const char *line, const char *name, const char *host)
- {
- struct utmp ut, *utp;
-@@ -2221,6 +2222,7 @@ void logwtmp (const char *line, const char *name, const char *host)
- }
- #endif
- }
-+#endif
-
-
- /********************************************************************
diff --git a/patches/ppp-2.4.5/0005-update_if_pppol2tp.patch b/patches/ppp-2.4.5/0005-update_if_pppol2tp.patch
deleted file mode 100644
index 50afbffa8..000000000
--- a/patches/ppp-2.4.5/0005-update_if_pppol2tp.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] update_if_pppol2tp
-
----
- include/linux/if_pppol2tp.h | 24 +++++++++++++++++++-----
- 1 file changed, 19 insertions(+), 5 deletions(-)
-
-diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
-index 4113d6a..7ee86b2 100644
---- a/include/linux/if_pppol2tp.h
-+++ b/include/linux/if_pppol2tp.h
-@@ -2,7 +2,7 @@
- * Linux PPP over L2TP (PPPoL2TP) Socket Implementation (RFC 2661)
- *
- * This file supplies definitions required by the PPP over L2TP driver
-- * (pppol2tp.c). All version information wrt this file is located in pppol2tp.c
-+ * (l2tp_ppp.c). All version information wrt this file is located in l2tp_ppp.c
- *
- * License:
- * This program is free software; you can redistribute it and/or
-@@ -15,14 +15,14 @@
- #ifndef __LINUX_IF_PPPOL2TP_H
- #define __LINUX_IF_PPPOL2TP_H
-
--#include <asm/types.h>
-+#include <linux/types.h>
-+
-
- /* Structure used to connect() the socket to a particular tunnel UDP
- * socket.
- */
--struct pppol2tp_addr
--{
-- pid_t pid; /* pid that owns the fd.
-+struct pppol2tp_addr {
-+ __kernel_pid_t pid; /* pid that owns the fd.
- * 0 => current */
- int fd; /* FD of UDP socket to use */
-
-@@ -32,6 +32,20 @@ struct pppol2tp_addr
- __u16 d_tunnel, d_session; /* For sending outgoing packets */
- };
-
-+/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
-+ * bits. So we need a different sockaddr structure.
-+ */
-+struct pppol2tpv3_addr {
-+ pid_t pid; /* pid that owns the fd.
-+ * 0 => current */
-+ int fd; /* FD of UDP or IP socket to use */
-+
-+ struct sockaddr_in addr; /* IP address and port to send to */
-+
-+ __u32 s_tunnel, s_session; /* For matching incoming packets */
-+ __u32 d_tunnel, d_session; /* For sending outgoing packets */
-+};
-+
- /* Socket options:
- * DEBUG - bitmask of debug message categories
- * SENDSEQ - 0 => don't send packets with sequence numbers
diff --git a/patches/ppp-2.4.5/0006-dont-exit-pado-timeout.patch b/patches/ppp-2.4.5/0006-dont-exit-pado-timeout.patch
deleted file mode 100644
index 7791a1cab..000000000
--- a/patches/ppp-2.4.5/0006-dont-exit-pado-timeout.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From: "peter@endian.com" <peter@endian.com>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] dont-exit-pado-timeout
-
-To: ppp-bugs@ppp.samba.org
-Subject: using rp-pppoe pppd exits with EXIT_OK after receiving a timeout waiting for PADO due to no modem attached
-Date: Mon, 17 Nov 2008 19:46:54 +0000 (GMT)
-
-Full_Name: Peter Warasin
-Version: 2.4.4
-OS: linux 2.6.22.19
-Submission from: (NULL) (217.133.34.27)
-
-
-Using rp-pppoe pppd exits with exitcode 0, whenever there is no modem connected
-and pppd get's a timeout while waiting for a PADO.
-
-This happens because status is set to EXIT_OK in main.c at the beginning of the
-procedures. Within start_link(), connect() will be called as one of the first
-calls.
-If that call fails (no pppoe discovery for example), jumps to "fail", which
-returns without setting the status variable to failure. So at the end pppd exits
-with EXIT_OK.
-
-I moved the status = EXIT_NEGOTIATION_FAILED which will be set later within
-start_link, at the top of it. That seems to work out, patch is attached:
----
- pppd/auth.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pppd/auth.c b/pppd/auth.c
-index fb71944..031c030 100644
---- a/pppd/auth.c
-+++ b/pppd/auth.c
-@@ -555,6 +555,7 @@ void start_link(unit)
- {
- char *msg;
-
-+ status = EXIT_NEGOTIATION_FAILED;
- new_phase(PHASE_SERIALCONN);
-
- hungup = 0;
-@@ -591,7 +592,6 @@ void start_link(unit)
- notice("Starting negotiation on %s", ppp_devnam);
- add_fd(fd_ppp);
-
-- status = EXIT_NEGOTIATION_FAILED;
- new_phase(PHASE_ESTABLISH);
-
- lcp_lowerup(0);
diff --git a/patches/ppp-2.4.5/0007-fix_warnings.patch b/patches/ppp-2.4.5/0007-fix_warnings.patch
deleted file mode 100644
index 3247ec97a..000000000
--- a/patches/ppp-2.4.5/0007-fix_warnings.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] fix_warnings
-
-fix minor issues
-
-Fix warnings, missing prototypes, an incomplete clean target.
----
- pppd/ipv6cp.c | 2 +-
- pppd/pppd.h | 2 ++
- 2 files changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/pppd/ipv6cp.c b/pppd/ipv6cp.c
-index 4a09c9a..d01b778 100644
---- a/pppd/ipv6cp.c
-+++ b/pppd/ipv6cp.c
-@@ -1120,7 +1120,7 @@ ipv6_check_options()
-
- if (demand && (eui64_iszero(wo->ourid) || eui64_iszero(wo->hisid))) {
- option_error("local/remote LL address required for demand-dialling\n");
-- exit(1);
-+ die(1);
- }
- }
-
-diff --git a/pppd/pppd.h b/pppd/pppd.h
-index cf9840a..87522d0 100644
---- a/pppd/pppd.h
-+++ b/pppd/pppd.h
-@@ -642,6 +642,8 @@ int sif6addr __P((int, eui64_t, eui64_t));
- /* Configure IPv6 addresses for i/f */
- int cif6addr __P((int, eui64_t, eui64_t));
- /* Remove an IPv6 address from i/f */
-+int ether_to_eui64 __P((eui64_t *));
-+ /* Convert Ethernet address into 64-bit EUI */
- #endif
- int sifdefaultroute __P((int, u_int32_t, u_int32_t));
- /* Create default route through i/f */
diff --git a/patches/ppp-2.4.5/0008-man_syntax_errors.patch b/patches/ppp-2.4.5/0008-man_syntax_errors.patch
deleted file mode 100644
index 89d332895..000000000
--- a/patches/ppp-2.4.5/0008-man_syntax_errors.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] man_syntax_errors
-
-Fix some syntax errors in the man pages.
----
- chat/chat.8 | 8 ++++----
- pppstats/pppstats.8 | 2 +-
- 2 files changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/chat/chat.8 b/chat/chat.8
-index b532292..60b2803 100644
---- a/chat/chat.8
-+++ b/chat/chat.8
-@@ -288,7 +288,7 @@ ABORT 'BUSY'
- .br
- ABORT 'NO CARRIER'
- .br
--'' ATZ
-+\&'' ATZ
- .br
- OK\\r\\n ATD1234567
- .br
-@@ -318,7 +318,7 @@ signal behavior. Here is an (simple) example script:
- .IP
- ABORT 'BUSY'
- .br
--'' ATZ
-+\&'' ATZ
- .br
- OK\\r\\n ATD1234567
- .br
-@@ -365,7 +365,7 @@ The special reply string of \fIEOT\fR indicates that the chat program
- should send an EOT character to the remote. This is normally the
- End-of-file character sequence. A return character is not sent
- following the EOT.
--.PR
-+.LP
- The EOT sequence may be embedded into the send string using the
- sequence \fI^D\fR.
- .SH GENERATING BREAK
-@@ -374,7 +374,7 @@ to be sent. The break is a special signal on the transmitter. The
- normal processing on the receiver is to change the transmission rate.
- It may be used to cycle through the available transmission rates on
- the remote until you are able to receive a valid login prompt.
--.PR
-+.LP
- The break sequence may be embedded into the send string using the
- \fI\\K\fR sequence.
- .SH ESCAPE SEQUENCES
-diff --git a/pppstats/pppstats.8 b/pppstats/pppstats.8
-index 217ffa9..4ac101e 100644
---- a/pppstats/pppstats.8
-+++ b/pppstats/pppstats.8
-@@ -172,7 +172,7 @@ option is specified.
- When the
- .B \-z
- option is specified,
--.Nm pppstats
-+.B pppstats
- instead displays the following fields, relating to the packet
- compression algorithm currently in use. If packet compression is not
- in use, these fields will all display zeroes. The fields displayed on
diff --git a/patches/ppp-2.4.5/0009-makefiles_cleanup.patch b/patches/ppp-2.4.5/0009-makefiles_cleanup.patch
deleted file mode 100644
index df41ccc64..000000000
--- a/patches/ppp-2.4.5/0009-makefiles_cleanup.patch
+++ /dev/null
@@ -1,499 +0,0 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] makefiles_cleanup
-
-Makefiles cleanup
-
-Factor-out $CFLAGS and $LDFLAGS to allow distributions to easily override
-them. Properly use $LDFLAGS when linking and $CFLAGS when compiling.
----
- chat/Makefile.linux | 11 ++++----
- pppd/Makefile.linux | 46 ++++++++++++++++++----------------
- pppd/plugins/Makefile.linux | 11 +++++---
- pppd/plugins/pppoatm/Makefile.linux | 12 ++++-----
- pppd/plugins/pppol2tp/Makefile.linux | 10 ++++----
- pppd/plugins/radius/Makefile.linux | 24 ++++++++++--------
- pppd/plugins/rp-pppoe/Makefile.linux | 22 ++++++++--------
- pppdump/Makefile.linux | 10 +++++---
- pppstats/Makefile.linux | 14 +++++------
- 9 files changed, 86 insertions(+), 74 deletions(-)
-
-diff --git a/chat/Makefile.linux b/chat/Makefile.linux
-index 1065ac5..eb50bbe 100644
---- a/chat/Makefile.linux
-+++ b/chat/Makefile.linux
-@@ -8,24 +8,23 @@ CDEF1= -DTERMIOS # Use the termios structure
- CDEF2= -DSIGTYPE=void # Standard definition
- CDEF3= -UNO_SLEEP # Use the usleep function
- CDEF4= -DFNDELAY=O_NDELAY # Old name value
--CDEFS= $(CDEF1) $(CDEF2) $(CDEF3) $(CDEF4)
-+COPTS= $(CDEF1) $(CDEF2) $(CDEF3) $(CDEF4)
-
--COPTS= -O2 -g -pipe
--CFLAGS= $(COPTS) $(CDEFS)
-+CFLAGS= -O2 -g
-
- INSTALL= install
-
- all: chat
-
- chat: chat.o
-- $(CC) -o chat chat.o
-+ $(CC) $(LDFLAGS) -o chat chat.o
-
- chat.o: chat.c
-- $(CC) -c $(CFLAGS) -o chat.o chat.c
-+ $(CC) -c $(COPTS) $(CFLAGS) -o chat.o chat.c
-
- install: chat
- mkdir -p $(BINDIR) $(MANDIR)
-- $(INSTALL) -s -c chat $(BINDIR)
-+ $(INSTALL) -c chat $(BINDIR)
- $(INSTALL) -c -m 644 chat.8 $(MANDIR)
-
- clean:
-diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
-index 060db6a..44cf309 100644
---- a/pppd/Makefile.linux
-+++ b/pppd/Makefile.linux
-@@ -32,7 +32,7 @@ endif
-
- # CC = gcc
- #
--COPTS = -O2 -pipe -Wall -g
-+CFLAGS = -O2 -g
- LIBS =
-
- # Uncomment the next 2 lines to include support for Microsoft's
-@@ -79,27 +79,26 @@ INCLUDE_DIRS= -I../include
-
- COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
-
--CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
--
- ifdef CHAPMS
--CFLAGS += -DCHAPMS=1
-+COMPILE_FLAGS += -DCHAPMS=1
- NEEDDES=y
- PPPDOBJS += md4.o chap_ms.o
- HEADERS += md4.h chap_ms.h
- ifdef MSLANMAN
--CFLAGS += -DMSLANMAN=1
-+COMPILE_FLAGS += -DMSLANMAN=1
- endif
- ifdef MPPE
--CFLAGS += -DMPPE=1
-+COMPILE_FLAGS += -DMPPE=1
- endif
- endif
-
- # EAP SRP-SHA1
- ifdef USE_SRP
--CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
-+COMPILE_FLAGS += -DUSE_SRP -DOPENSSL
-+INCLUDE_DIRS += -I/usr/local/ssl/include
- LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto
- TARGETS += srp-entry
--EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
-+EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
- MANPAGES += srp-entry.8
- EXTRACLEAN += srp-entry.o
- NEEDDES=y
-@@ -113,12 +112,12 @@ PPPDOBJS += sha1.o
- endif
-
- ifdef HAS_SHADOW
--CFLAGS += -DHAS_SHADOW
-+COMPILE_FLAGS += -DHAS_SHADOW
- #LIBS += -lshadow $(LIBS)
- endif
-
- ifneq ($(wildcard /usr/include/crypt.h),)
--CFLAGS += -DHAVE_CRYPT_H=1
-+COMPILE_FLAGS += -DHAVE_CRYPT_H=1
- LIBS += -lcrypt
- endif
-
-@@ -126,7 +125,7 @@ ifdef NEEDDES
- ifndef USE_CRYPT
- LIBS += -ldes $(LIBS)
- else
--CFLAGS += -DUSE_CRYPT=1
-+COMPILE_FLAGS += -DUSE_CRYPT=1
- endif
- PPPDOBJS += pppcrypt.o
- HEADERS += pppcrypt.h
-@@ -134,7 +133,7 @@ endif
-
- # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
- ifdef USE_PAM
--CFLAGS += -DUSE_PAM
-+COMPILE_FLAGS += -DUSE_PAM
- LIBS += -lpam -ldl
- endif
-
-@@ -143,14 +142,14 @@ ifdef HAVE_MULTILINK
- # Multilink implies the use of TDB
- USE_TDB=y
-
-- CFLAGS += -DHAVE_MULTILINK
-+ COMPILE_FLAGS += -DHAVE_MULTILINK
- PPPDSRCS += multilink.c
- PPPDOBJS += multilink.o
- endif
-
- # TDB
- ifdef USE_TDB
-- CFLAGS += -DUSE_TDB=1
-+ COMPILE_FLAGS += -DUSE_TDB=1
- PPPDSRCS += tdb.c spinlock.c
- PPPDOBJS += tdb.o spinlock.o
- HEADERS += tdb.h spinlock.h
-@@ -159,11 +158,11 @@ endif
- # Lock library binary for Linux is included in 'linux' subdirectory.
- ifdef LOCKLIB
- LIBS += -llock
--CFLAGS += -DLOCKLIB=1
-+COMPILE_FLAGS += -DLOCKLIB=1
- endif
-
- ifdef PLUGIN
--CFLAGS += -DPLUGIN
-+COMPILE_FLAGS += -DPLUGIN
- LDFLAGS += -Wl,-E
- LIBS += -ldl
- endif
-@@ -171,7 +170,7 @@ endif
- ifdef FILTER
- ifneq ($(wildcard /usr/include/pcap-bpf.h),)
- LIBS += -lpcap
--CFLAGS += -DPPP_FILTER
-+COMPILE_FLAGS += -DPPP_FILTER
- endif
- endif
-
-@@ -179,20 +178,22 @@ ifdef HAVE_INET6
- PPPDSRCS += ipv6cp.c eui64.c
- HEADERS += ipv6cp.h eui64.h
- PPPDOBJS += ipv6cp.o eui64.o
-- CFLAGS += -DINET6=1
-+ COMPILE_FLAGS += -DINET6=1
- endif
-
- ifdef CBCP
- PPPDSRCS += cbcp.c
- PPPDOBJS += cbcp.o
-- CFLAGS += -DCBCP_SUPPORT
-+ COMPILE_FLAGS += -DCBCP_SUPPORT
- HEADERS += cbcp.h
- endif
-
- ifdef MAXOCTETS
-- CFLAGS += -DMAXOCTETS
-+ COMPILE_FLAGS += -DMAXOCTETS
- endif
-
-+COPTS = $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
-+
- INSTALL= install
-
- all: $(TARGETS)
-@@ -200,11 +201,14 @@ all: $(TARGETS)
- install: pppd
- mkdir -p $(BINDIR) $(MANDIR)
- $(EXTRAINSTALL)
-- $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
-+ $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd
- if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
- chmod o-rx,u+s $(BINDIR)/pppd; fi
- $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
-
-+%.o: %.c
-+ $(CC) $(COPTS) $(CFLAGS) -c $<
-+
- pppd: $(PPPDOBJS)
- $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
-
-diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux
-index 0a7ec7b..47613d7 100644
---- a/pppd/plugins/Makefile.linux
-+++ b/pppd/plugins/Makefile.linux
-@@ -1,7 +1,7 @@
- #CC = gcc
--COPTS = -O2 -g
--CFLAGS = $(COPTS) -I.. -I../../include -fPIC
--LDFLAGS = -shared
-+CFLAGS = -O2 -g
-+COPTS = -I.. -I../../include -fPIC
-+LDFLAGS =
- INSTALL = install
-
- DESTDIR = $(INSTROOT)@DESTDIR@
-@@ -22,8 +22,11 @@ endif
- all: $(PLUGINS)
- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
-
-+%.o: %.c
-+ $(CC) $(COPTS) $(CFLAGS) -c $<
-+
- %.so: %.c
-- $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
-+ $(CC) -o $@ $(LDFLAGS) -shared $(COPTS) $(CFLAGS) $^
-
- VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
-
-diff --git a/pppd/plugins/pppoatm/Makefile.linux b/pppd/plugins/pppoatm/Makefile.linux
-index 20f62e6..f3cb5c4 100644
---- a/pppd/plugins/pppoatm/Makefile.linux
-+++ b/pppd/plugins/pppoatm/Makefile.linux
-@@ -1,7 +1,7 @@
- #CC = gcc
--COPTS = -O2 -g
--CFLAGS = $(COPTS) -I../.. -I../../../include -fPIC
--LDFLAGS = -shared
-+CFLAGS = -O2 -g
-+COPTS = -I../.. -I../../../include -fPIC
-+LDFLAGS =
- INSTALL = install
-
- #***********************************************************************
-@@ -24,7 +24,7 @@ PLUGIN_OBJS := pppoatm.o
- ifdef HAVE_LIBATM
- LIBS := -latm
- else
--CFLAGS += -I.
-+COPTS += -I.
- PLUGIN_OBJS += text2qos.o text2atm.o misc.o ans.o
- LIBS := -lresolv
- endif
-@@ -33,7 +33,7 @@ endif
- all: $(PLUGIN)
-
- $(PLUGIN): $(PLUGIN_OBJS)
-- $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
-+ $(CC) $(LDFLAGS) -o $@ -shared $^ $(LIBS)
-
- install: all
- $(INSTALL) -d -m 755 $(LIBDIR)
-@@ -43,4 +43,4 @@ clean:
- rm -f *.o *.so
-
- %.o: %.c
-- $(CC) $(CFLAGS) -c -o $@ $<
-+ $(CC) $(COPTS) $(CFLAGS) -c -o $@ $<
-diff --git a/pppd/plugins/pppol2tp/Makefile.linux b/pppd/plugins/pppol2tp/Makefile.linux
-index ea3538e..cea6211 100644
---- a/pppd/plugins/pppol2tp/Makefile.linux
-+++ b/pppd/plugins/pppol2tp/Makefile.linux
-@@ -1,7 +1,7 @@
- #CC = gcc
--COPTS = -O2 -g
--CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC
--LDFLAGS = -shared
-+CFLAGS = -O2 -g
-+COPTS = -I. -I../.. -I../../../include -fPIC
-+LDFLAGS =
- INSTALL = install
-
- #***********************************************************************
-@@ -16,7 +16,7 @@ PLUGINS := pppol2tp.so openl2tp.so
- all: $(PLUGINS)
-
- %.so: %.o
-- $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
-+ $(CC) $(LDFLAGS) -o $@ -shared $^ $(LIBS)
-
- install: all
- $(INSTALL) -d -m 755 $(LIBDIR)
-@@ -26,4 +26,4 @@ clean:
- rm -f *.o *.so
-
- %.o: %.c
-- $(CC) $(CFLAGS) -c -o $@ $<
-+ $(CC) $(COPTS) $(CFLAGS) -c -o $@ $<
-diff --git a/pppd/plugins/radius/Makefile.linux b/pppd/plugins/radius/Makefile.linux
-index 24ed3e5..be5a669 100644
---- a/pppd/plugins/radius/Makefile.linux
-+++ b/pppd/plugins/radius/Makefile.linux
-@@ -12,7 +12,8 @@ VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)
- INSTALL = install
-
- PLUGIN=radius.so radattr.so radrealms.so
--CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
-+CFLAGS=-g -O2
-+COPTS = -I. -I../.. -I../../../include -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
-
- # Uncomment the next line to include support for Microsoft's
- # MS-CHAP authentication protocol.
-@@ -23,33 +24,36 @@ MPPE=y
- MAXOCTETS=y
-
- ifdef CHAPMS
--CFLAGS += -DCHAPMS=1
-+COPTS += -DCHAPMS=1
- ifdef MPPE
--CFLAGS += -DMPPE=1
-+COPTS += -DMPPE=1
- endif
- endif
- ifdef MAXOCTETS
--CFLAGS += -DMAXOCTETS=1
-+COPTS += -DMAXOCTETS=1
- endif
-
- all: $(PLUGIN)
-
- install: all
- $(INSTALL) -d -m 755 $(LIBDIR)
-- $(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
-- $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
-- $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
-+ $(INSTALL) -c -m 755 radius.so $(LIBDIR)
-+ $(INSTALL) -c -m 755 radattr.so $(LIBDIR)
-+ $(INSTALL) -c -m 755 radrealms.so $(LIBDIR)
- $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)
- $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
-
-+%.o: %.c
-+ $(CC) $(COPTS) $(CFLAGS) -c $<
-+
- radius.so: radius.o libradiusclient.a
-- $(CC) -o radius.so -shared radius.o libradiusclient.a
-+ $(CC) $(LDFLAGS) -o radius.so -shared radius.o libradiusclient.a
-
- radattr.so: radattr.o
-- $(CC) -o radattr.so -shared radattr.o
-+ $(CC) $(LDFLAGS) -o radattr.so -shared radattr.o
-
- radrealms.so: radrealms.o
-- $(CC) -o radrealms.so -shared radrealms.o
-+ $(CC) $(LDFLAGS) -o radrealms.so -shared radrealms.o
-
- CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \
- clientid.o sendserver.o lock.o util.o md5.o
-diff --git a/pppd/plugins/rp-pppoe/Makefile.linux b/pppd/plugins/rp-pppoe/Makefile.linux
-index 5d7a271..4dd2779 100644
---- a/pppd/plugins/rp-pppoe/Makefile.linux
-+++ b/pppd/plugins/rp-pppoe/Makefile.linux
-@@ -25,40 +25,40 @@ INSTALL = install
- # Version is set ONLY IN THE MAKEFILE! Don't delete this!
- RP_VERSION=3.8p
-
--COPTS=-O2 -g
--CFLAGS=$(COPTS) -I../../../include '-DRP_VERSION="$(RP_VERSION)"'
-+CFLAGS=-O2 -g
-+COPTS=-I../../../include '-DRP_VERSION="$(RP_VERSION)"'
- all: rp-pppoe.so pppoe-discovery
-
- pppoe-discovery: pppoe-discovery.o debug.o
- $(CC) -o pppoe-discovery pppoe-discovery.o debug.o
-
- pppoe-discovery.o: pppoe-discovery.c
-- $(CC) $(CFLAGS) -c -o pppoe-discovery.o pppoe-discovery.c
-+ $(CC) $(COPTS) $(CFLAGS) -c -o pppoe-discovery.o pppoe-discovery.c
-
- debug.o: debug.c
-- $(CC) $(CFLAGS) -c -o debug.o debug.c
-+ $(CC) $(COPTS) $(CFLAGS) -c -o debug.o debug.c
-
- rp-pppoe.so: plugin.o discovery.o if.o common.o
-- $(CC) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
-+ $(CC) $(LDFLAGS) -o rp-pppoe.so -shared $^
-
- install: all
- $(INSTALL) -d -m 755 $(LIBDIR)
-- $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
-+ $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR)
- $(INSTALL) -d -m 755 $(BINDIR)
-- $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR)
-+ $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR)
-
- clean:
- rm -f *.o *.so pppoe-discovery
-
- plugin.o: plugin.c
-- $(CC) $(CFLAGS) -I../../.. -c -o plugin.o -fPIC plugin.c
-+ $(CC) $(COPTS) $(CFLAGS) -I../../.. -c -o plugin.o -fPIC plugin.c
-
- discovery.o: discovery.c
-- $(CC) $(CFLAGS) -I../../.. -c -o discovery.o -fPIC discovery.c
-+ $(CC) $(COPTS) $(CFLAGS) -I../../.. -c -o discovery.o -fPIC discovery.c
-
- if.o: if.c
-- $(CC) $(CFLAGS) -I../../.. -c -o if.o -fPIC if.c
-+ $(CC) $(COPTS) $(CFLAGS) -I../../.. -c -o if.o -fPIC if.c
-
- common.o: common.c
-- $(CC) $(CFLAGS) -I../../.. -c -o common.o -fPIC common.c
-+ $(CC) $(COPTS) $(CFLAGS) -I../../.. -c -o common.o -fPIC common.c
-
-diff --git a/pppdump/Makefile.linux b/pppdump/Makefile.linux
-index ac028f6..8cd54fd 100644
---- a/pppdump/Makefile.linux
-+++ b/pppdump/Makefile.linux
-@@ -2,20 +2,24 @@ DESTDIR = $(INSTROOT)@DESTDIR@
- BINDIR = $(DESTDIR)/sbin
- MANDIR = $(DESTDIR)/share/man/man8
-
--CFLAGS= -O -I../include/net
-+CFLAGS=-O2 -g
-+COPTS= -I../include/net
- OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
-
- INSTALL= install
-
- all: pppdump
-
-+%.o: %.c
-+ $(CC) $(COPTS) $(CFLAGS) -c $<
-+
- pppdump: $(OBJS)
-- $(CC) -o pppdump $(OBJS)
-+ $(CC) $(LDFLAGS) -o pppdump $(OBJS)
-
- clean:
- rm -f pppdump $(OBJS) *~
-
- install:
- mkdir -p $(BINDIR) $(MANDIR)
-- $(INSTALL) -s -c pppdump $(BINDIR)
-+ $(INSTALL) -c pppdump $(BINDIR)
- $(INSTALL) -c -m 444 pppdump.8 $(MANDIR)
-diff --git a/pppstats/Makefile.linux b/pppstats/Makefile.linux
-index cca6f0f..d97d5d9 100644
---- a/pppstats/Makefile.linux
-+++ b/pppstats/Makefile.linux
-@@ -10,27 +10,25 @@ PPPSTATSRCS = pppstats.c
- PPPSTATOBJS = pppstats.o
-
- #CC = gcc
--COPTS = -O
--COMPILE_FLAGS = -I../include
-+CFLAGS = -O2 -g
-+COPTS = -I../include
- LIBS =
-
- INSTALL= install
-
--CFLAGS = $(COPTS) $(COMPILE_FLAGS)
--
- all: pppstats
-
- install: pppstats
- -mkdir -p $(MANDIR)
-- $(INSTALL) -s -c pppstats $(BINDIR)
-+ $(INSTALL) -c pppstats $(BINDIR)
- $(INSTALL) -c -m 444 pppstats.8 $(MANDIR)
-
- pppstats: $(PPPSTATSRCS)
-- $(CC) $(CFLAGS) -o pppstats pppstats.c $(LIBS)
-+ $(CC) $(LDFLAGS) $(COPTS) $(CFLAGS) -o pppstats pppstats.c $(LIBS)
-
- clean:
- rm -f pppstats *~ #* core
-
- depend:
-- cpp -M $(CFLAGS) $(PPPSTATSRCS) >.depend
--# makedepend $(CFLAGS) $(PPPSTATSRCS)
-+ cpp -M $(COPTS) $(CFLAGS) $(PPPSTATSRCS) >.depend
-+# makedepend $(COPTS) $(CFLAGS) $(PPPSTATSRCS)
diff --git a/patches/ppp-2.4.5/0010-always_setsid.patch b/patches/ppp-2.4.5/0010-always_setsid.patch
deleted file mode 100644
index e8ef7095b..000000000
--- a/patches/ppp-2.4.5/0010-always_setsid.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] always_setsid
-
-always create a new process group
-
-pppd sends signals to the whole process group, so it must always create
-a new one or it may kill the parent process and its siblings.
-Currently setsid() is not called when the updetach option is used.
-We want to make the detached and non-detached code paths as similar as
-possible.
-
-http://ppp.samba.org/cgi-bin/ppp-bugs/incoming?id=1411
-http://ppp.samba.org/cgi-bin/ppp-bugs/incoming?id=1589
----
- pppd/main.c | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/pppd/main.c b/pppd/main.c
-index 014d614..58a5bdb 100644
---- a/pppd/main.c
-+++ b/pppd/main.c
-@@ -431,6 +431,13 @@ main(argc, argv)
- }
-
- /*
-+ * pppd sends signals to the whole process group, so it must always
-+ * create a new one or it may kill the parent process and its siblings.
-+ */
-+ setsid();
-+ chdir("/");
-+
-+ /*
- * Initialize system-dependent stuff.
- */
- sys_init();
-@@ -774,8 +781,6 @@ detach()
- create_linkpidfile(pid);
- exit(0); /* parent dies */
- }
-- setsid();
-- chdir("/");
- dup2(fd_devnull, 0);
- dup2(fd_devnull, 1);
- dup2(fd_devnull, 2);
diff --git a/patches/ppp-2.4.5/0012-chat_man.patch b/patches/ppp-2.4.5/0012-chat_man.patch
deleted file mode 100644
index 719ddadc5..000000000
--- a/patches/ppp-2.4.5/0012-chat_man.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] chat_man
-
----
- chat/chat.8 | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/chat/chat.8 b/chat/chat.8
-index 60b2803..b5e7c26 100644
---- a/chat/chat.8
-+++ b/chat/chat.8
-@@ -35,7 +35,8 @@ Set the timeout for the expected string to be received. If the string
- is not received within the time limit then the reply string is not
- sent. An alternate reply may be sent or the script will fail if there
- is no alternate reply string. A failed script will cause the
--\fIchat\fR program to terminate with a non-zero error code.
-+\fIchat\fR program to terminate with a non-zero error code. You can
-+also use the TIMEOUT string in order to specify the timeout.
- .TP
- .B \-r \fI<report file>
- Set the file for output of the report strings. If you use the keyword
-@@ -348,7 +349,7 @@ ogin:\-\-BREAK\-\-ogin: real_account
- .LP
- .SH TIMEOUT
- The initial timeout value is 45 seconds. This may be changed using the \fB\-t\fR
--parameter.
-+parameter. You can also specify "TIMEOUT 0".
- .LP
- To change the timeout value for the next expect string, the following
- example may be used:
diff --git a/patches/ppp-2.4.5/0013-documentation_typos.patch b/patches/ppp-2.4.5/0013-documentation_typos.patch
deleted file mode 100644
index 554080a78..000000000
--- a/patches/ppp-2.4.5/0013-documentation_typos.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] documentation_typos
-
-fix documentation typos
----
- README.pppoe | 2 +-
- chat/chat.8 | 8 ++++----
- pppd/pppd.8 | 6 +++---
- 3 files changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/README.pppoe b/README.pppoe
-index 5284e4d..9f4e5cd 100644
---- a/README.pppoe
-+++ b/README.pppoe
-@@ -33,7 +33,7 @@ received from the PPPoE layer just as if the link was a serial line
-
- With this in mind, the goal of the implementation of PPPoE support in
- Linux is to allow users to simply specify that the device they intend
--to use for the PPP connection is an ethernet device (i.e. "eth0") and
-+to use for the PPP connection is an ethernet device (e.g. "eth0") and
- the rest of the system should function as usual.
-
- 2. Using PPPoE
-diff --git a/chat/chat.8 b/chat/chat.8
-index b5e7c26..39733cf 100644
---- a/chat/chat.8
-+++ b/chat/chat.8
-@@ -51,7 +51,7 @@ keyword. When echoing is enabled, all output from the modem is echoed
- to \fIstderr\fR.
- .TP
- .B \-E
--Enables environment variable substituion within chat scripts using the
-+Enables environment variable substitution within chat scripts using the
- standard \fI$xxx\fR syntax.
- .TP
- .B \-v
-@@ -78,7 +78,7 @@ SYSLOG. The use of \-S will prevent both log messages from '\-v' and
- error messages from being sent to the SYSLOG.
- .TP
- .B \-T \fI<phone number>
--Pass in an arbitary string, usually a phone number, that will be
-+Pass in an arbitrary string, usually a phone number, that will be
- substituted for the \\T substitution metacharacter in a send string.
- .TP
- .B \-U \fI<phone number 2>
-@@ -205,7 +205,7 @@ terminal), standard error will normally be redirected to the file
- .LP
- \fBSAY\fR strings must be enclosed in single or double quotes. If
- carriage return and line feed are needed in the string to be output,
--you must explicitely add them to your string.
-+you must explicitly add them to your string.
- .LP
- The SAY strings could be used to give progress messages in sections of
- the script where you want to have 'ECHO OFF' but still let the user
-@@ -458,7 +458,7 @@ For example, the character DC1 (17) is shown as \^^Q.
- Environment variables are available within chat scripts, if the \fI\-E\fR
- option was specified in the command line. The metacharacter \fI$\fR is used
- to introduce the name of the environment variable to substitute. If the
--substition fails, because the requested environment variable is not set,
-+substitution fails, because the requested environment variable is not set,
- \fInothing\fR is replaced for the variable.
- .SH TERMINATION CODES
- The \fIchat\fR program will terminate with the following completion
-diff --git a/pppd/pppd.8 b/pppd/pppd.8
-index 2943263..43b5416 100644
---- a/pppd/pppd.8
-+++ b/pppd/pppd.8
-@@ -331,7 +331,7 @@ When this is completed, pppd will commence passing data packets
- The \fIdemand\fR option implies the \fIpersist\fR option. If this
- behaviour is not desired, use the \fInopersist\fR option after the
- \fIdemand\fR option. The \fIidle\fR and \fIholdoff\fR
--options are also useful in conjuction with the \fIdemand\fR option.
-+options are also useful in conjunction with the \fIdemand\fR option.
- .TP
- .B domain \fId
- Append the domain name \fId\fR to the local host name for authentication
-@@ -942,7 +942,7 @@ pseudo-tty master/slave pair and use the slave as its terminal
- device. The \fIscript\fR will be run in a child process with the
- pseudo-tty master as its standard input and output. An explicit
- device name may not be given if this option is used. (Note: if the
--\fIrecord\fR option is used in conjuction with the \fIpty\fR option,
-+\fIrecord\fR option is used in conjunction with the \fIpty\fR option,
- the child process will have pipes on its standard input and output.)
- .TP
- .B receive\-all
-@@ -1050,7 +1050,7 @@ in the pseudonym.
- .TP
- .B srp\-use\-pseudonym
- When operating as an EAP SRP\-SHA1 client, attempt to use the pseudonym
--stored in ~/.ppp_psuedonym first as the identity, and save in this
-+stored in ~/.ppp_pseudonym first as the identity, and save in this
- file any pseudonym offered by the peer during authentication.
- .TP
- .B sync
diff --git a/patches/ppp-2.4.5/0015-fix_null_pppdb.patch b/patches/ppp-2.4.5/0015-fix_null_pppdb.patch
deleted file mode 100644
index 46e23da12..000000000
--- a/patches/ppp-2.4.5/0015-fix_null_pppdb.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] fix_null_pppdb
-
-fix segfault in update_db_entry()
-
-From: Martin.Lottermoser@t-online.de
-Subject: Bug#308136: Debian bug 308136 (SEGV in pppd)
-
-The function update_db_entry() may only be called if pppdb is not NULL;
-unfortunately in this situation it is. Other calls to update_db_entry()
-are protected against this, see, e.g., the end of script_setenv().
----
- pppd/main.c | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/pppd/main.c b/pppd/main.c
-index 8da4786..8513b1d 100644
---- a/pppd/main.c
-+++ b/pppd/main.c
-@@ -1961,9 +1961,11 @@ script_setenv(var, value, iskey)
- free(p-1);
- script_env[i] = newstring;
- #ifdef USE_TDB
-- if (iskey && pppdb != NULL)
-- add_db_key(newstring);
-- update_db_entry();
-+ if (pppdb != NULL) {
-+ if (iskey)
-+ add_db_key(newstring);
-+ update_db_entry();
-+ }
- #endif
- return;
- }
diff --git a/patches/ppp-2.4.5/0024-radius_enanchements.patch b/patches/ppp-2.4.5/0024-radius_enanchements.patch
deleted file mode 100644
index e7217bacc..000000000
--- a/patches/ppp-2.4.5/0024-radius_enanchements.patch
+++ /dev/null
@@ -1,166 +0,0 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:27 +0100
-Subject: [PATCH] radius_enanchements
-
-radius plugin enhancements
-
-http://ppp.samba.org/cgi-bin/ppp-bugs/incoming?id=1466
-
-From: z0termann@mail.ru
-To: ppp-bugs@ppp.samba.org
-Subject: radius plugin enhancements
-Date: Fri, 11 Aug 2006 08:06:24 +0000 (GMT)
-
-Full_Name: Vadim Zotov
-Version: 2.4.3
-OS: centos4
-Submission from: (NULL) (194.186.83.193)
-
-
-The patch below allows radius plugin to handle
-additional radius attributes:
-
-- Filter-ID (sets RADIUS_FILTER_ID env. var.)
-- Framed-Route (sets RADIUS_FRAMED_ROUTE env. var.)
-- Idle-Timeout
-- NAS-IP-Address
-- MS-Primary-DNS-Server
-- MS-Secondary-DNS-Server
-- MS-Primary-NBNS-Server
-- MS-Secondary-NBNS-Server
-
---------------------------------------------
----
- pppd/plugins/radius/radius.c | 56 ++++++++++++++++++++++++++++++++++--
- pppd/plugins/radius/radiusclient.h | 4 +++
- 2 files changed, 57 insertions(+), 3 deletions(-)
-
-diff --git a/pppd/plugins/radius/radius.c b/pppd/plugins/radius/radius.c
-index 44d1911..edbc0b3 100644
---- a/pppd/plugins/radius/radius.c
-+++ b/pppd/plugins/radius/radius.c
-@@ -48,6 +48,8 @@ static char const RCSID[] =
-
- #define MD5_HASH_SIZE 16
-
-+#define MSDNS 1
-+
- static char *config_file = NULL;
- static int add_avp(char **);
- static struct avpopt {
-@@ -544,6 +546,15 @@ radius_setparams(VALUE_PAIR *vp, char *msg, REQUEST_INFO *req_info,
- int mppe_enc_types = 0;
- #endif
-
-+#ifdef MSDNS
-+ ipcp_options *wo = &ipcp_wantoptions[0];
-+ ipcp_options *ao = &ipcp_allowoptions[0];
-+ int got_msdns_1 = 0;
-+ int got_msdns_2 = 0;
-+ int got_wins_1 = 0;
-+ int got_wins_2 = 0;
-+#endif
-+
- /* Send RADIUS attributes to anyone else who might be interested */
- if (radius_attributes_hook) {
- (*radius_attributes_hook)(vp);
-@@ -581,6 +592,21 @@ radius_setparams(VALUE_PAIR *vp, char *msg, REQUEST_INFO *req_info,
- /* Session timeout */
- maxconnect = vp->lvalue;
- break;
-+/* -- additional parameters */
-+ case PW_FILTER_ID:
-+ /* packet filter, will be handled via ip-(up|down) script */
-+ script_setenv("RADIUS_FILTER_ID",vp->strvalue,1);
-+ break;
-+ case PW_FRAMED_ROUTE:
-+ /* route, will be handled via ip-(up|down) script */
-+ script_setenv("RADIUS_FRAMED_ROUTE",vp->strvalue,1);
-+ break;
-+ case PW_IDLE_TIMEOUT:
-+ /* idle parameter */
-+ idle_time_limit = vp->lvalue;
-+ slprintf(msg, BUF_LEN, "setting idle tmo to %ld",vp->lvalue);
-+ break;
-+/* -- end of additional parameters */
- #ifdef MAXOCTETS
- case PW_SESSION_OCTETS_LIMIT:
- /* Session traffic limit */
-@@ -619,6 +645,11 @@ radius_setparams(VALUE_PAIR *vp, char *msg, REQUEST_INFO *req_info,
- rstate.ip_addr = remote;
- }
- break;
-+/* --- additional parameters ---*/
-+ case PW_NAS_IP_ADDRESS:
-+ wo->ouraddr = htonl(vp->lvalue);
-+ break;
-+/* --- end additional parameters --- */
- case PW_CLASS:
- /* Save Class attribute to pass it in accounting request */
- if (vp->lvalue <= MAXCLASSLEN) {
-@@ -629,8 +660,8 @@ radius_setparams(VALUE_PAIR *vp, char *msg, REQUEST_INFO *req_info,
- }
-
-
--#ifdef CHAPMS
- } else if (vp->vendorcode == VENDOR_MICROSOFT) {
-+#ifdef CHAPMS
- switch (vp->attribute) {
- case PW_MS_CHAP2_SUCCESS:
- if ((vp->lvalue != 43) || strncmp(vp->strvalue + 1, "S=", 2)) {
-@@ -673,19 +704,38 @@ radius_setparams(VALUE_PAIR *vp, char *msg, REQUEST_INFO *req_info,
- break;
-
- #endif /* MPPE */
--#if 0
-+#ifdef MSDNS
- case PW_MS_PRIMARY_DNS_SERVER:
-+ ao->dnsaddr[0] = htonl(vp->lvalue);
-+ got_msdns_1 = 1;
-+ break;
- case PW_MS_SECONDARY_DNS_SERVER:
-+ ao->dnsaddr[1] = htonl(vp->lvalue);
-+ got_msdns_2 = 1;
-+ break;
- case PW_MS_PRIMARY_NBNS_SERVER:
-+ ao->winsaddr[0] = htonl(vp->lvalue);
-+ got_wins_1 = 1;
-+ break;
- case PW_MS_SECONDARY_NBNS_SERVER:
-+ ao->winsaddr[1] = htonl(vp->lvalue);
-+ got_wins_2 = 1;
- break;
--#endif
-+#endif /* MSDNS */
- }
- #endif /* CHAPMS */
- }
- vp = vp->next;
- }
-
-+#ifdef MSDNS
-+ /* override the ms-dns & ms-wins options */
-+ if (got_msdns_1 == 1 && got_msdns_2 == 0 ) ao->dnsaddr[1] = ao->dnsaddr[0];
-+ else if (got_msdns_1 == 0 && got_msdns_2 == 1 ) ao->dnsaddr[0] = ao->dnsaddr[1];
-+ if (got_wins_1 == 1 && got_wins_2 == 0 ) ao->winsaddr[1] = ao->winsaddr[0];
-+ else if (got_wins_1 == 0 && got_wins_2 == 1 ) ao->winsaddr[0] = ao->winsaddr[1];
-+#endif
-+
- /* Require a valid MS-CHAP2-SUCCESS for MS-CHAPv2 auth */
- if (digest && (digest->code == CHAP_MICROSOFT_V2) && !ms_chap2_success)
- return -1;
-diff --git a/pppd/plugins/radius/radiusclient.h b/pppd/plugins/radius/radiusclient.h
-index 7b7933e..51b959a 100644
---- a/pppd/plugins/radius/radiusclient.h
-+++ b/pppd/plugins/radius/radiusclient.h
-@@ -152,6 +152,10 @@ typedef struct pw_auth_hdr
- #define PW_MS_CHAP_MPPE_KEYS 12 /* string */
- #define PW_MS_MPPE_SEND_KEY 16 /* string */
- #define PW_MS_MPPE_RECV_KEY 17 /* string */
-+#define PW_MS_PRIMARY_DNS_SERVER 28 /* ipaddr */
-+#define PW_MS_SECONDARY_DNS_SERVER 29 /* ipaddr */
-+#define PW_MS_PRIMARY_NBNS_SERVER 30 /* ipaddr */
-+#define PW_MS_SECONDARY_NBNS_SERVER 31 /* ipaddr */
-
- /* Accounting */
-
diff --git a/patches/ppp-2.4.5/0030-no_crypt_hack.patch b/patches/ppp-2.4.5/0030-no_crypt_hack.patch
deleted file mode 100644
index 69b5b66a2..000000000
--- a/patches/ppp-2.4.5/0030-no_crypt_hack.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:27 +0100
-Subject: [PATCH] no_crypt_hack
-
-The udeb package does not have crypt(3).
-This patch makes authentication always fail, since it is not needed anyway
-for dialout.
----
- pppd/Makefile.linux | 4 ++++
- pppd/auth.c | 2 ++
- pppd/session.c | 2 ++
- 3 files changed, 8 insertions(+)
-
-diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
-index 44cf309..c001679 100644
---- a/pppd/Makefile.linux
-+++ b/pppd/Makefile.linux
-@@ -116,10 +116,14 @@ COMPILE_FLAGS += -DHAS_SHADOW
- #LIBS += -lshadow $(LIBS)
- endif
-
-+ifdef NO_CRYPT_HACK
-+COMPILE_FLAGS += -DNO_CRYPT_HACK
-+else
- ifneq ($(wildcard /usr/include/crypt.h),)
- COMPILE_FLAGS += -DHAVE_CRYPT_H=1
- LIBS += -lcrypt
- endif
-+endif
-
- ifdef NEEDDES
- ifndef USE_CRYPT
-diff --git a/pppd/auth.c b/pppd/auth.c
-index 031c030..36e1549 100644
---- a/pppd/auth.c
-+++ b/pppd/auth.c
-@@ -1442,8 +1442,10 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg)
- }
- if (secret[0] != 0 && !login_secret) {
- /* password given in pap-secrets - must match */
-+#ifndef NO_CRYPT_HACK
- if ((cryptpap || strcmp(passwd, secret) != 0)
- && strcmp(crypt(passwd, secret), secret) != 0)
-+#endif
- ret = UPAP_AUTHNAK;
- }
- }
-diff --git a/pppd/session.c b/pppd/session.c
-index 32901a2..108331f 100644
---- a/pppd/session.c
-+++ b/pppd/session.c
-@@ -348,8 +348,10 @@ session_start(flags, user, passwd, ttyName, msg)
- /*
- * If no passwd, don't let them login if we're authenticating.
- */
-+#ifndef NO_CRYPT_HACK
- if (pw->pw_passwd == NULL || strlen(pw->pw_passwd) < 2
- || strcmp(crypt(passwd, pw->pw_passwd), pw->pw_passwd) != 0)
-+#endif
- return SESSION_FAILED;
- }
-
diff --git a/patches/ppp-2.4.5/0035-use-CPPFLAGS-when-compiling.patch b/patches/ppp-2.4.5/0035-use-CPPFLAGS-when-compiling.patch
deleted file mode 100644
index 2e51c42ea..000000000
--- a/patches/ppp-2.4.5/0035-use-CPPFLAGS-when-compiling.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Fri, 25 May 2012 16:46:09 +0200
-Subject: [PATCH] use CPPFLAGS when compiling
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- pppd/Makefile.linux | 2 +-
- pppd/plugins/Makefile.linux | 2 +-
- pppd/plugins/radius/Makefile.linux | 2 +-
- pppdump/Makefile.linux | 2 +-
- 4 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
-index b713841..074f4a7 100644
---- a/pppd/Makefile.linux
-+++ b/pppd/Makefile.linux
-@@ -209,7 +209,7 @@ install: pppd
- $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
-
- %.o: %.c
-- $(CC) $(COPTS) $(CFLAGS) -c $<
-+ $(CC) $(CPPFLAGS) $(COPTS) $(CFLAGS) -c $<
-
- pppd: $(PPPDOBJS)
- $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
-diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux
-index 7950596..403d8c5 100644
---- a/pppd/plugins/Makefile.linux
-+++ b/pppd/plugins/Makefile.linux
-@@ -23,7 +23,7 @@ all: $(PLUGINS)
- for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
-
- %.o: %.c
-- $(CC) $(COPTS) $(CFLAGS) -c $<
-+ $(CC) $(CPPFLAGS) $(COPTS) $(CFLAGS) -c $<
-
- %.so: %.c
- $(CC) -o $@ $(LDFLAGS) -shared $(COPTS) $(CFLAGS) $^
-diff --git a/pppd/plugins/radius/Makefile.linux b/pppd/plugins/radius/Makefile.linux
-index be5a669..3d90fb4 100644
---- a/pppd/plugins/radius/Makefile.linux
-+++ b/pppd/plugins/radius/Makefile.linux
-@@ -44,7 +44,7 @@ install: all
- $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
-
- %.o: %.c
-- $(CC) $(COPTS) $(CFLAGS) -c $<
-+ $(CC) $(CPPFLAGS) $(COPTS) $(CFLAGS) -c $<
-
- radius.so: radius.o libradiusclient.a
- $(CC) $(LDFLAGS) -o radius.so -shared radius.o libradiusclient.a
-diff --git a/pppdump/Makefile.linux b/pppdump/Makefile.linux
-index fc6091c..5b3ebdb 100644
---- a/pppdump/Makefile.linux
-+++ b/pppdump/Makefile.linux
-@@ -35,7 +35,7 @@ INSTALL= install
- all: pppdump
-
- %.o: %.c
-- $(CC) $(COPTS) $(CFLAGS) -c $<
-+ $(CC) $(CPPFLAGS) $(COPTS) $(CFLAGS) -c $<
-
- pppdump: $(OBJS)
- $(CC) $(LDFLAGS) -o pppdump $(OBJS) $(LIBS)
diff --git a/patches/ppp-2.4.5/0036-Remove-old-version-of-Linux-if_pppol2tp.h.patch b/patches/ppp-2.4.5/0036-Remove-old-version-of-Linux-if_pppol2tp.h.patch
deleted file mode 100644
index dcea01aa6..000000000
--- a/patches/ppp-2.4.5/0036-Remove-old-version-of-Linux-if_pppol2tp.h.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-From: Michael Olbrich <m.olbrich@pengutronix.de>
-Date: Thu, 18 Oct 2012 11:46:22 +0200
-Subject: [PATCH] Remove old version of Linux if_pppol2tp.h
-
-This has been in the Linux kernel source now for long enough that we
-can rely on getting a usable version from /usr/include on all
-distributions that we care about. The version we have here had started
-to lag behind what is in the Linux kernel, causing compilation errors
-due to struct pppol2tpv3_addr being undefined. Removing our local
-version means we will use what is in /usr/include instead.
-
-This is an upstream patch modified to apply to the current version.
-
-Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
----
- include/linux/if_pppol2tp.h | 79 -------------------------------------------
- 1 file changed, 79 deletions(-)
- delete mode 100644 include/linux/if_pppol2tp.h
-
-diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
-deleted file mode 100644
-index 7ee86b2..0000000
---- a/include/linux/if_pppol2tp.h
-+++ /dev/null
-@@ -1,79 +0,0 @@
--/***************************************************************************
-- * Linux PPP over L2TP (PPPoL2TP) Socket Implementation (RFC 2661)
-- *
-- * This file supplies definitions required by the PPP over L2TP driver
-- * (l2tp_ppp.c). All version information wrt this file is located in l2tp_ppp.c
-- *
-- * License:
-- * This program is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU General Public License
-- * as published by the Free Software Foundation; either version
-- * 2 of the License, or (at your option) any later version.
-- *
-- */
--
--#ifndef __LINUX_IF_PPPOL2TP_H
--#define __LINUX_IF_PPPOL2TP_H
--
--#include <linux/types.h>
--
--
--/* Structure used to connect() the socket to a particular tunnel UDP
-- * socket.
-- */
--struct pppol2tp_addr {
-- __kernel_pid_t pid; /* pid that owns the fd.
-- * 0 => current */
-- int fd; /* FD of UDP socket to use */
--
-- struct sockaddr_in addr; /* IP address and port to send to */
--
-- __u16 s_tunnel, s_session; /* For matching incoming packets */
-- __u16 d_tunnel, d_session; /* For sending outgoing packets */
--};
--
--/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
-- * bits. So we need a different sockaddr structure.
-- */
--struct pppol2tpv3_addr {
-- pid_t pid; /* pid that owns the fd.
-- * 0 => current */
-- int fd; /* FD of UDP or IP socket to use */
--
-- struct sockaddr_in addr; /* IP address and port to send to */
--
-- __u32 s_tunnel, s_session; /* For matching incoming packets */
-- __u32 d_tunnel, d_session; /* For sending outgoing packets */
--};
--
--/* Socket options:
-- * DEBUG - bitmask of debug message categories
-- * SENDSEQ - 0 => don't send packets with sequence numbers
-- * 1 => send packets with sequence numbers
-- * RECVSEQ - 0 => receive packet sequence numbers are optional
-- * 1 => drop receive packets without sequence numbers
-- * LNSMODE - 0 => act as LAC.
-- * 1 => act as LNS.
-- * REORDERTO - reorder timeout (in millisecs). If 0, don't try to reorder.
-- */
--enum {
-- PPPOL2TP_SO_DEBUG = 1,
-- PPPOL2TP_SO_RECVSEQ = 2,
-- PPPOL2TP_SO_SENDSEQ = 3,
-- PPPOL2TP_SO_LNSMODE = 4,
-- PPPOL2TP_SO_REORDERTO = 5,
--};
--
--/* Debug message categories for the DEBUG socket option */
--enum {
-- PPPOL2TP_MSG_DEBUG = (1 << 0), /* verbose debug (if
-- * compiled in) */
-- PPPOL2TP_MSG_CONTROL = (1 << 1), /* userspace - kernel
-- * interface */
-- PPPOL2TP_MSG_SEQ = (1 << 2), /* sequence numbers */
-- PPPOL2TP_MSG_DATA = (1 << 3), /* data packets */
--};
--
--
--
--#endif
diff --git a/patches/ppp-2.4.5/series b/patches/ppp-2.4.5/series
deleted file mode 100644
index 65eb49000..000000000
--- a/patches/ppp-2.4.5/series
+++ /dev/null
@@ -1,39 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-git-20100307.patch
-0002-pppoatm_no_modprobe.patch
-0003-adaptive_echos.patch
-0004-use_system_logwtmp.patch
-0005-update_if_pppol2tp.patch
-0006-dont-exit-pado-timeout.patch
-0007-fix_warnings.patch
-0008-man_syntax_errors.patch
-0009-makefiles_cleanup.patch
-0010-always_setsid.patch
-0011-close_dev_ppp.patch
-0012-chat_man.patch
-0013-documentation_typos.patch
-0014-fix_linkpidfile.patch
-0015-fix_null_pppdb.patch
-0016-pppdump_use_zlib.patch
-0017-pppoatm_resolver_light.patch
-0018-pppoatm_cleanup.patch
-0019-pppoe_noads.patch
-0020-readable_connerrs.patch
-0021-011_scripts_redialer.diff.patch
-0022-cifdefroute.dif.patch
-0023-ppp-2.3.11-oedod.dif.patch
-0024-radius_enanchements.patch
-0025-radius_mtu.patch
-0026-018_ip-up_option.diff.patch
-0027-ppp-2.4.2-stripMSdomain.patch
-0028-setenv_call_file.patch
-0029-010_scripts_README.diff.patch
-0030-no_crypt_hack.patch
-0031-resolv.conf_no_log.patch
-0032-zzz_config.patch
-0033-pppd-make-makefile-sysroot-aware.patch
-0034-pppd-make-the-self-made-configure-cross-aware.patch
-0035-use-CPPFLAGS-when-compiling.patch
-0036-Remove-old-version-of-Linux-if_pppol2tp.h.patch
-# 0c85b7e722333cbd8a6d8bd40a3a7d11 - git-ptx-patches magic
diff --git a/patches/ppp-2.4.5/0003-adaptive_echos.patch b/patches/ppp-2.4.7/0001-adaptive_echos.patch
similarity index 90%
rename from patches/ppp-2.4.5/0003-adaptive_echos.patch
rename to patches/ppp-2.4.7/0001-adaptive_echos.patch
index 112c07fd9..c736a350d 100644
--- a/patches/ppp-2.4.5/0003-adaptive_echos.patch
+++ b/patches/ppp-2.4.7/0001-adaptive_echos.patch
@@ -1,14 +1,14 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
+Date: Thu, 1 Jun 2017 16:18:34 +0200
Subject: [PATCH] adaptive_echos
---
- pppd/lcp.c | 19 +++++++++++++++++++
- pppd/pppd.8 | 5 +++++
+ pppd/lcp.c | 19 +++++++++++++++++++
+ pppd/pppd.8 | 5 +++++
2 files changed, 24 insertions(+)
diff --git a/pppd/lcp.c b/pppd/lcp.c
-index 8ed2778..c97a64b 100644
+index 8ed2778bfb67..c97a64b7774f 100644
--- a/pppd/lcp.c
+++ b/pppd/lcp.c
@@ -73,6 +73,7 @@ static void lcp_delayed_up __P((void *));
@@ -52,10 +52,10 @@ index 8ed2778..c97a64b 100644
*/
if (f->state == OPENED) {
diff --git a/pppd/pppd.8 b/pppd/pppd.8
-index b7adc77..2943263 100644
+index e2768b135273..b7fd0bdaab52 100644
--- a/pppd/pppd.8
+++ b/pppd/pppd.8
-@@ -557,6 +557,11 @@ to 1) if the \fIproxyarp\fR option is used, and will enable the
+@@ -558,6 +558,11 @@ to 1) if the \fIproxyarp\fR option is used, and will enable the
dynamic IP address option (i.e. set /proc/sys/net/ipv4/ip_dynaddr to
1) in demand mode if the local address changes.
.TP
diff --git a/patches/ppp-2.4.7/0002-Makefiles-cleanup.patch b/patches/ppp-2.4.7/0002-Makefiles-cleanup.patch
new file mode 100644
index 000000000..94871e177
--- /dev/null
+++ b/patches/ppp-2.4.7/0002-Makefiles-cleanup.patch
@@ -0,0 +1,291 @@
+From: Marco d'Itri <md@linux.it>
+Date: Thu, 1 Jun 2017 16:19:36 +0200
+Subject: [PATCH] Makefiles cleanup
+
+Factor-out $COPTS and $LDOPTS to allow distributions to easily override
+them. Properly use $LDFLAGS when linking and $CFLAGS when compiling.
+Do not strip the installed binaries: this should be done by the
+packaging system if required.
+---
+ chat/Makefile.linux | 5 +++--
+ pppd/Makefile.linux | 7 ++++---
+ pppd/plugins/Makefile.linux | 4 ++--
+ pppd/plugins/pppoatm/Makefile.linux | 4 ++--
+ pppd/plugins/pppol2tp/Makefile.linux | 4 ++--
+ pppd/plugins/radius/Makefile.linux | 16 +++++++++-------
+ pppd/plugins/rp-pppoe/Makefile.linux | 10 ++++++----
+ pppdump/Makefile.linux | 9 ++++++---
+ pppstats/Makefile.linux | 7 ++++---
+ 9 files changed, 38 insertions(+), 28 deletions(-)
+
+diff --git a/chat/Makefile.linux b/chat/Makefile.linux
+index 1065ac519576..a41d485b4168 100644
+--- a/chat/Makefile.linux
++++ b/chat/Makefile.linux
+@@ -12,20 +12,21 @@ CDEFS= $(CDEF1) $(CDEF2) $(CDEF3) $(CDEF4)
+
+ COPTS= -O2 -g -pipe
+ CFLAGS= $(COPTS) $(CDEFS)
++LDFLAGS=$(LDOPTS)
+
+ INSTALL= install
+
+ all: chat
+
+ chat: chat.o
+- $(CC) -o chat chat.o
++ $(CC) $(LDFLAGS) -o chat chat.o
+
+ chat.o: chat.c
+ $(CC) -c $(CFLAGS) -o chat.o chat.c
+
+ install: chat
+ mkdir -p $(BINDIR) $(MANDIR)
+- $(INSTALL) -s -c chat $(BINDIR)
++ $(INSTALL) -c chat $(BINDIR)
+ $(INSTALL) -c -m 644 chat.8 $(MANDIR)
+
+ clean:
+diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
+index a74c914fd3ac..16b3ee879791 100644
+--- a/pppd/Makefile.linux
++++ b/pppd/Makefile.linux
+@@ -83,6 +83,7 @@ INCLUDE_DIRS= -I../include
+ COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP
+
+ CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
++LDFLAGS=$(LDOPTS)
+
+ ifdef CHAPMS
+ CFLAGS += -DCHAPMS=1
+@@ -102,7 +103,7 @@ ifdef USE_SRP
+ CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
+ LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto
+ TARGETS += srp-entry
+-EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
++EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
+ MANPAGES += srp-entry.8
+ EXTRACLEAN += srp-entry.o
+ NEEDDES=y
+@@ -208,13 +209,13 @@ all: $(TARGETS)
+ install: pppd
+ mkdir -p $(BINDIR) $(MANDIR)
+ $(EXTRAINSTALL)
+- $(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
++ $(INSTALL) -c -m 555 pppd $(BINDIR)/pppd
+ if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
+ chmod o-rx,u+s $(BINDIR)/pppd; fi
+ $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
+
+ pppd: $(PPPDOBJS)
+- $(CC) $(CFLAGS) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
++ $(CC) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
+
+ srp-entry: srp-entry.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
+diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux
+index ab8cf50d9472..732cc8b411d2 100644
+--- a/pppd/plugins/Makefile.linux
++++ b/pppd/plugins/Makefile.linux
+@@ -1,7 +1,7 @@
+ #CC = gcc
+ COPTS = -O2 -g
+ CFLAGS = $(COPTS) -I.. -I../../include -fPIC
+-LDFLAGS = -shared
++LDFLAGS = $(LDOPTS)
+ INSTALL = install
+
+ DESTDIR = $(INSTROOT)@DESTDIR@
+@@ -30,7 +30,7 @@ all: $(PLUGINS)
+ for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
+
+ %.so: %.c
+- $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
++ $(CC) -o $@ $(LDFLAGS) -shared $(CFLAGS) $^
+
+ VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
+
+diff --git a/pppd/plugins/pppoatm/Makefile.linux b/pppd/plugins/pppoatm/Makefile.linux
+index 20f62e631d23..002603c6cbef 100644
+--- a/pppd/plugins/pppoatm/Makefile.linux
++++ b/pppd/plugins/pppoatm/Makefile.linux
+@@ -1,7 +1,7 @@
+ #CC = gcc
+ COPTS = -O2 -g
+ CFLAGS = $(COPTS) -I../.. -I../../../include -fPIC
+-LDFLAGS = -shared
++LDFLAGS = $(LDOPTS)
+ INSTALL = install
+
+ #***********************************************************************
+@@ -33,7 +33,7 @@ endif
+ all: $(PLUGIN)
+
+ $(PLUGIN): $(PLUGIN_OBJS)
+- $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
++ $(CC) $(LDFLAGS) -o $@ -shared $^ $(LIBS)
+
+ install: all
+ $(INSTALL) -d -m 755 $(LIBDIR)
+diff --git a/pppd/plugins/pppol2tp/Makefile.linux b/pppd/plugins/pppol2tp/Makefile.linux
+index ea3538e22d56..de5cc12e79c3 100644
+--- a/pppd/plugins/pppol2tp/Makefile.linux
++++ b/pppd/plugins/pppol2tp/Makefile.linux
+@@ -1,7 +1,7 @@
+ #CC = gcc
+ COPTS = -O2 -g
+ CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC
+-LDFLAGS = -shared
++LDFLAGS = $(LDOPTS)
+ INSTALL = install
+
+ #***********************************************************************
+@@ -16,7 +16,7 @@ PLUGINS := pppol2tp.so openl2tp.so
+ all: $(PLUGINS)
+
+ %.so: %.o
+- $(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
++ $(CC) $(LDFLAGS) -o $@ -shared $^ $(LIBS)
+
+ install: all
+ $(INSTALL) -d -m 755 $(LIBDIR)
+diff --git a/pppd/plugins/radius/Makefile.linux b/pppd/plugins/radius/Makefile.linux
+index 24ed3e580c4d..436ff2fd0c23 100644
+--- a/pppd/plugins/radius/Makefile.linux
++++ b/pppd/plugins/radius/Makefile.linux
+@@ -12,7 +12,9 @@ VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)
+ INSTALL = install
+
+ PLUGIN=radius.so radattr.so radrealms.so
+-CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
++COPTS=-g -O2
++CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
++LDFLAGS= $(LDOPTS)
+
+ # Uncomment the next line to include support for Microsoft's
+ # MS-CHAP authentication protocol.
+@@ -36,20 +38,20 @@ all: $(PLUGIN)
+
+ install: all
+ $(INSTALL) -d -m 755 $(LIBDIR)
+- $(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
+- $(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
+- $(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
++ $(INSTALL) -c -m 755 radius.so $(LIBDIR)
++ $(INSTALL) -c -m 755 radattr.so $(LIBDIR)
++ $(INSTALL) -c -m 755 radrealms.so $(LIBDIR)
+ $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)
+ $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
+
+ radius.so: radius.o libradiusclient.a
+- $(CC) -o radius.so -shared radius.o libradiusclient.a
++ $(CC) $(LDFLAGS) -o radius.so -shared radius.o libradiusclient.a
+
+ radattr.so: radattr.o
+- $(CC) -o radattr.so -shared radattr.o
++ $(CC) $(LDFLAGS) -o radattr.so -shared radattr.o
+
+ radrealms.so: radrealms.o
+- $(CC) -o radrealms.so -shared radrealms.o
++ $(CC) $(LDFLAGS) -o radrealms.so -shared radrealms.o
+
+ CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \
+ clientid.o sendserver.o lock.o util.o md5.o
+diff --git a/pppd/plugins/rp-pppoe/Makefile.linux b/pppd/plugins/rp-pppoe/Makefile.linux
+index 5d7a2719545d..00e0af6da20c 100644
+--- a/pppd/plugins/rp-pppoe/Makefile.linux
++++ b/pppd/plugins/rp-pppoe/Makefile.linux
+@@ -27,10 +27,12 @@ RP_VERSION=3.8p
+
+ COPTS=-O2 -g
+ CFLAGS=$(COPTS) -I../../../include '-DRP_VERSION="$(RP_VERSION)"'
++LDFLAGS=$(LDOPTS)
++
+ all: rp-pppoe.so pppoe-discovery
+
+ pppoe-discovery: pppoe-discovery.o debug.o
+- $(CC) -o pppoe-discovery pppoe-discovery.o debug.o
++ $(CC) $(LDFLAGS) -o pppoe-discovery pppoe-discovery.o debug.o
+
+ pppoe-discovery.o: pppoe-discovery.c
+ $(CC) $(CFLAGS) -c -o pppoe-discovery.o pppoe-discovery.c
+@@ -39,13 +41,13 @@ debug.o: debug.c
+ $(CC) $(CFLAGS) -c -o debug.o debug.c
+
+ rp-pppoe.so: plugin.o discovery.o if.o common.o
+- $(CC) -o rp-pppoe.so -shared plugin.o discovery.o if.o common.o
++ $(CC) $(LDFLAGS) -o rp-pppoe.so -shared $^
+
+ install: all
+ $(INSTALL) -d -m 755 $(LIBDIR)
+- $(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
++ $(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR)
+ $(INSTALL) -d -m 755 $(BINDIR)
+- $(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR)
++ $(INSTALL) -c -m 555 pppoe-discovery $(BINDIR)
+
+ clean:
+ rm -f *.o *.so pppoe-discovery
+diff --git a/pppdump/Makefile.linux b/pppdump/Makefile.linux
+index ac028f6bf4f0..65e5c14914fb 100644
+--- a/pppdump/Makefile.linux
++++ b/pppdump/Makefile.linux
+@@ -2,7 +2,10 @@ DESTDIR = $(INSTROOT)@DESTDIR@
+ BINDIR = $(DESTDIR)/sbin
+ MANDIR = $(DESTDIR)/share/man/man8
+
+-CFLAGS= -O -I../include/net
++COPTS=-O2 -g
++CFLAGS= $(COPTS) -I../include/net
++LDFLAGS=$(LDOPTS)
++
+ OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
+
+ INSTALL= install
+@@ -10,12 +13,12 @@ INSTALL= install
+ all: pppdump
+
+ pppdump: $(OBJS)
+- $(CC) -o pppdump $(OBJS)
++ $(CC) $(LDFLAGS) -o pppdump $(OBJS)
+
+ clean:
+ rm -f pppdump $(OBJS) *~
+
+ install:
+ mkdir -p $(BINDIR) $(MANDIR)
+- $(INSTALL) -s -c pppdump $(BINDIR)
++ $(INSTALL) -c pppdump $(BINDIR)
+ $(INSTALL) -c -m 444 pppdump.8 $(MANDIR)
+diff --git a/pppstats/Makefile.linux b/pppstats/Makefile.linux
+index cca6f0f61d87..9ec8e803665a 100644
+--- a/pppstats/Makefile.linux
++++ b/pppstats/Makefile.linux
+@@ -10,23 +10,24 @@ PPPSTATSRCS = pppstats.c
+ PPPSTATOBJS = pppstats.o
+
+ #CC = gcc
+-COPTS = -O
++COPTS = -O2 -g
+ COMPILE_FLAGS = -I../include
+ LIBS =
+
+ INSTALL= install
+
+ CFLAGS = $(COPTS) $(COMPILE_FLAGS)
++LDFLAGS= $(LDOPTS)
+
+ all: pppstats
+
+ install: pppstats
+ -mkdir -p $(MANDIR)
+- $(INSTALL) -s -c pppstats $(BINDIR)
++ $(INSTALL) -c pppstats $(BINDIR)
+ $(INSTALL) -c -m 444 pppstats.8 $(MANDIR)
+
+ pppstats: $(PPPSTATSRCS)
+- $(CC) $(CFLAGS) -o pppstats pppstats.c $(LIBS)
++ $(CC) $(LDFLAGS) $(CFLAGS) -o pppstats pppstats.c $(LIBS)
+
+ clean:
+ rm -f pppstats *~ #* core
diff --git a/patches/ppp-2.4.5/0011-close_dev_ppp.patch b/patches/ppp-2.4.7/0003-Bug-306261-pppd-does-not-properly-close-dev-ppp-on-p.patch
similarity index 75%
rename from patches/ppp-2.4.5/0011-close_dev_ppp.patch
rename to patches/ppp-2.4.7/0003-Bug-306261-pppd-does-not-properly-close-dev-ppp-on-p.patch
index 6343a790f..4c598ea63 100644
--- a/patches/ppp-2.4.5/0011-close_dev_ppp.patch
+++ b/patches/ppp-2.4.7/0003-Bug-306261-pppd-does-not-properly-close-dev-ppp-on-p.patch
@@ -1,11 +1,6 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] close_dev_ppp
-
-be sure to close /dev/ppp when reconnecting
-
From: Simon Peter <dn.tlp@gmx.net>
-Subject: Bug#306261: pppd does not properly close /dev/ppp on persist
+Date: Fri, 2 Jun 2017 11:03:30 +0200
+Subject: [PATCH] Bug#306261: pppd does not properly close /dev/ppp on persist
When using the kernel PPPoE driver, pppd never
closes /dev/ppp when the link has come down.
@@ -20,14 +15,14 @@ the always instantly returning select() on the unclosed fds.
The problem also occurs with the upstream version, but does not occur
when a pty/tty device is used for the ppp connection.
---
- pppd/sys-linux.c | 7 +++++++
+ pppd/sys-linux.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
-index 1643ac5..39568f1 100644
+index e5e9baf8821f..f92174854207 100644
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
-@@ -453,6 +453,13 @@ int generic_establish_ppp (int fd)
+@@ -458,6 +458,13 @@ int generic_establish_ppp (int fd)
if (new_style_driver) {
int flags;
diff --git a/patches/ppp-2.4.5/0014-fix_linkpidfile.patch b/patches/ppp-2.4.7/0004-Bug-284382-ppp-linkpidfile-is-not-created-upon-detac.patch
similarity index 74%
rename from patches/ppp-2.4.5/0014-fix_linkpidfile.patch
rename to patches/ppp-2.4.7/0004-Bug-284382-ppp-linkpidfile-is-not-created-upon-detac.patch
index f64b4eed9..cc65303ad 100644
--- a/patches/ppp-2.4.5/0014-fix_linkpidfile.patch
+++ b/patches/ppp-2.4.7/0004-Bug-284382-ppp-linkpidfile-is-not-created-upon-detac.patch
@@ -1,11 +1,6 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] fix_linkpidfile
-
-make sure that the linkpidfile is always created
-
-Subject: Bug#284382: ppp: linkpidfile is not created upon detachment
-From: <herbert@gondor.apana.org.au>
+From: "herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>
+Date: Fri, 2 Jun 2017 11:08:21 +0200
+Subject: [PATCH] Bug#284382: ppp: linkpidfile is not created upon detachment
Package: ppp
Version: 2.4.2+20040428-2
@@ -30,14 +25,14 @@ call has now been removed which is why I'm seeing this problem.
--
---
- pppd/main.c | 3 +--
+ pppd/main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/pppd/main.c b/pppd/main.c
-index 58a5bdb..8da4786 100644
+index 6d50d1bac1d9..439fedced8ff 100644
--- a/pppd/main.c
+++ b/pppd/main.c
-@@ -777,8 +777,7 @@ detach()
+@@ -770,8 +770,7 @@ detach()
/* update pid files if they have been written already */
if (pidfilename[0])
create_pidfile(pid);
@@ -46,4 +41,4 @@ index 58a5bdb..8da4786 100644
+ create_linkpidfile(pid);
exit(0); /* parent dies */
}
- dup2(fd_devnull, 0);
+ setsid();
diff --git a/patches/ppp-2.4.5/0016-pppdump_use_zlib.patch b/patches/ppp-2.4.7/0005-support-building-pppdump-with-the-system-zlib.patch
similarity index 60%
rename from patches/ppp-2.4.5/0016-pppdump_use_zlib.patch
rename to patches/ppp-2.4.7/0005-support-building-pppdump-with-the-system-zlib.patch
index b95b81a1b..ef5ef1e6d 100644
--- a/patches/ppp-2.4.5/0016-pppdump_use_zlib.patch
+++ b/patches/ppp-2.4.7/0005-support-building-pppdump-with-the-system-zlib.patch
@@ -1,17 +1,16 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] pppdump_use_zlib
+Date: Fri, 2 Jun 2017 11:09:30 +0200
+Subject: [PATCH] support building pppdump with the system zlib
-support building pppdump with the system zlib
---
- pppdump/Makefile.linux | 28 ++++++++++++++++++++++++++--
+ pppdump/Makefile.linux | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/pppdump/Makefile.linux b/pppdump/Makefile.linux
-index 8cd54fd..158ed1a 100644
+index 65e5c14914fb..87777fab5e94 100644
--- a/pppdump/Makefile.linux
+++ b/pppdump/Makefile.linux
-@@ -2,9 +2,33 @@ DESTDIR = $(INSTROOT)@DESTDIR@
+@@ -2,18 +2,42 @@ DESTDIR = $(INSTROOT)@DESTDIR@
BINDIR = $(DESTDIR)/sbin
MANDIR = $(DESTDIR)/share/man/man8
@@ -19,14 +18,16 @@ index 8cd54fd..158ed1a 100644
+DO_BSD_COMPRESS=y
+HAVE_ZLIB=n
+
- CFLAGS=-O2 -g
- COPTS= -I../include/net
+ COPTS=-O2 -g
+ CFLAGS= $(COPTS) -I../include/net
+ LDFLAGS=$(LDOPTS)
+
-OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
+OBJS = pppdump.o
+LIBS =
+
+ifdef DO_DEFLATE
-+COPTS += -DDO_DEFLATE=1
++CFLAGS += -DDO_DEFLATE=1
+OBJS += deflate.o
+ifdef HAVE_ZLIB
+LIBS += -lz
@@ -34,20 +35,19 @@ index 8cd54fd..158ed1a 100644
+OBJS += zlib.o
+endif
+else
-+COPTS += -DDO_DEFLATE=0
++CFLAGS += -DDO_DEFLATE=0
+endif
+
+ifdef DO_BSD_COMPRESS
-+COPTS += -DDO_BSD_COMPRESS=1
++CFLAGS += -DDO_BSD_COMPRESS=1
+OBJS += bsd-comp.o
+else
-+COPTS += -DDO_BSD_COMPRESS=0
++CFLAGS += -DDO_BSD_COMPRESS=0
+endif
INSTALL= install
-@@ -14,7 +38,7 @@ all: pppdump
- $(CC) $(COPTS) $(CFLAGS) -c $<
+ all: pppdump
pppdump: $(OBJS)
- $(CC) $(LDFLAGS) -o pppdump $(OBJS)
diff --git a/patches/ppp-2.4.5/0017-pppoatm_resolver_light.patch b/patches/ppp-2.4.7/0006-disable-unneeded-code-in-the-pppoatm-plugin.patch
similarity index 87%
rename from patches/ppp-2.4.5/0017-pppoatm_resolver_light.patch
rename to patches/ppp-2.4.7/0006-disable-unneeded-code-in-the-pppoatm-plugin.patch
index 9581d3cf0..55e262592 100644
--- a/patches/ppp-2.4.5/0017-pppoatm_resolver_light.patch
+++ b/patches/ppp-2.4.7/0006-disable-unneeded-code-in-the-pppoatm-plugin.patch
@@ -1,8 +1,6 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] pppoatm_resolver_light
-
-disable unneeded code in the pppoatm plugin
+Date: Fri, 2 Jun 2017 11:10:13 +0200
+Subject: [PATCH] disable unneeded code in the pppoatm plugin
This patch halves the size of the PPPoA plugin by disabling features
which are never used with normal DSL connections (i.e. parsing of QoS
@@ -13,22 +11,22 @@ A next step could be removing text2qos.c, text2atm.c, misc.c and ans.c
and encourage users interested in the complete features to link the
plugin with the real libatm. I really doubt anybody cares, anyway.
---
- pppd/plugins/pppoatm/Makefile.linux | 4 ++++
- pppd/plugins/pppoatm/pppoatm.c | 4 ++++
- pppd/plugins/pppoatm/text2atm.c | 4 ++++
+ pppd/plugins/pppoatm/Makefile.linux | 4 ++++
+ pppd/plugins/pppoatm/pppoatm.c | 4 ++++
+ pppd/plugins/pppoatm/text2atm.c | 4 ++++
3 files changed, 12 insertions(+)
diff --git a/pppd/plugins/pppoatm/Makefile.linux b/pppd/plugins/pppoatm/Makefile.linux
-index f3cb5c4..7996f45 100644
+index 002603c6cbef..76d81aced70a 100644
--- a/pppd/plugins/pppoatm/Makefile.linux
+++ b/pppd/plugins/pppoatm/Makefile.linux
@@ -25,9 +25,13 @@ ifdef HAVE_LIBATM
LIBS := -latm
else
- COPTS += -I.
+ CFLAGS += -I.
+PLUGIN_OBJS += text2atm.o
+ifdef USE_FULL_ATM_RESOLVER
-+COPTS += -DUSE_FULL_ATM_RESOLVER
++CFLAGS += -DUSE_FULL_ATM_RESOLVER
PLUGIN_OBJS += text2qos.o text2atm.o misc.o ans.o
LIBS := -lresolv
endif
@@ -37,7 +35,7 @@ index f3cb5c4..7996f45 100644
#*********
all: $(PLUGIN)
diff --git a/pppd/plugins/pppoatm/pppoatm.c b/pppd/plugins/pppoatm/pppoatm.c
-index d693350..a7560e9 100644
+index d693350bc473..a7560e9fb0c6 100644
--- a/pppd/plugins/pppoatm/pppoatm.c
+++ b/pppd/plugins/pppoatm/pppoatm.c
@@ -142,8 +142,12 @@ static int connect_pppoatm(void)
@@ -54,7 +52,7 @@ index d693350..a7560e9 100644
qos.rxtp.max_sdu = lcp_wantoptions[0].mru + pppoatm_overhead();
qos.aal = ATM_AAL5;
diff --git a/pppd/plugins/pppoatm/text2atm.c b/pppd/plugins/pppoatm/text2atm.c
-index c283b52..f7fa8ca 100644
+index c283b52b4120..f7fa8cac3a6f 100644
--- a/pppd/plugins/pppoatm/text2atm.c
+++ b/pppd/plugins/pppoatm/text2atm.c
@@ -72,6 +72,7 @@ static int try_pvc(const char *text,struct sockaddr_atmpvc *addr,int flags)
diff --git a/patches/ppp-2.4.5/0018-pppoatm_cleanup.patch b/patches/ppp-2.4.7/0007-cosmetic-cleanup-of-the-pppoatm-plugin.patch
similarity index 92%
rename from patches/ppp-2.4.5/0018-pppoatm_cleanup.patch
rename to patches/ppp-2.4.7/0007-cosmetic-cleanup-of-the-pppoatm-plugin.patch
index abc32ad3e..551bb2dbb 100644
--- a/patches/ppp-2.4.5/0018-pppoatm_cleanup.patch
+++ b/patches/ppp-2.4.7/0007-cosmetic-cleanup-of-the-pppoatm-plugin.patch
@@ -1,16 +1,14 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] pppoatm_cleanup
-
-cosmetic cleanup of the pppoatm plugin
+Date: Fri, 2 Jun 2017 11:10:33 +0200
+Subject: [PATCH] cosmetic cleanup of the pppoatm plugin
Removed some debugging messages and generally cleaned up the source.
---
- pppd/plugins/pppoatm/pppoatm.c | 23 +++++++++++++----------
+ pppd/plugins/pppoatm/pppoatm.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/pppd/plugins/pppoatm/pppoatm.c b/pppd/plugins/pppoatm/pppoatm.c
-index a7560e9..90d0c9a 100644
+index a7560e9fb0c6..90d0c9a85d9f 100644
--- a/pppd/plugins/pppoatm/pppoatm.c
+++ b/pppd/plugins/pppoatm/pppoatm.c
@@ -70,18 +70,20 @@ static int setdevname_pppoatm(const char *cp, const char **argv, int doit)
diff --git a/patches/ppp-2.4.5/0019-pppoe_noads.patch b/patches/ppp-2.4.7/0008-pppoe_noads.patch
similarity index 72%
rename from patches/ppp-2.4.5/0019-pppoe_noads.patch
rename to patches/ppp-2.4.7/0008-pppoe_noads.patch
index ded78f4c6..7274b2de4 100644
--- a/patches/ppp-2.4.5/0019-pppoe_noads.patch
+++ b/patches/ppp-2.4.7/0008-pppoe_noads.patch
@@ -1,16 +1,16 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
+Date: Fri, 2 Jun 2017 11:11:22 +0200
Subject: [PATCH] pppoe_noads
---
- pppd/plugins/rp-pppoe/plugin.c | 3 ---
+ pppd/plugins/rp-pppoe/plugin.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
-index 9bd6643..88678b4 100644
+index a8c2bb4f4a6a..c4c85b462afd 100644
--- a/pppd/plugins/rp-pppoe/plugin.c
+++ b/pppd/plugins/rp-pppoe/plugin.c
-@@ -345,9 +345,6 @@ plugin_init(void)
+@@ -376,9 +376,6 @@ plugin_init(void)
}
add_options(Options);
diff --git a/patches/ppp-2.4.5/0020-readable_connerrs.patch b/patches/ppp-2.4.7/0009-make-_PATH_CONNERRS-world-readable.patch
similarity index 67%
rename from patches/ppp-2.4.5/0020-readable_connerrs.patch
rename to patches/ppp-2.4.7/0009-make-_PATH_CONNERRS-world-readable.patch
index a1ca36d44..2c6b0a7e2 100644
--- a/patches/ppp-2.4.5/0020-readable_connerrs.patch
+++ b/patches/ppp-2.4.7/0009-make-_PATH_CONNERRS-world-readable.patch
@@ -1,19 +1,17 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:26 +0100
-Subject: [PATCH] readable_connerrs
-
-make _PATH_CONNERRS world readable
+Date: Fri, 2 Jun 2017 11:12:17 +0200
+Subject: [PATCH] make _PATH_CONNERRS world readable
There is nothing security-sensitive there.
---
- pppd/main.c | 2 +-
+ pppd/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pppd/main.c b/pppd/main.c
-index 8513b1d..123a9d0 100644
+index 439fedced8ff..23d21d427df7 100644
--- a/pppd/main.c
+++ b/pppd/main.c
-@@ -1637,7 +1637,7 @@ device_script(program, in, out, dont_wait)
+@@ -1678,7 +1678,7 @@ device_script(program, in, out, dont_wait)
if (log_to_fd >= 0)
errfd = log_to_fd;
else
diff --git a/patches/ppp-2.4.7/0010-Correct-unkown-unknown-typo.patch b/patches/ppp-2.4.7/0010-Correct-unkown-unknown-typo.patch
new file mode 100644
index 000000000..450b05e9d
--- /dev/null
+++ b/patches/ppp-2.4.7/0010-Correct-unkown-unknown-typo.patch
@@ -0,0 +1,39 @@
+From: Chris Boot <bootc@debian.org>
+Date: Fri, 2 Jun 2017 11:12:56 +0200
+Subject: [PATCH] Correct unkown => unknown typo
+
+---
+ pppd/plugins/radius/config.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/pppd/plugins/radius/config.c b/pppd/plugins/radius/config.c
+index a29e5e8da909..f892ca7b1bf5 100644
+--- a/pppd/plugins/radius/config.c
++++ b/pppd/plugins/radius/config.c
+@@ -271,7 +271,7 @@ char *rc_conf_str(char *optname)
+ option = find_option(optname, OT_STR);
+
+ if (option == NULL)
+- fatal("rc_conf_str: unkown config option requested: %s", optname);
++ fatal("rc_conf_str: unknown config option requested: %s", optname);
+ return (char *)option->val;
+ }
+
+@@ -282,7 +282,7 @@ int rc_conf_int(char *optname)
+ option = find_option(optname, OT_INT|OT_AUO);
+
+ if (option == NULL)
+- fatal("rc_conf_int: unkown config option requested: %s", optname);
++ fatal("rc_conf_int: unknown config option requested: %s", optname);
+ return *((int *)option->val);
+ }
+
+@@ -293,7 +293,7 @@ SERVER *rc_conf_srv(char *optname)
+ option = find_option(optname, OT_SRV);
+
+ if (option == NULL)
+- fatal("rc_conf_srv: unkown config option requested: %s", optname);
++ fatal("rc_conf_srv: unknown config option requested: %s", optname);
+ return (SERVER *)option->val;
+ }
+
diff --git a/patches/ppp-2.4.7/0011-pppoe-custom-host-uniq-tag.patch b/patches/ppp-2.4.7/0011-pppoe-custom-host-uniq-tag.patch
new file mode 100644
index 000000000..9b4e4a796
--- /dev/null
+++ b/patches/ppp-2.4.7/0011-pppoe-custom-host-uniq-tag.patch
@@ -0,0 +1,298 @@
+From: Matteo Croce <matteo@openwrt.org>
+Date: Sat, 21 Nov 2015 18:45:43 +0100
+Subject: [PATCH] pppoe: custom host-uniq tag
+
+Add pppoe 'host-uniq' option to set an arbitrary
+host-uniq tag instead of the pppd pid.
+Some ISPs use such tag to authenticate the CPE,
+so it must be set to a proper value to connect.
+
+Signed-off-by: Matteo Croce <matteo@openwrt.org>
+Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
+---
+ pppd/plugins/rp-pppoe/common.c | 14 ++++-----
+ pppd/plugins/rp-pppoe/discovery.c | 51 +++++++++++++--------------------
+ pppd/plugins/rp-pppoe/plugin.c | 7 ++++-
+ pppd/plugins/rp-pppoe/pppoe-discovery.c | 38 +++++++++++++++---------
+ pppd/plugins/rp-pppoe/pppoe.h | 31 +++++++++++++++++++-
+ 5 files changed, 86 insertions(+), 55 deletions(-)
+
+diff --git a/pppd/plugins/rp-pppoe/common.c b/pppd/plugins/rp-pppoe/common.c
+index 89c633c773f9..8f175ece345b 100644
+--- a/pppd/plugins/rp-pppoe/common.c
++++ b/pppd/plugins/rp-pppoe/common.c
+@@ -119,15 +119,11 @@ sendPADT(PPPoEConnection *conn, char const *msg)
+ conn->session = 0;
+
+ /* If we're using Host-Uniq, copy it over */
+- if (conn->useHostUniq) {
+- PPPoETag hostUniq;
+- pid_t pid = getpid();
+- hostUniq.type = htons(TAG_HOST_UNIQ);
+- hostUniq.length = htons(sizeof(pid));
+- memcpy(hostUniq.payload, &pid, sizeof(pid));
+- memcpy(cursor, &hostUniq, sizeof(pid) + TAG_HDR_SIZE);
+- cursor += sizeof(pid) + TAG_HDR_SIZE;
+- plen += sizeof(pid) + TAG_HDR_SIZE;
++ if (conn->hostUniq.length) {
++ int len = ntohs(conn->hostUniq.length);
++ memcpy(cursor, &conn->hostUniq, len + TAG_HDR_SIZE);
++ cursor += len + TAG_HDR_SIZE;
++ plen += len + TAG_HDR_SIZE;
+ }
+
+ /* Copy error message */
+diff --git a/pppd/plugins/rp-pppoe/discovery.c b/pppd/plugins/rp-pppoe/discovery.c
+index 04877cb8295f..5db8d0defc37 100644
+--- a/pppd/plugins/rp-pppoe/discovery.c
++++ b/pppd/plugins/rp-pppoe/discovery.c
+@@ -80,13 +80,10 @@ static void
+ parseForHostUniq(UINT16_t type, UINT16_t len, unsigned char *data,
+ void *extra)
+ {
+- int *val = (int *) extra;
+- if (type == TAG_HOST_UNIQ && len == sizeof(pid_t)) {
+- pid_t tmp;
+- memcpy(&tmp, data, len);
+- if (tmp == getpid()) {
+- *val = 1;
+- }
++ PPPoETag *tag = extra;
++
++ if (type == TAG_HOST_UNIQ && len == ntohs(tag->length)) {
++ tag->length = memcmp(data, tag->payload, len);
+ }
+ }
+
+@@ -104,16 +101,16 @@ parseForHostUniq(UINT16_t type, UINT16_t len, unsigned char *data,
+ static int
+ packetIsForMe(PPPoEConnection *conn, PPPoEPacket *packet)
+ {
+- int forMe = 0;
++ PPPoETag hostUniq = conn->hostUniq;
+
+ /* If packet is not directed to our MAC address, forget it */
+ if (memcmp(packet->ethHdr.h_dest, conn->myEth, ETH_ALEN)) return 0;
+
+ /* If we're not using the Host-Unique tag, then accept the packet */
+- if (!conn->useHostUniq) return 1;
++ if (!conn->hostUniq.length) return 1;
+
+- parsePacket(packet, parseForHostUniq, &forMe);
+- return forMe;
++ parsePacket(packet, parseForHostUniq, &hostUniq);
++ return !hostUniq.length;
+ }
+
+ /**********************************************************************
+@@ -301,16 +298,12 @@ sendPADI(PPPoEConnection *conn)
+ }
+
+ /* If we're using Host-Uniq, copy it over */
+- if (conn->useHostUniq) {
+- PPPoETag hostUniq;
+- pid_t pid = getpid();
+- hostUniq.type = htons(TAG_HOST_UNIQ);
+- hostUniq.length = htons(sizeof(pid));
+- memcpy(hostUniq.payload, &pid, sizeof(pid));
+- CHECK_ROOM(cursor, packet.payload, sizeof(pid) + TAG_HDR_SIZE);
+- memcpy(cursor, &hostUniq, sizeof(pid) + TAG_HDR_SIZE);
+- cursor += sizeof(pid) + TAG_HDR_SIZE;
+- plen += sizeof(pid) + TAG_HDR_SIZE;
++ if (conn->hostUniq.length) {
++ int len = ntohs(conn->hostUniq.length);
++ CHECK_ROOM(cursor, packet.payload, len + TAG_HDR_SIZE);
++ memcpy(cursor, &conn->hostUniq, len + TAG_HDR_SIZE);
++ cursor += len + TAG_HDR_SIZE;
++ plen += len + TAG_HDR_SIZE;
+ }
+
+ /* Add our maximum MTU/MRU */
+@@ -478,16 +471,12 @@ sendPADR(PPPoEConnection *conn)
+ cursor += namelen + TAG_HDR_SIZE;
+
+ /* If we're using Host-Uniq, copy it over */
+- if (conn->useHostUniq) {
+- PPPoETag hostUniq;
+- pid_t pid = getpid();
+- hostUniq.type = htons(TAG_HOST_UNIQ);
+- hostUniq.length = htons(sizeof(pid));
+- memcpy(hostUniq.payload, &pid, sizeof(pid));
+- CHECK_ROOM(cursor, packet.payload, sizeof(pid)+TAG_HDR_SIZE);
+- memcpy(cursor, &hostUniq, sizeof(pid) + TAG_HDR_SIZE);
+- cursor += sizeof(pid) + TAG_HDR_SIZE;
+- plen += sizeof(pid) + TAG_HDR_SIZE;
++ if (conn->hostUniq.length) {
++ int len = ntohs(conn->hostUniq.length);
++ CHECK_ROOM(cursor, packet.payload, len+TAG_HDR_SIZE);
++ memcpy(cursor, &conn->hostUniq, len + TAG_HDR_SIZE);
++ cursor += len + TAG_HDR_SIZE;
++ plen += len + TAG_HDR_SIZE;
+ }
+
+ /* Add our maximum MTU/MRU */
+diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c
+index c4c85b462afd..1a7e1e1b4e53 100644
+--- a/pppd/plugins/rp-pppoe/plugin.c
++++ b/pppd/plugins/rp-pppoe/plugin.c
+@@ -68,6 +68,7 @@ static char *existingSession = NULL;
+ static int printACNames = 0;
+ static char *pppoe_reqd_mac = NULL;
+ unsigned char pppoe_reqd_mac_addr[6];
++static char *host_uniq = NULL;
+
+ static int PPPoEDevnameHook(char *cmd, char **argv, int doit);
+ static option_t Options[] = {
+@@ -85,6 +86,8 @@ static option_t Options[] = {
+ "Be verbose about discovered access concentrators"},
+ { "pppoe-mac", o_string, &pppoe_reqd_mac,
+ "Only connect to specified MAC address" },
++ { "host-uniq", o_string, &host_uniq,
++ "Specify custom Host-Uniq" },
+ { NULL }
+ };
+ int (*OldDevnameHook)(char *cmd, char **argv, int doit) = NULL;
+@@ -110,7 +113,6 @@ PPPOEInitDevice(void)
+ conn->ifName = devnam;
+ conn->discoverySocket = -1;
+ conn->sessionSocket = -1;
+- conn->useHostUniq = 1;
+ conn->printACNames = printACNames;
+ conn->discoveryTimeout = PADI_TIMEOUT;
+ return 1;
+@@ -166,6 +168,9 @@ PPPOEConnectDevice(void)
+ if (lcp_wantoptions[0].mru > ifr.ifr_mtu - TOTAL_OVERHEAD)
+ lcp_wantoptions[0].mru = ifr.ifr_mtu - TOTAL_OVERHEAD;
+
++ if (host_uniq && !parseHostUniq(host_uniq, &conn->hostUniq))
++ fatal("Illegal value for host-uniq option");
++
+ conn->acName = acName;
+ conn->serviceName = pppd_pppoe_service;
+ strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam));
+diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c
+index 3d3bf4eecc81..f4f527128c2f 100644
+--- a/pppd/plugins/rp-pppoe/pppoe-discovery.c
++++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c
+@@ -347,7 +347,7 @@ packetIsForMe(PPPoEConnection *conn, PPPoEPacket *packet)
+ if (memcmp(packet->ethHdr.h_dest, conn->myEth, ETH_ALEN)) return 0;
+
+ /* If we're not using the Host-Unique tag, then accept the packet */
+- if (!conn->useHostUniq) return 1;
++ if (!conn->hostUniq.length) return 1;
+
+ parsePacket(packet, parseForHostUniq, &forMe);
+ return forMe;
+@@ -473,16 +473,12 @@ sendPADI(PPPoEConnection *conn)
+ cursor += namelen + TAG_HDR_SIZE;
+
+ /* If we're using Host-Uniq, copy it over */
+- if (conn->useHostUniq) {
+- PPPoETag hostUniq;
+- pid_t pid = getpid();
+- hostUniq.type = htons(TAG_HOST_UNIQ);
+- hostUniq.length = htons(sizeof(pid));
+- memcpy(hostUniq.payload, &pid, sizeof(pid));
+- CHECK_ROOM(cursor, packet.payload, sizeof(pid) + TAG_HDR_SIZE);
+- memcpy(cursor, &hostUniq, sizeof(pid) + TAG_HDR_SIZE);
+- cursor += sizeof(pid) + TAG_HDR_SIZE;
+- plen += sizeof(pid) + TAG_HDR_SIZE;
++ if (conn->hostUniq.length) {
++ int len = ntohs(conn->hostUniq.length);
++ CHECK_ROOM(cursor, packet.payload, len + TAG_HDR_SIZE);
++ memcpy(cursor, &conn->hostUniq, len + TAG_HDR_SIZE);
++ cursor += len + TAG_HDR_SIZE;
++ plen += len + TAG_HDR_SIZE;
+ }
+
+ packet.length = htons(plen);
+@@ -644,7 +640,7 @@ int main(int argc, char *argv[])
+
+ memset(conn, 0, sizeof(PPPoEConnection));
+
+- while ((opt = getopt(argc, argv, "I:D:VUAS:C:h")) > 0) {
++ while ((opt = getopt(argc, argv, "I:D:VUW:AS:C:h")) > 0) {
+ switch(opt) {
+ case 'S':
+ conn->serviceName = xstrdup(optarg);
+@@ -653,7 +649,23 @@ int main(int argc, char *argv[])
+ conn->acName = xstrdup(optarg);
+ break;
+ case 'U':
+- conn->useHostUniq = 1;
++ if(conn->hostUniq.length) {
++ fprintf(stderr, "-U and -W are mutually exclusive\n");
++ exit(EXIT_FAILURE);
++ }
++ char pidbuf[5];
++ snprintf(pidbuf, sizeof(pidbuf), "%04x", getpid());
++ parseHostUniq(pidbuf, &conn->hostUniq);
++ break;
++ case 'W':
++ if(conn->hostUniq.length) {
++ fprintf(stderr, "-U and -W are mutually exclusive\n");
++ exit(EXIT_FAILURE);
++ }
++ if (!parseHostUniq(optarg, &conn->hostUniq)) {
++ fprintf(stderr, "Invalid host-uniq argument: %s\n", optarg);
++ exit(EXIT_FAILURE);
++ }
+ break;
+ case 'D':
+ conn->debugFile = fopen(optarg, "w");
+diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
+index 9ab2eee3914c..86d2b1e47a25 100644
+--- a/pppd/plugins/rp-pppoe/pppoe.h
++++ b/pppd/plugins/rp-pppoe/pppoe.h
+@@ -21,6 +21,8 @@
+
+ #include <stdio.h> /* For FILE */
+ #include <sys/types.h> /* For pid_t */
++#include <ctype.h>
++#include <string.h>
+
+ /* How do we access raw Ethernet devices? */
+ #undef USE_LINUX_PACKET
+@@ -235,7 +237,7 @@ typedef struct PPPoEConnectionStruct {
+ char *serviceName; /* Desired service name, if any */
+ char *acName; /* Desired AC name, if any */
+ int synchronous; /* Use synchronous PPP */
+- int useHostUniq; /* Use Host-Uniq tag */
++ PPPoETag hostUniq; /* Use Host-Uniq tag */
+ int printACNames; /* Just print AC names */
+ FILE *debugFile; /* Debug file for dumping packets */
+ int numPADOs; /* Number of PADO packets received */
+@@ -291,6 +293,33 @@ void pppoe_printpkt(PPPoEPacket *packet,
+ void (*printer)(void *, char *, ...), void *arg);
+ void pppoe_log_packet(const char *prefix, PPPoEPacket *packet);
+
++static inline int parseHostUniq(const char *uniq, PPPoETag *tag)
++{
++ int i, len = strlen(uniq);
++
++#define hex(x) \
++ (((x) <= '9') ? ((x) - '0') : \
++ (((x) <= 'F') ? ((x) - 'A' + 10) : \
++ ((x) - 'a' + 10)))
++
++ if (len % 2)
++ return 0;
++
++ for (i = 0; i < len; i += 2)
++ {
++ if (!isxdigit(uniq[i]) || !isxdigit(uniq[i+1]))
++ return 0;
++
++ tag->payload[i / 2] = (char)(16 * hex(uniq[i]) + hex(uniq[i+1]));
++ }
++
++#undef hex
++
++ tag->type = htons(TAG_HOST_UNIQ);
++ tag->length = htons(len / 2);
++ return 1;
++}
++
+ #define SET_STRING(var, val) do { if (var) free(var); var = strDup(val); } while(0);
+
+ #define CHECK_ROOM(cursor, start, len) \
diff --git a/patches/ppp-2.4.5/0021-011_scripts_redialer.diff.patch b/patches/ppp-2.4.7/0012-scripts_redialer.patch
similarity index 96%
rename from patches/ppp-2.4.5/0021-011_scripts_redialer.diff.patch
rename to patches/ppp-2.4.7/0012-scripts_redialer.patch
index a5e8e99c0..19b963bae 100644
--- a/patches/ppp-2.4.5/0021-011_scripts_redialer.diff.patch
+++ b/patches/ppp-2.4.7/0012-scripts_redialer.patch
@@ -1,13 +1,13 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:27 +0100
-Subject: [PATCH] 011_scripts_redialer.diff
+Date: Fri, 2 Jun 2017 11:14:10 +0200
+Subject: [PATCH] scripts_redialer
---
- scripts/redialer | 133 ++++++++++++++++++++++--------------------------------
+ scripts/redialer | 133 ++++++++++++++++++++++---------------------------------
1 file changed, 53 insertions(+), 80 deletions(-)
diff --git a/scripts/redialer b/scripts/redialer
-index 5bbde4e..c0b748a 100755
+index 5bbde4e9da4e..c0b748ad0e53 100755
--- a/scripts/redialer
+++ b/scripts/redialer
@@ -1,96 +1,69 @@
diff --git a/patches/ppp-2.4.5/0022-cifdefroute.dif.patch b/patches/ppp-2.4.7/0013-Add-replacedefaultroute-option.patch
similarity index 64%
rename from patches/ppp-2.4.5/0022-cifdefroute.dif.patch
rename to patches/ppp-2.4.7/0013-Add-replacedefaultroute-option.patch
index f7cf6a836..376b3453a 100644
--- a/patches/ppp-2.4.5/0022-cifdefroute.dif.patch
+++ b/patches/ppp-2.4.7/0013-Add-replacedefaultroute-option.patch
@@ -1,24 +1,35 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:27 +0100
-Subject: [PATCH] cifdefroute.dif
+Date: Fri, 2 Jun 2017 11:15:32 +0200
+Subject: [PATCH] Add replacedefaultroute option
+Adds an option to pppd to control whether to replace existing default routes
+when using the 'defaultroute' option.
+
+If defaultroute and replacedefaultroute are both set, pppd replaces an existing
+default route with the new default route. The old default route is restored when
+the connection is taken down.
+
+Origin: vendor, https://build.opensuse.org/source/network/ppp/ppp-2.4.2-cifdefroute.diff?rev=7a0fdeff0b29437dd7f4581c95c7255a
+Forwarded: no
+Reviewed-by: Chris Boot <bootc@debian.org>
+Last-Update: 2014-01-26
---
- pppd/ipcp.c | 37 +++++++++++++++++++-----
- pppd/ipcp.h | 1 +
- pppd/pppd.8 | 12 +++++++-
- pppd/pppd.h | 2 +-
- pppd/sys-linux.c | 82 ++++++++++++++++++++++++++++++++++++++++++----------
- pppd/sys-solaris.c | 8 ++++-
- 6 files changed, 116 insertions(+), 26 deletions(-)
+ pppd/ipcp.c | 45 +++++++++++++++++++++++++++----
+ pppd/ipcp.h | 1 +
+ pppd/pppd.8 | 12 ++++++++-
+ pppd/pppd.h | 4 +++
+ pppd/sys-linux.c | 82 +++++++++++++++++++++++++++++++++++++++++++++-----------
+ 5 files changed, 123 insertions(+), 21 deletions(-)
diff --git a/pppd/ipcp.c b/pppd/ipcp.c
-index 12bcc61..6af53d1 100644
+index e9738fe4d894..c8fe279d4ede 100644
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
-@@ -198,6 +198,14 @@ static option_t ipcp_option_list[] = {
+@@ -198,6 +198,16 @@ static option_t ipcp_option_list[] = {
"disable defaultroute option", OPT_ALIAS | OPT_A2CLR,
&ipcp_wantoptions[0].default_route },
++#ifdef __linux__
+ { "replacedefaultroute", o_bool,
+ &ipcp_wantoptions[0].replace_default_route,
+ "Replace default route", 1
@@ -27,10 +38,11 @@ index 12bcc61..6af53d1 100644
+ &ipcp_allowoptions[0].replace_default_route,
+ "Never replace default route", OPT_A2COPY,
+ &ipcp_wantoptions[0].replace_default_route },
++#endif
{ "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp,
"Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp },
{ "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp,
-@@ -271,7 +279,7 @@ struct protent ipcp_protent = {
+@@ -271,7 +281,7 @@ struct protent ipcp_protent = {
ip_active_pkt
};
@@ -39,17 +51,20 @@ index 12bcc61..6af53d1 100644
static void ipcp_script __P((char *, int)); /* Run an up/down script */
static void ipcp_script_done __P((void *));
-@@ -1742,7 +1750,8 @@ ip_demand_conf(u)
+@@ -1761,7 +1771,12 @@ ip_demand_conf(u)
if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE))
return 0;
if (wo->default_route)
-- if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr))
++#ifndef __linux__
+ if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr))
++#else
+ if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr,
-+ wo->replace_default_route))
++ wo->replace_default_route))
++#endif
default_route_set[u] = 1;
if (wo->proxy_arp)
if (sifproxyarp(u, wo->hisaddr))
-@@ -1830,7 +1839,8 @@ ipcp_up(f)
+@@ -1849,7 +1864,8 @@ ipcp_up(f)
*/
if (demand) {
if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) {
@@ -59,27 +74,33 @@ index 12bcc61..6af53d1 100644
if (go->ouraddr != wo->ouraddr) {
warn("Local IP address changed to %I", go->ouraddr);
script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0);
-@@ -1855,7 +1865,8 @@ ipcp_up(f)
+@@ -1874,7 +1890,12 @@ ipcp_up(f)
/* assign a default route through the interface if required */
if (ipcp_wantoptions[f->unit].default_route)
-- if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
++#ifndef __linux__
+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
++#else
+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
-+ wo->replace_default_route))
++ wo->replace_default_route))
++#endif
default_route_set[f->unit] = 1;
/* Make a proxy ARP entry if requested. */
-@@ -1905,7 +1916,8 @@ ipcp_up(f)
+@@ -1924,7 +1945,12 @@ ipcp_up(f)
/* assign a default route through the interface if required */
if (ipcp_wantoptions[f->unit].default_route)
-- if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
++#ifndef __linux__
+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
++#else
+ if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
-+ wo->replace_default_route))
++ wo->replace_default_route))
++#endif
default_route_set[f->unit] = 1;
/* Make a proxy ARP entry if requested. */
-@@ -1983,7 +1995,7 @@ ipcp_down(f)
+@@ -2002,7 +2028,7 @@ ipcp_down(f)
sifnpmode(f->unit, PPP_IP, NPMODE_DROP);
sifdown(f->unit);
ipcp_clear_addrs(f->unit, ipcp_gotoptions[f->unit].ouraddr,
@@ -88,7 +109,7 @@ index 12bcc61..6af53d1 100644
}
/* Execute the ip-down script */
-@@ -1999,16 +2011,25 @@ ipcp_down(f)
+@@ -2018,16 +2044,25 @@ ipcp_down(f)
* proxy arp entries, etc.
*/
static void
@@ -117,7 +138,7 @@ index 12bcc61..6af53d1 100644
default_route_set[unit] = 0;
}
diff --git a/pppd/ipcp.h b/pppd/ipcp.h
-index 6cf14c9..7ecfa79 100644
+index 6cf14c990578..7ecfa79d8668 100644
--- a/pppd/ipcp.h
+++ b/pppd/ipcp.h
@@ -70,6 +70,7 @@ typedef struct ipcp_options {
@@ -129,7 +150,7 @@ index 6cf14c9..7ecfa79 100644
bool neg_vj; /* Van Jacobson Compression? */
bool old_vj; /* use old (short) form of VJ option? */
diff --git a/pppd/pppd.8 b/pppd/pppd.8
-index 43b5416..7d49321 100644
+index b7fd0bdaab52..67181083808b 100644
--- a/pppd/pppd.8
+++ b/pppd/pppd.8
@@ -121,6 +121,11 @@ the gateway, when IPCP negotiation is successfully completed.
@@ -144,7 +165,7 @@ index 43b5416..7d49321 100644
.B disconnect \fIscript
Execute the command specified by \fIscript\fR, by passing it to a
shell, after
-@@ -730,7 +735,12 @@ disable both forms of hardware flow control.
+@@ -739,7 +744,12 @@ disable both forms of hardware flow control.
.TP
.B nodefaultroute
Disable the \fIdefaultroute\fR option. The system administrator who
@@ -159,32 +180,35 @@ index 43b5416..7d49321 100644
.TP
.B nodeflate
diff --git a/pppd/pppd.h b/pppd/pppd.h
-index 87522d0..af97671 100644
+index 247fa153739b..8ade4d817092 100644
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
-@@ -645,7 +645,7 @@ int cif6addr __P((int, eui64_t, eui64_t));
- int ether_to_eui64 __P((eui64_t *));
- /* Convert Ethernet address into 64-bit EUI */
+@@ -665,7 +665,11 @@ int sif6addr __P((int, eui64_t, eui64_t));
+ int cif6addr __P((int, eui64_t, eui64_t));
+ /* Remove an IPv6 address from i/f */
#endif
--int sifdefaultroute __P((int, u_int32_t, u_int32_t));
++#ifndef __linux__
+ int sifdefaultroute __P((int, u_int32_t, u_int32_t));
++#else
+int sifdefaultroute __P((int, u_int32_t, u_int32_t, bool replace_default_rt));
++#endif
/* Create default route through i/f */
int cifdefaultroute __P((int, u_int32_t, u_int32_t));
/* Delete default route through i/f */
diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
-index 39568f1..d62a5ea 100644
+index f92174854207..86cde57664af 100644
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
-@@ -206,6 +206,8 @@ static unsigned char inbuf[512]; /* buffer for chars read from loopback */
-
+@@ -207,6 +207,8 @@ static unsigned char inbuf[512]; /* buffer for chars read from loopback */
static int if_is_up; /* Interface has been marked up */
+ static int if6_is_up; /* Interface has been marked up for IPv6, to help differentiate */
static int have_default_route; /* Gateway for default route added */
-+static struct rtentry old_def_rt; /* Old default route */
-+static int default_rt_repl_rest; /* replace and restore old default rt */
++static struct rtentry old_def_rt; /* Old default route */
++static int default_rt_repl_rest; /* replace and restore old default rt */
static u_int32_t proxy_arp_addr; /* Addr for proxy arp entry added */
static char proxy_arp_dev[16]; /* Device for proxy arp entry */
static u_int32_t our_old_addr; /* for detecting address changes */
-@@ -1544,6 +1546,9 @@ static int read_route_table(struct rtentry *rt)
+@@ -1552,6 +1554,9 @@ static int read_route_table(struct rtentry *rt)
p = NULL;
}
@@ -194,7 +218,7 @@ index 39568f1..d62a5ea 100644
SIN_ADDR(rt->rt_dst) = strtoul(cols[route_dest_col], NULL, 16);
SIN_ADDR(rt->rt_gateway) = strtoul(cols[route_gw_col], NULL, 16);
SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16);
-@@ -1613,20 +1618,51 @@ int have_route_to(u_int32_t addr)
+@@ -1621,22 +1626,53 @@ int have_route_to(u_int32_t addr)
/********************************************************************
*
* sifdefaultroute - assign a default route through the address given.
@@ -209,6 +233,9 @@ index 39568f1..d62a5ea 100644
- error("not replacing existing default route via %I",
- SIN_ADDR(rt.rt_gateway));
- else
+- error("not replacing existing default route through %s",
+- rt.rt_dev);
+- return 0;
+ *
+ * If the global default_rt_repl_rest flag is set, then this function
+ * already replaced the original system defaultroute with some other
@@ -225,74 +252,64 @@ index 39568f1..d62a5ea 100644
+ struct rtentry *del_rt = NULL;
+
+ if (default_rt_repl_rest) {
-+ /* We have already reclaced the original defaultroute, if we
-+ are called again, we will delete the current default route
-+ and set the new default route in this function.
-+ - this is normally only the case the doing demand: */
-+ if (defaultroute_exists(&tmp_rt))
-+ del_rt = &tmp_rt;
-+ } else if (defaultroute_exists(&old_def_rt) &&
-+ strcmp(old_def_rt.rt_dev, ifname) != 0) {
-+ /* We did not yet replace an existing default route, let's
-+ check if we should save and replace a default route: */
-+ if (old_def_rt.rt_flags & RTF_GATEWAY) {
-+ if (!replace) {
-+ error("not replacing existing default route via %I",
-+ SIN_ADDR(old_def_rt.rt_gateway));
-+ return 0;
-+ } else {
-+ /* we need to copy rt_dev because we need it permanent too: */
-+ char *tmp_dev = malloc(strlen(old_def_rt.rt_dev) + 1);
-+ strcpy(tmp_dev, old_def_rt.rt_dev);
-+ old_def_rt.rt_dev = tmp_dev;
++ /* We have already reclaced the original defaultroute, if we
++ * are called again, we will delete the current default route
++ * and set the new default route in this function.
++ * - this is normally only the case the doing demand: */
++ if (defaultroute_exists( &tmp_rt ))
++ del_rt = &tmp_rt;
++ } else if ( defaultroute_exists( &old_def_rt ) &&
++ strcmp( old_def_rt.rt_dev, ifname ) != 0) {
++ /* We did not yet replace an existing default route, let's
++ * check if we should save and replace a default route:
++ */
++ u_int32_t old_gateway = SIN_ADDR(old_def_rt.rt_gateway);
+
-+ notice("replacing old default route to %s [%I]",
-+ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway));
-+ default_rt_repl_rest = 1;
-+ del_rt = &old_def_rt;
-+ }
-+ } else
- error("not replacing existing default route through %s",
-- rt.rt_dev);
-- return 0;
-+ old_def_rt.rt_dev);
++ if (old_gateway != gateway) {
++ if (!replace) {
++ error("not replacing default route to %s [%I]",
++ old_def_rt.rt_dev, old_gateway);
++ return 0;
++ } else {
++ // we need to copy rt_dev because we need it permanent too:
++ char * tmp_dev = malloc(strlen(old_def_rt.rt_dev)+1);
++ strcpy(tmp_dev, old_def_rt.rt_dev);
++ old_def_rt.rt_dev = tmp_dev;
++
++ notice("replacing old default route to %s [%I]",
++ old_def_rt.rt_dev, old_gateway);
++ default_rt_repl_rest = 1;
++ del_rt = &old_def_rt;
++ }
++ }
}
-
+-
memset (&rt, 0, sizeof (rt));
-@@ -1641,10 +1677,16 @@ int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
+ SET_SA_FAMILY (rt.rt_dst, AF_INET);
- rt.rt_flags = RTF_UP;
- if (ioctl(sock_fd, SIOCADDRT, &rt) < 0) {
-- if ( ! ok_error ( errno ))
-+ if (!ok_error(errno))
+@@ -1653,6 +1689,12 @@ int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
error("default route ioctl(SIOCADDRT): %m");
return 0;
}
+ if (default_rt_repl_rest && del_rt)
+ if (ioctl(sock_fd, SIOCDELRT, del_rt) < 0) {
-+ if (!ok_error(errno))
-+ error("del old default route ioctl(SIOCDELRT): %m");
++ if ( ! ok_error ( errno ))
++ error("del old default route ioctl(SIOCDELRT): %m(%d)", errno);
+ return 0;
+ }
have_default_route = 1;
return 1;
-@@ -1675,11 +1717,21 @@ int cifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
- rt.rt_flags = RTF_UP;
- if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) {
- if (still_ppp()) {
-- if ( ! ok_error ( errno ))
-+ if (!ok_error(errno))
- error("default route ioctl(SIOCDELRT): %m");
+@@ -1688,6 +1730,16 @@ int cifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
return 0;
}
}
+ if (default_rt_repl_rest) {
+ notice("restoring old default route to %s [%I]",
-+ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway));
++ old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway));
+ if (ioctl(sock_fd, SIOCADDRT, &old_def_rt) < 0) {
-+ if (!ok_error(errno))
-+ error("restore default route ioctl(SIOCADDRT): %m");
++ if ( ! ok_error ( errno ))
++ error("restore default route ioctl(SIOCADDRT): %m(%d)", errno);
+ return 0;
+ }
+ default_rt_repl_rest = 0;
@@ -300,27 +317,3 @@ index 39568f1..d62a5ea 100644
return 1;
}
-diff --git a/pppd/sys-solaris.c b/pppd/sys-solaris.c
-index 50ce3df..e786f04 100644
---- a/pppd/sys-solaris.c
-+++ b/pppd/sys-solaris.c
-@@ -2036,12 +2036,18 @@ cifaddr(u, o, h)
- * sifdefaultroute - assign a default route through the address given.
- */
- int
--sifdefaultroute(u, l, g)
-+sifdefaultroute(u, l, g, replace)
- int u;
- u_int32_t l, g;
-+ bool replace;
- {
- struct rtentry rt;
-
-+ if (replace) {
-+ error("replacedefaultroute not supported on this platform");
-+ return 0;
-+ }
-+
- #if defined(__USLC__)
- g = l; /* use the local address as gateway */
- #endif
diff --git a/patches/ppp-2.4.5/0023-ppp-2.3.11-oedod.dif.patch b/patches/ppp-2.4.7/0014-ppp-2.3.11-oedod.patch
similarity index 92%
rename from patches/ppp-2.4.5/0023-ppp-2.3.11-oedod.dif.patch
rename to patches/ppp-2.4.7/0014-ppp-2.3.11-oedod.patch
index 134feaa3d..ed160e882 100644
--- a/patches/ppp-2.4.5/0023-ppp-2.3.11-oedod.dif.patch
+++ b/patches/ppp-2.4.7/0014-ppp-2.3.11-oedod.patch
@@ -1,16 +1,16 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:27 +0100
-Subject: [PATCH] ppp-2.3.11-oedod.dif
+Date: Fri, 2 Jun 2017 11:16:31 +0200
+Subject: [PATCH] ppp-2.3.11-oedod
---
- pppd/demand.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
- pppd/ipcp.c | 2 +-
- pppd/ipv6cp.c | 2 +-
- pppd/pppd.h | 2 +-
+ pppd/demand.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ pppd/ipcp.c | 2 +-
+ pppd/ipv6cp.c | 2 +-
+ pppd/pppd.h | 2 +-
4 files changed, 101 insertions(+), 4 deletions(-)
diff --git a/pppd/demand.c b/pppd/demand.c
-index 5e57658..3eddf30 100644
+index 5e57658ea831..3eddf3016d98 100644
--- a/pppd/demand.c
+++ b/pppd/demand.c
@@ -36,6 +36,8 @@
@@ -151,10 +151,10 @@ index 5e57658..3eddf30 100644
free(pkt);
} else {
diff --git a/pppd/ipcp.c b/pppd/ipcp.c
-index 6af53d1..2149596 100644
+index c8fe279d4ede..dceca807542a 100644
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
-@@ -1875,7 +1875,7 @@ ipcp_up(f)
+@@ -1904,7 +1904,7 @@ ipcp_up(f)
proxy_arp_set[f->unit] = 1;
}
@@ -164,7 +164,7 @@ index 6af53d1..2149596 100644
} else {
diff --git a/pppd/ipv6cp.c b/pppd/ipv6cp.c
-index d01b778..678ce21 100644
+index 356ff84ead41..c1602f41c206 100644
--- a/pppd/ipv6cp.c
+++ b/pppd/ipv6cp.c
@@ -1232,7 +1232,7 @@ ipv6cp_up(f)
@@ -177,10 +177,10 @@ index d01b778..678ce21 100644
} else {
diff --git a/pppd/pppd.h b/pppd/pppd.h
-index af97671..97fece3 100644
+index 8ade4d817092..2121bc0aa588 100644
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
-@@ -564,7 +564,7 @@ void demand_conf __P((void)); /* config interface(s) for demand-dial */
+@@ -583,7 +583,7 @@ void demand_conf __P((void)); /* config interface(s) for demand-dial */
void demand_block __P((void)); /* set all NPs to queue up packets */
void demand_unblock __P((void)); /* set all NPs to pass packets */
void demand_discard __P((void)); /* set all NPs to discard packets */
diff --git a/patches/ppp-2.4.5/0025-radius_mtu.patch b/patches/ppp-2.4.7/0015-add-support-for-the-Framed-MTU-Radius-attribute.patch
similarity index 52%
rename from patches/ppp-2.4.5/0025-radius_mtu.patch
rename to patches/ppp-2.4.7/0015-add-support-for-the-Framed-MTU-Radius-attribute.patch
index 67f80fc7f..273d7e25a 100644
--- a/patches/ppp-2.4.5/0025-radius_mtu.patch
+++ b/patches/ppp-2.4.7/0015-add-support-for-the-Framed-MTU-Radius-attribute.patch
@@ -1,33 +1,20 @@
-From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:27 +0100
-Subject: [PATCH] radius_mtu
-
-add support for the Framed-MTU Radius attribute
+From: Alexander Klepikov <klepikov_a@up.ua>
+Date: Fri, 2 Jun 2017 11:21:27 +0200
+Subject: [PATCH] add support for the Framed-MTU Radius attribute
http://ppp.samba.org/cgi-bin/ppp-bugs/incoming?id=1532
-From: klepikov_a@up.ua
-To: ppp-bugs@ppp.samba.org
-Subject: Radius plugin does not set MTU on ppp interface
-Date: Mon, 22 Jan 2007 12:36:59 +0000 (GMT)
-
-Full_Name: Alexander Klepikov
-Version: 2.4.3
-OS: rhl 7.3 (2.4.20-28.7bigmem)
-Submission from: (NULL) (213.130.21.73)
-
-
This patch allows radius plugin to deal with Framed-MTU Radius attribute and to
set MTU on interface.
---
- pppd/plugins/radius/radius.c | 3 +++
+ pppd/plugins/radius/radius.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pppd/plugins/radius/radius.c b/pppd/plugins/radius/radius.c
-index edbc0b3..379f67f 100644
+index 4ba5f523ea07..06e00590b635 100644
--- a/pppd/plugins/radius/radius.c
+++ b/pppd/plugins/radius/radius.c
-@@ -657,6 +657,9 @@ radius_setparams(VALUE_PAIR *vp, char *msg, REQUEST_INFO *req_info,
+@@ -651,6 +651,9 @@ radius_setparams(VALUE_PAIR *vp, char *msg, REQUEST_INFO *req_info,
memcpy(rstate.class, vp->strvalue, rstate.class_len);
} /* else too big for our buffer - ignore it */
break;
diff --git a/patches/ppp-2.4.5/0026-018_ip-up_option.diff.patch b/patches/ppp-2.4.7/0016-ip-up_option.patch
similarity index 79%
rename from patches/ppp-2.4.5/0026-018_ip-up_option.diff.patch
rename to patches/ppp-2.4.7/0016-ip-up_option.patch
index 6cb1396fe..93ef02c5b 100644
--- a/patches/ppp-2.4.5/0026-018_ip-up_option.diff.patch
+++ b/patches/ppp-2.4.7/0016-ip-up_option.patch
@@ -1,19 +1,19 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:27 +0100
-Subject: [PATCH] 018_ip-up_option.diff
+Date: Fri, 2 Jun 2017 11:22:08 +0200
+Subject: [PATCH] ip-up_option
---
- pppd/ipcp.c | 8 ++++----
- pppd/main.c | 3 +++
- pppd/options.c | 9 +++++++++
- pppd/pppd.h | 2 ++
+ pppd/ipcp.c | 8 ++++----
+ pppd/main.c | 3 +++
+ pppd/options.c | 9 +++++++++
+ pppd/pppd.h | 2 ++
4 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/pppd/ipcp.c b/pppd/ipcp.c
-index 2149596..8509c6a 100644
+index dceca807542a..d6e0e2a699fe 100644
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
-@@ -1951,7 +1951,7 @@ ipcp_up(f)
+@@ -1984,7 +1984,7 @@ ipcp_up(f)
*/
if (ipcp_script_state == s_down && ipcp_script_pid == 0) {
ipcp_script_state = s_up;
@@ -22,7 +22,7 @@ index 2149596..8509c6a 100644
}
}
-@@ -2001,7 +2001,7 @@ ipcp_down(f)
+@@ -2034,7 +2034,7 @@ ipcp_down(f)
/* Execute the ip-down script */
if (ipcp_script_state == s_up && ipcp_script_pid == 0) {
ipcp_script_state = s_down;
@@ -31,7 +31,7 @@ index 2149596..8509c6a 100644
}
}
-@@ -2064,13 +2064,13 @@ ipcp_script_done(arg)
+@@ -2097,13 +2097,13 @@ ipcp_script_done(arg)
case s_up:
if (ipcp_fsm[0].state != OPENED) {
ipcp_script_state = s_down;
@@ -48,7 +48,7 @@ index 2149596..8509c6a 100644
break;
}
diff --git a/pppd/main.c b/pppd/main.c
-index 123a9d0..907f0b7 100644
+index 23d21d427df7..59aad6f3854f 100644
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -316,6 +316,9 @@ main(argc, argv)
@@ -62,10 +62,10 @@ index 123a9d0..907f0b7 100644
new_phase(PHASE_INITIALIZE);
diff --git a/pppd/options.c b/pppd/options.c
-index 482eab9..818e8b7 100644
+index f66b7657bc31..dc2d7329a93d 100644
--- a/pppd/options.c
+++ b/pppd/options.c
-@@ -113,6 +113,8 @@ char linkname[MAXPATHLEN]; /* logical name for link */
+@@ -114,6 +114,8 @@ char linkname[MAXPATHLEN]; /* logical name for link */
bool tune_kernel; /* may alter kernel settings */
int connect_delay = 1000; /* wait this many ms after connect script */
int req_unit = -1; /* requested interface unit */
@@ -74,9 +74,9 @@ index 482eab9..818e8b7 100644
bool multilink = 0; /* Enable multilink operation */
char *bundle_name = NULL; /* bundle name for multilink */
bool dump_options; /* print out option values */
-@@ -281,6 +283,13 @@ option_t general_options[] = {
- "Number of seconds to wait for child processes at exit",
- OPT_PRIO },
+@@ -299,6 +301,13 @@ option_t general_options[] = {
+ "Unset user environment variable",
+ OPT_A2PRINTER | OPT_NOPRINT, (void *)user_unsetprint },
+ { "ip-up-script", o_string, path_ipup,
+ "Set pathname of ip-up script",
@@ -89,10 +89,10 @@ index 482eab9..818e8b7 100644
{ "multilink", o_bool, &multilink,
"Enable multilink operation", OPT_PRIO | 1 },
diff --git a/pppd/pppd.h b/pppd/pppd.h
-index 97fece3..1d9f85a 100644
+index 2121bc0aa588..2be649adf582 100644
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
-@@ -313,6 +313,8 @@ extern bool tune_kernel; /* May alter kernel settings as necessary */
+@@ -318,6 +318,8 @@ extern bool tune_kernel; /* May alter kernel settings as necessary */
extern int connect_delay; /* Time to delay after connect script */
extern int max_data_rate; /* max bytes/sec through charshunt */
extern int req_unit; /* interface unit number to use */
diff --git a/patches/ppp-2.4.5/0027-ppp-2.4.2-stripMSdomain.patch b/patches/ppp-2.4.7/0017-ppp-2.4.2-stripMSdomain.patch
similarity index 91%
rename from patches/ppp-2.4.5/0027-ppp-2.4.2-stripMSdomain.patch
rename to patches/ppp-2.4.7/0017-ppp-2.4.2-stripMSdomain.patch
index b0413f81b..5ac426e19 100644
--- a/patches/ppp-2.4.5/0027-ppp-2.4.2-stripMSdomain.patch
+++ b/patches/ppp-2.4.7/0017-ppp-2.4.2-stripMSdomain.patch
@@ -1,13 +1,13 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:27 +0100
+Date: Fri, 2 Jun 2017 11:22:53 +0200
Subject: [PATCH] ppp-2.4.2-stripMSdomain
---
- pppd/chap-new.c | 11 +++++++++++
+ pppd/chap-new.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/pppd/chap-new.c b/pppd/chap-new.c
-index 1386486..80c644b 100644
+index 2714bff64785..7fd7087a5e2c 100644
--- a/pppd/chap-new.c
+++ b/pppd/chap-new.c
@@ -58,6 +58,7 @@ int (*chap_verify_hook)(char *name, char *ourname, int id,
diff --git a/patches/ppp-2.4.5/0028-setenv_call_file.patch b/patches/ppp-2.4.7/0018-export-CALL_FILE-to-the-link-scripts.patch
similarity index 65%
rename from patches/ppp-2.4.5/0028-setenv_call_file.patch
rename to patches/ppp-2.4.7/0018-export-CALL_FILE-to-the-link-scripts.patch
index e7191ace4..6bce58107 100644
--- a/patches/ppp-2.4.5/0028-setenv_call_file.patch
+++ b/patches/ppp-2.4.7/0018-export-CALL_FILE-to-the-link-scripts.patch
@@ -1,18 +1,17 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:27 +0100
-Subject: [PATCH] setenv_call_file
+Date: Fri, 2 Jun 2017 11:23:29 +0200
+Subject: [PATCH] export $CALL_FILE to the link scripts
-export $CALL_FILE to the link scripts
---
- pppd/options.c | 1 +
- pppd/pppd.8 | 3 +++
+ pppd/options.c | 1 +
+ pppd/pppd.8 | 3 +++
2 files changed, 4 insertions(+)
diff --git a/pppd/options.c b/pppd/options.c
-index 818e8b7..a42cb94 100644
+index dc2d7329a93d..2de65f9aa8d5 100644
--- a/pppd/options.c
+++ b/pppd/options.c
-@@ -1456,6 +1456,7 @@ callfile(argv)
+@@ -1477,6 +1477,7 @@ callfile(argv)
if ((fname = (char *) malloc(l)) == NULL)
novm("call file name");
slprintf(fname, l, "%s%s", _PATH_PEERFILES, arg);
@@ -21,10 +20,10 @@ index 818e8b7..a42cb94 100644
ok = options_from_file(fname, 1, 1, 1);
diff --git a/pppd/pppd.8 b/pppd/pppd.8
-index 7d49321..8b0602a 100644
+index 67181083808b..f6c9e909254c 100644
--- a/pppd/pppd.8
+++ b/pppd/pppd.8
-@@ -1632,6 +1632,9 @@ the connection.
+@@ -1656,6 +1656,9 @@ the connection.
.B LINKNAME
The logical name of the link, set with the \fIlinkname\fR option.
.TP
@@ -33,4 +32,4 @@ index 7d49321..8b0602a 100644
+.TP
.B DNS1
If the peer supplies DNS server addresses, this variable is set to the
- first DNS server address supplied.
+ first DNS server address supplied (whether or not the usepeerdns
diff --git a/patches/ppp-2.4.7/0019-ipv6-accept-remote.patch b/patches/ppp-2.4.7/0019-ipv6-accept-remote.patch
new file mode 100644
index 000000000..e83406d3b
--- /dev/null
+++ b/patches/ppp-2.4.7/0019-ipv6-accept-remote.patch
@@ -0,0 +1,70 @@
+From: Marco d'Itri <md@linux.it>
+Date: Fri, 2 Jun 2017 11:24:22 +0200
+Subject: [PATCH] ipv6-accept-remote
+
+---
+ pppd/ipv6cp.c | 5 ++++-
+ pppd/ipv6cp.h | 3 ++-
+ pppd/pppd.8 | 5 +++++
+ 3 files changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/pppd/ipv6cp.c b/pppd/ipv6cp.c
+index c1602f41c206..432170462196 100644
+--- a/pppd/ipv6cp.c
++++ b/pppd/ipv6cp.c
+@@ -245,6 +245,8 @@ static option_t ipv6cp_option_list[] = {
+
+ { "ipv6cp-accept-local", o_bool, &ipv6cp_allowoptions[0].accept_local,
+ "Accept peer's interface identifier for us", 1 },
++ { "ipv6cp-accept-remote", o_bool, &ipv6cp_allowoptions[0].accept_remote,
++ "Accept peer's interface identifier for itself", 1 },
+
+ { "ipv6cp-use-ipaddr", o_bool, &ipv6cp_allowoptions[0].use_ip,
+ "Use (default) IPv4 address as interface identifier", 1 },
+@@ -435,6 +437,7 @@ ipv6cp_init(unit)
+ memset(ao, 0, sizeof(*ao));
+
+ wo->accept_local = 1;
++ wo->accept_remote = 1;
+ wo->neg_ifaceid = 1;
+ ao->neg_ifaceid = 1;
+
+@@ -960,7 +963,7 @@ ipv6cp_reqci(f, inp, len, reject_if_disagree)
+ orc = CONFREJ; /* Reject CI */
+ break;
+ }
+- if (!eui64_iszero(wo->hisid) &&
++ if (!eui64_iszero(wo->hisid) && !wo->accept_remote &&
+ !eui64_equals(ifaceid, wo->hisid) &&
+ eui64_iszero(go->hisid)) {
+
+diff --git a/pppd/ipv6cp.h b/pppd/ipv6cp.h
+index 2f4c06ddc189..1617707ebbde 100644
+--- a/pppd/ipv6cp.h
++++ b/pppd/ipv6cp.h
+@@ -150,7 +150,8 @@
+ typedef struct ipv6cp_options {
+ int neg_ifaceid; /* Negotiate interface identifier? */
+ int req_ifaceid; /* Ask peer to send interface identifier? */
+- int accept_local; /* accept peer's value for iface id? */
++ int accept_local; /* accept peer's value for our iface id? */
++ int accept_remote; /* accept peer's value for his iface id? */
+ int opt_local; /* ourtoken set by option */
+ int opt_remote; /* histoken set by option */
+ int use_ip; /* use IP as interface identifier */
+diff --git a/pppd/pppd.8 b/pppd/pppd.8
+index f6c9e909254c..f226392c0280 100644
+--- a/pppd/pppd.8
++++ b/pppd/pppd.8
+@@ -463,6 +463,11 @@ With this option, pppd will accept the peer's idea of our local IPv6
+ interface identifier, even if the local IPv6 interface identifier
+ was specified in an option.
+ .TP
++.B ipv6cp\-accept\-remote
++With this option, pppd will accept the peer's idea of its (remote)
++IPv6 interface identifier, even if the remote IPv6 interface
++identifier was specified in an option.
++.TP
+ .B ipv6cp\-max\-configure \fIn
+ Set the maximum number of IPv6CP configure-request transmissions to
+ \fIn\fR (default 10).
diff --git a/patches/ppp-2.4.7/0020-allow-use-of-arbitrary-interface-names.patch b/patches/ppp-2.4.7/0020-allow-use-of-arbitrary-interface-names.patch
new file mode 100644
index 000000000..3fb234038
--- /dev/null
+++ b/patches/ppp-2.4.7/0020-allow-use-of-arbitrary-interface-names.patch
@@ -0,0 +1,210 @@
+From: Marco d'Itri <md@linux.it>
+Date: Fri, 2 Jun 2017 11:25:19 +0200
+Subject: [PATCH] allow use of arbitrary interface names
+
+This is a modified version of a patch from openSUSE that enables PPP interfaces
+to be called arbitrary names, rather than simply pppX where X is the unit
+number.
+
+The modifications from the stock openSUSE patch are:
+- refresh patch on top of 018_ip-up_option.diff
+- fix a printf format-string vulnerability in pppd/main.c:set_ifunit()
+- clarify the pppd.8 manpage additions
+- patch pppstats/pppstats.c to query renamed interfaces without complaint
+
+Origin: vendor, https://build.opensuse.org/source/network/ppp/ppp-2.4.2-ifname.diff?rev=7a0fdeff0b29437dd7f4581c95c7255a
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=458646
+Forwarded: no
+Reviewed-by: Chris Boot <bootc@debian.org>
+Last-Update: 2014-01-12
+---
+ pppd/main.c | 16 ++++++----------
+ pppd/options.c | 5 +++++
+ pppd/pppd.8 | 8 +++++++-
+ pppd/pppd.h | 11 +++++++++++
+ pppd/sys-linux.c | 15 +++++++++++++++
+ pppstats/pppstats.c | 12 ++++++------
+ 6 files changed, 50 insertions(+), 17 deletions(-)
+
+diff --git a/pppd/main.c b/pppd/main.c
+index 59aad6f3854f..3871aa2b3a5e 100644
+--- a/pppd/main.c
++++ b/pppd/main.c
+@@ -124,7 +124,7 @@
+ static const char rcsid[] = RCSID;
+
+ /* interface vars */
+-char ifname[32]; /* Interface name */
++char ifname[MAXIFNAMELEN]; /* Interface name */
+ int ifunit; /* Interface unit number */
+
+ struct channel *the_channel;
+@@ -298,13 +298,6 @@ struct protent *protocols[] = {
+ NULL
+ };
+
+-/*
+- * If PPP_DRV_NAME is not defined, use the default "ppp" as the device name.
+- */
+-#if !defined(PPP_DRV_NAME)
+-#define PPP_DRV_NAME "ppp"
+-#endif /* !defined(PPP_DRV_NAME) */
+-
+ int
+ main(argc, argv)
+ int argc;
+@@ -740,8 +733,11 @@ void
+ set_ifunit(iskey)
+ int iskey;
+ {
+- info("Using interface %s%d", PPP_DRV_NAME, ifunit);
+- slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
++ if (req_ifname[0] != '\0')
++ slprintf(ifname, sizeof(ifname), "%s", req_ifname);
++ else
++ slprintf(ifname, sizeof(ifname), "%s%d", PPP_DRV_NAME, ifunit);
++ info("Using interface %s", ifname);
+ script_setenv("IFNAME", ifname, iskey);
+ if (iskey) {
+ create_pidfile(getpid()); /* write pid to file */
+diff --git a/pppd/options.c b/pppd/options.c
+index 2de65f9aa8d5..340797386dd6 100644
+--- a/pppd/options.c
++++ b/pppd/options.c
+@@ -116,6 +116,7 @@ int connect_delay = 1000; /* wait this many ms after connect script */
+ int req_unit = -1; /* requested interface unit */
+ char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
+ char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
++char req_ifname[MAXIFNAMELEN]; /* requested interface name */
+ bool multilink = 0; /* Enable multilink operation */
+ char *bundle_name = NULL; /* bundle name for multilink */
+ bool dump_options; /* print out option values */
+@@ -285,6 +286,10 @@ option_t general_options[] = {
+ "PPP interface unit number to use if possible",
+ OPT_PRIO | OPT_LLIMIT, 0, 0 },
+
++ { "ifname", o_string, req_ifname,
++ "Set PPP interface name",
++ OPT_PRIO | OPT_PRIV | OPT_STATIC, NULL, MAXIFNAMELEN },
++
+ { "dump", o_bool, &dump_options,
+ "Print out option values after parsing all options", 1 },
+ { "dryrun", o_bool, &dryrun,
+diff --git a/pppd/pppd.8 b/pppd/pppd.8
+index f226392c0280..65bbe721f761 100644
+--- a/pppd/pppd.8
++++ b/pppd/pppd.8
+@@ -1093,7 +1093,13 @@ under Linux and FreeBSD 2.2.8 and later.
+ .TP
+ .B unit \fInum
+ Sets the ppp unit number (for a ppp0 or ppp1 etc interface name) for outbound
+-connections.
++connections. If the unit is already in use a dynamically allocated number will
++be used.
++.TP
++.B ifname \fIstring
++Set the ppp interface name for outbound connections. If the interface name is
++already in use, or if the name cannot be used for any other reason, pppd will
++terminate.
+ .TP
+ .B unset \fIname
+ Remove a variable from the environment variable for scripts that are
+diff --git a/pppd/pppd.h b/pppd/pppd.h
+index 2be649adf582..b11670586244 100644
+--- a/pppd/pppd.h
++++ b/pppd/pppd.h
+@@ -80,6 +80,16 @@
+ #define MAXARGS 1 /* max # args to a command */
+ #define MAXNAMELEN 256 /* max length of hostname or name for auth */
+ #define MAXSECRETLEN 256 /* max length of password or secret */
++#define MAXIFNAMELEN 32 /* max length of interface name; or use IFNAMSIZ, can we
++ always include net/if.h? */
++
++/*
++ * If PPP_DRV_NAME is not defined, use the default "ppp" as the device name.
++ * Where should PPP_DRV_NAME come from? Do we include it here?
++ */
++#if !defined(PPP_DRV_NAME)
++#define PPP_DRV_NAME "ppp"
++#endif /* !defined(PPP_DRV_NAME) */
+
+ /*
+ * Option descriptor structure.
+@@ -320,6 +330,7 @@ extern int max_data_rate; /* max bytes/sec through charshunt */
+ extern int req_unit; /* interface unit number to use */
+ extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
+ extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
++extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
+ extern bool multilink; /* enable multilink operation */
+ extern bool noendpoint; /* don't send or accept endpt. discrim. */
+ extern char *bundle_name; /* bundle name for multilink */
+diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
+index 86cde57664af..878f83bdfe3b 100644
+--- a/pppd/sys-linux.c
++++ b/pppd/sys-linux.c
+@@ -650,6 +650,21 @@ static int make_ppp_unit()
+ }
+ if (x < 0)
+ error("Couldn't create new ppp unit: %m");
++
++ if (x == 0 && req_ifname[0] != '\0') {
++ struct ifreq ifr;
++ char t[MAXIFNAMELEN];
++ memset(&ifr, 0, sizeof(struct ifreq));
++ slprintf(t, sizeof(t), "%s%d", PPP_DRV_NAME, ifunit);
++ strncpy(ifr.ifr_name, t, IF_NAMESIZE);
++ strncpy(ifr.ifr_newname, req_ifname, IF_NAMESIZE);
++ x = ioctl(sock_fd, SIOCSIFNAME, &ifr);
++ if (x < 0)
++ error("Couldn't rename interface %s to %s: %m", t, req_ifname);
++ else
++ info("Renamed interface %s to %s", t, req_ifname);
++ }
++
+ return x;
+ }
+
+diff --git a/pppstats/pppstats.c b/pppstats/pppstats.c
+index 6367988eb96b..46cb9c24942b 100644
+--- a/pppstats/pppstats.c
++++ b/pppstats/pppstats.c
+@@ -88,7 +88,6 @@ int aflag; /* print absolute values, not deltas */
+ int dflag; /* print data rates, not bytes */
+ int interval, count;
+ int infinite;
+-int unit;
+ int s; /* socket or /dev/ppp file descriptor */
+ int signalled; /* set if alarm goes off "early" */
+ char *progname;
+@@ -449,6 +448,7 @@ main(argc, argv)
+ {
+ int c;
+ #ifdef STREAMS
++ int unit;
+ char *dev;
+ #endif
+
+@@ -506,11 +506,6 @@ main(argc, argv)
+ if (argc > 0)
+ interface = argv[0];
+
+- if (sscanf(interface, PPP_DRV_NAME "%d", &unit) != 1) {
+- fprintf(stderr, "%s: invalid interface '%s' specified\n",
+- progname, interface);
+- }
+-
+ #ifndef STREAMS
+ {
+ struct ifreq ifr;
+@@ -535,6 +530,11 @@ main(argc, argv)
+ }
+
+ #else /* STREAMS */
++ if (sscanf(interface, PPP_DRV_NAME "%d", &unit) != 1) {
++ fprintf(stderr, "%s: invalid interface '%s' specified\n",
++ progname, interface);
++ }
++
+ #ifdef __osf__
+ dev = "/dev/streams/ppp";
+ #else
diff --git a/patches/ppp-2.4.7/0021-fix-a-potential-buffer-overflow-in-clientid.c-rc_map.patch b/patches/ppp-2.4.7/0021-fix-a-potential-buffer-overflow-in-clientid.c-rc_map.patch
new file mode 100644
index 000000000..31edc06cb
--- /dev/null
+++ b/patches/ppp-2.4.7/0021-fix-a-potential-buffer-overflow-in-clientid.c-rc_map.patch
@@ -0,0 +1,38 @@
+From: Marco d'Itri <md@linux.it>
+Date: Fri, 2 Jun 2017 11:25:56 +0200
+Subject: [PATCH] fix a potential buffer overflow in clientid.c:rc_map2id()
+
+This fixes the following compile-time warning when building with
+-D_FORTIFY_SOURCE=2:
+
+In file included from /usr/include/string.h:638:0,
+ from ./includes.h:26,
+ from clientid.c:12:
+In function 'strncat',
+ inlined from 'rc_map2id' at clientid.c:113:9:
+/usr/include/i386-linux-gnu/bits/string3.h:150:3: warning: call to
+__builtin___strncat_chk might overflow destination buffer [enabled by default]
+ return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
+ ^
+
+Origin: vendor, https://build.opensuse.org/source/network/ppp/ppp-2.4.4-strncatfix.patch?rev=7a0fdeff0b29437dd7f4581c95c7255a
+Forwarded: no
+Reviewed-by: Chris Boot <bootc@debian.org>
+Last-Update: 2014-01-12
+---
+ pppd/plugins/radius/clientid.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pppd/plugins/radius/clientid.c b/pppd/plugins/radius/clientid.c
+index d49579c43cc3..7de021139b56 100644
+--- a/pppd/plugins/radius/clientid.c
++++ b/pppd/plugins/radius/clientid.c
+@@ -110,7 +110,7 @@ UINT4 rc_map2id(char *name)
+ if (*name != '/')
+ strcpy(ttyname, "/dev/");
+
+- strncat(ttyname, name, sizeof(ttyname));
++ strncat(ttyname, name, sizeof(ttyname)-strlen(ttyname)-1);
+
+ for(p = map2id_list; p; p = p->next)
+ if (!strcmp(ttyname, p->name)) return p->id;
diff --git a/patches/ppp-2.4.5/0029-010_scripts_README.diff.patch b/patches/ppp-2.4.7/0022-scripts-README.patch
similarity index 87%
rename from patches/ppp-2.4.5/0029-010_scripts_README.diff.patch
rename to patches/ppp-2.4.7/0022-scripts-README.patch
index cba062f80..f786cc81d 100644
--- a/patches/ppp-2.4.5/0029-010_scripts_README.diff.patch
+++ b/patches/ppp-2.4.7/0022-scripts-README.patch
@@ -1,13 +1,13 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:27 +0100
-Subject: [PATCH] 010_scripts_README.diff
+Date: Fri, 2 Jun 2017 11:26:37 +0200
+Subject: [PATCH] scripts README
---
- scripts/README | 14 ++++++++++++++
+ scripts/README | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/scripts/README b/scripts/README
-index 00e032c..439c900 100644
+index 00e032ca6ad4..439c900d657a 100644
--- a/scripts/README
+++ b/scripts/README
@@ -141,3 +141,17 @@ option. In addition, all ASCII control characters [0x00 to 0x1f], plus 0xff,
diff --git a/patches/ppp-2.4.7/0023-no_crypt_hack.patch b/patches/ppp-2.4.7/0023-no_crypt_hack.patch
new file mode 100644
index 000000000..5e8d51bbf
--- /dev/null
+++ b/patches/ppp-2.4.7/0023-no_crypt_hack.patch
@@ -0,0 +1,61 @@
+From: Marco d'Itri <md@linux.it>
+Date: Fri, 2 Jun 2017 11:27:15 +0200
+Subject: [PATCH] no_crypt_hack
+
+The udeb package does not have crypt(3). This patch makes
+authentication always fail, since it is not needed anyway for dialout.
+---
+ pppd/Makefile.linux | 4 ++++
+ pppd/auth.c | 2 ++
+ pppd/session.c | 2 ++
+ 3 files changed, 8 insertions(+)
+
+diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
+index 16b3ee879791..a8694fccd85e 100644
+--- a/pppd/Makefile.linux
++++ b/pppd/Makefile.linux
+@@ -121,10 +121,14 @@ CFLAGS += -DHAS_SHADOW
+ #LIBS += -lshadow $(LIBS)
+ endif
+
++ifdef NO_CRYPT_HACK
++CFLAGS += -DNO_CRYPT_HACK
++else
+ ifneq ($(wildcard /usr/include/crypt.h),)
+ CFLAGS += -DHAVE_CRYPT_H=1
+ LIBS += -lcrypt
+ endif
++endif
+
+ ifdef USE_LIBUTIL
+ CFLAGS += -DHAVE_LOGWTMP=1
+diff --git a/pppd/auth.c b/pppd/auth.c
+index 4271af687102..931c6b45043b 100644
+--- a/pppd/auth.c
++++ b/pppd/auth.c
+@@ -1442,8 +1442,10 @@ check_passwd(unit, auser, userlen, apasswd, passwdlen, msg)
+ if (secret[0] != 0 && !login_secret) {
+ /* password given in pap-secrets - must match */
+ if (cryptpap || strcmp(passwd, secret) != 0) {
++#ifndef NO_CRYPT_HACK
+ char *cbuf = crypt(passwd, secret);
+ if (!cbuf || strcmp(cbuf, secret) != 0)
++#endif
+ ret = UPAP_AUTHNAK;
+ }
+ }
+diff --git a/pppd/session.c b/pppd/session.c
+index 56385dd63874..977139665218 100644
+--- a/pppd/session.c
++++ b/pppd/session.c
+@@ -351,8 +351,10 @@ session_start(flags, user, passwd, ttyName, msg)
+ */
+ if (pw->pw_passwd == NULL || strlen(pw->pw_passwd) < 2)
+ return SESSION_FAILED;
++#ifndef NO_CRYPT_HACK
+ cbuf = crypt(passwd, pw->pw_passwd);
+ if (!cbuf || strcmp(cbuf, pw->pw_passwd) != 0)
++#endif
+ return SESSION_FAILED;
+ }
+
diff --git a/patches/ppp-2.4.5/0031-resolv.conf_no_log.patch b/patches/ppp-2.4.7/0024-resolv.conf_no_log.patch
similarity index 71%
rename from patches/ppp-2.4.5/0031-resolv.conf_no_log.patch
rename to patches/ppp-2.4.7/0024-resolv.conf_no_log.patch
index ceea048cc..ebdcc2d12 100644
--- a/patches/ppp-2.4.5/0031-resolv.conf_no_log.patch
+++ b/patches/ppp-2.4.7/0024-resolv.conf_no_log.patch
@@ -1,16 +1,16 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:27 +0100
+Date: Fri, 2 Jun 2017 11:27:40 +0200
Subject: [PATCH] resolv.conf_no_log
---
- pppd/ipcp.c | 2 +-
+ pppd/ipcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pppd/ipcp.c b/pppd/ipcp.c
-index 8509c6a..d36078c 100644
+index d6e0e2a699fe..b81b2fd0a29f 100644
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
-@@ -2119,7 +2119,7 @@ create_resolv(peerdns1, peerdns2)
+@@ -2152,7 +2152,7 @@ create_resolv(peerdns1, peerdns2)
f = fopen(_PATH_RESOLV, "w");
if (f == NULL) {
diff --git a/patches/ppp-2.4.5/0032-zzz_config.patch b/patches/ppp-2.4.7/0025-Debian-specific-changes.patch
similarity index 66%
rename from patches/ppp-2.4.5/0032-zzz_config.patch
rename to patches/ppp-2.4.7/0025-Debian-specific-changes.patch
index 3ebc312f3..fcbba6357 100644
--- a/patches/ppp-2.4.5/0032-zzz_config.patch
+++ b/patches/ppp-2.4.7/0025-Debian-specific-changes.patch
@@ -1,36 +1,25 @@
From: Marco d'Itri <md@linux.it>
-Date: Wed, 25 Jan 2012 19:14:27 +0100
-Subject: [PATCH] zzz_config
+Date: Fri, 2 Jun 2017 11:28:30 +0200
+Subject: [PATCH] Debian-specific changes.
-Debian-specific changes.
---
- pppd/Makefile.linux | 10 ++++------
- pppd/pathnames.h | 2 +-
- pppd/pppd.h | 2 +-
- pppdump/Makefile.linux | 4 ++--
- 4 files changed, 8 insertions(+), 10 deletions(-)
+ pppd/Makefile.linux | 6 ++----
+ pppd/pathnames.h | 2 +-
+ pppd/pppd.h | 2 +-
+ pppdump/Makefile.linux | 4 ++--
+ 4 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
-index c001679..652fb6e 100644
+index a8694fccd85e..a90cbdcf8bb1 100644
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
-@@ -33,7 +33,7 @@ endif
- # CC = gcc
- #
- CFLAGS = -O2 -g
--LIBS =
-+LIBS = -lutil
-
- # Uncomment the next 2 lines to include support for Microsoft's
- # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux.
@@ -61,14 +61,14 @@ HAVE_MULTILINK=y
USE_TDB=y
HAS_SHADOW=y
-#USE_PAM=y
--#HAVE_INET6=y
+USE_PAM=y
-+HAVE_INET6=y
+ HAVE_INET6=y
# Enable plugins
PLUGIN=y
@@ -41,20 +30,20 @@ index c001679..652fb6e 100644
# Enable EAP SRP-SHA1 authentication (requires libsrp)
#USE_SRP=y
-@@ -172,11 +172,9 @@ LIBS += -ldl
+@@ -182,11 +182,9 @@ LIBS += -ldl
endif
ifdef FILTER
-ifneq ($(wildcard /usr/include/pcap-bpf.h),)
LIBS += -lpcap
- COMPILE_FLAGS += -DPPP_FILTER
+ CFLAGS += -DPPP_FILTER
endif
-endif
ifdef HAVE_INET6
PPPDSRCS += ipv6cp.c eui64.c
diff --git a/pppd/pathnames.h b/pppd/pathnames.h
-index a33f046..4697260 100644
+index a33f0466c9d6..46972601fc92 100644
--- a/pppd/pathnames.h
+++ b/pppd/pathnames.h
@@ -28,7 +28,7 @@
@@ -67,10 +56,10 @@ index a33f046..4697260 100644
#define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf"
diff --git a/pppd/pppd.h b/pppd/pppd.h
-index 1d9f85a..0e61203 100644
+index b11670586244..567d702181ca 100644
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
-@@ -833,7 +833,7 @@ extern void (*snoop_send_hook) __P((unsigned char *p, int len));
+@@ -870,7 +870,7 @@ extern void (*snoop_send_hook) __P((unsigned char *p, int len));
|| defined(DEBUGCHAP) || defined(DEBUG) || defined(DEBUGIPV6CP)
#define LOG_PPP LOG_LOCAL2
#else
@@ -80,7 +69,7 @@ index 1d9f85a..0e61203 100644
#endif /* LOG_PPP */
diff --git a/pppdump/Makefile.linux b/pppdump/Makefile.linux
-index 158ed1a..fc6091c 100644
+index 87777fab5e94..1eeeafe20111 100644
--- a/pppdump/Makefile.linux
+++ b/pppdump/Makefile.linux
@@ -2,9 +2,9 @@ DESTDIR = $(INSTROOT)@DESTDIR@
@@ -93,5 +82,5 @@ index 158ed1a..fc6091c 100644
-HAVE_ZLIB=n
+HAVE_ZLIB=y
- CFLAGS=-O2 -g
- COPTS= -I../include/net
+ COPTS=-O2 -g
+ CFLAGS= $(COPTS) -I../include/net
diff --git a/patches/ppp-2.4.7/0026-secure-card-interpreter-fix.patch b/patches/ppp-2.4.7/0026-secure-card-interpreter-fix.patch
new file mode 100644
index 000000000..fb54a5e9d
--- /dev/null
+++ b/patches/ppp-2.4.7/0026-secure-card-interpreter-fix.patch
@@ -0,0 +1,26 @@
+From: Marco d'Itri <md@linux.it>
+Date: Fri, 2 Jun 2017 11:29:20 +0200
+Subject: [PATCH] secure-card-interpreter-fix
+
+This fixes the lintian warning:
+I: ppp: example-wrong-path-for-interpreter
+ usr/share/doc/ppp/examples/scripts/secure-card
+ (#!/usr/local/bin/expect != /usr/bin/expect)
+
+Author: Chris Boot <bootc@debian.org>
+Forwarded: not-needed
+Last-Update: 2013-09-09
+---
+ scripts/secure-card | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/secure-card b/scripts/secure-card
+index 0002365e4edb..ae3ae50c14f4 100755
+--- a/scripts/secure-card
++++ b/scripts/secure-card
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/expect -f
++#!/usr/bin/expect -f
+ #
+ # This script was written by Jim Isaacson <jcisaac@crl.com>. It is
+ # designed to work as a script to use the SecureCARD(tm) device. This
diff --git a/patches/ppp-2.4.7/0027-Fix-buffer-overflow-in-rc_mksid.patch b/patches/ppp-2.4.7/0027-Fix-buffer-overflow-in-rc_mksid.patch
new file mode 100644
index 000000000..29a6ea1d6
--- /dev/null
+++ b/patches/ppp-2.4.7/0027-Fix-buffer-overflow-in-rc_mksid.patch
@@ -0,0 +1,30 @@
+From: Emanuele Rocca <ema@debian.org>
+Date: Fri, 2 Jun 2017 11:30:48 +0200
+Subject: [PATCH] Fix buffer overflow in rc_mksid()
+
+rc_mksid converts the PID of pppd to hex to generate a pseudo-unique string.
+
+If the process id is bigger than 65535 (FFFF), its hex representation will be
+longer than 4 characters, resulting in a buffer overflow.
+
+The bug can be exploited to cause a remote DoS.
+
+Bug-Debian: https://bugs.debian.org/782450
+Last-Update: <2015-04-14>
+---
+ pppd/plugins/radius/util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pppd/plugins/radius/util.c b/pppd/plugins/radius/util.c
+index 6f976a712951..166bd5f31d7a 100644
+--- a/pppd/plugins/radius/util.c
++++ b/pppd/plugins/radius/util.c
+@@ -77,7 +77,7 @@ rc_mksid (void)
+ static unsigned short int cnt = 0;
+ sprintf (buf, "%08lX%04X%02hX",
+ (unsigned long int) time (NULL),
+- (unsigned int) getpid (),
++ (unsigned int) getpid () % 65535,
+ cnt & 0xFF);
+ cnt++;
+ return buf;
diff --git a/patches/ppp-2.4.7/0028-Add-a-SONAME-to-the-pppd-binary.patch b/patches/ppp-2.4.7/0028-Add-a-SONAME-to-the-pppd-binary.patch
new file mode 100644
index 000000000..df533456a
--- /dev/null
+++ b/patches/ppp-2.4.7/0028-Add-a-SONAME-to-the-pppd-binary.patch
@@ -0,0 +1,38 @@
+From: Chris Boot <bootc@debian.org>
+Date: Fri, 2 Jun 2017 11:31:35 +0200
+Subject: [PATCH] Add a SONAME to the pppd binary
+
+ This hack inserts a SONAME into the pppd binary, which allows us to
+ run dpkg-gensymbols/dh_makeshlibs over the resulting binary. This is
+ useful so that we can use Debian's standard build infrastructure to
+ help track the ppp binary's ABI, which is used by plugins.
+
+Forwarded: not-needed
+Last-Update: 2015-12-05
+---
+ pppd/Makefile.linux | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
+index a90cbdcf8bb1..f1b2c90bb510 100644
+--- a/pppd/Makefile.linux
++++ b/pppd/Makefile.linux
+@@ -206,6 +206,8 @@ endif
+
+ INSTALL= install
+
++VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' patchlevel.h)
++
+ all: $(TARGETS)
+
+ install: pppd
+@@ -217,7 +219,8 @@ install: pppd
+ $(INSTALL) -c -m 444 pppd.8 $(MANDIR)
+
+ pppd: $(PPPDOBJS)
+- $(CC) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS)
++ $(CC) $(LDFLAGS) -o pppd $(PPPDOBJS) $(LIBS) \
++ -Wl,-soname,pppd.so.$(VERSION)
+
+ srp-entry: srp-entry.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
diff --git a/patches/ppp-2.4.7/0029-Fix-FTBFS-in-rp-pppoe.patch b/patches/ppp-2.4.7/0029-Fix-FTBFS-in-rp-pppoe.patch
new file mode 100644
index 000000000..9a9d34760
--- /dev/null
+++ b/patches/ppp-2.4.7/0029-Fix-FTBFS-in-rp-pppoe.patch
@@ -0,0 +1,36 @@
+From: Chris Boot <bootc@debian.org>
+Date: Fri, 2 Jun 2017 11:32:22 +0200
+Subject: [PATCH] Fix FTBFS in rp-pppoe
+
+ Include netinet/in.h earlier to avoid a conflict with linux/in.h. See Bug
+ #824442 (on src:glibc) for information related to this.
+
+Bug-Debian: https://bugs.debian.org/824442
+Forwarded: no
+Last-Update: 2016-11-11
+---
+ pppd/plugins/rp-pppoe/pppoe.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
+index 86d2b1e47a25..fee9ab62ee21 100644
+--- a/pppd/plugins/rp-pppoe/pppoe.h
++++ b/pppd/plugins/rp-pppoe/pppoe.h
+@@ -49,6 +49,8 @@
+ #include <sys/socket.h>
+ #endif
+
++#include <netinet/in.h>
++
+ /* Ugly header files on some Linux boxes... */
+ #if defined(HAVE_LINUX_IF_H)
+ #include <linux/if.h>
+@@ -86,8 +88,6 @@ typedef unsigned long UINT32_t;
+ #include <linux/if_ether.h>
+ #endif
+
+-#include <netinet/in.h>
+-
+ #ifdef HAVE_NETINET_IF_ETHER_H
+ #include <sys/types.h>
+
diff --git a/patches/ppp-2.4.5/0033-pppd-make-makefile-sysroot-aware.patch b/patches/ppp-2.4.7/0030-pppd-make-makefile-sysroot-aware.patch
similarity index 70%
rename from patches/ppp-2.4.5/0033-pppd-make-makefile-sysroot-aware.patch
rename to patches/ppp-2.4.7/0030-pppd-make-makefile-sysroot-aware.patch
index a020493b2..098b526c6 100644
--- a/patches/ppp-2.4.5/0033-pppd-make-makefile-sysroot-aware.patch
+++ b/patches/ppp-2.4.7/0030-pppd-make-makefile-sysroot-aware.patch
@@ -7,31 +7,32 @@ occurrences of absolute paths by their corresponding SYSROOT relative
ones.
Signed-off-by: Marc Kleine-Budde <m.kleine-budde@pengutronix.de>
+Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
- pppd/Makefile.linux | 6 +++---
+ pppd/Makefile.linux | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
-index 652fb6e..b713841 100644
+index f1b2c90bb510..8b88f2b4811d 100644
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
-@@ -95,8 +95,8 @@ endif
+@@ -100,8 +100,8 @@ endif
+
# EAP SRP-SHA1
ifdef USE_SRP
- COMPILE_FLAGS += -DUSE_SRP -DOPENSSL
--INCLUDE_DIRS += -I/usr/local/ssl/include
+-CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
-LIBS += -lsrp -L/usr/local/ssl/lib -lcrypto
-+INCLUDE_DIRS += -I$(SYSROOT)/usr/local/ssl/include
++CFLAGS += -DUSE_SRP -DOPENSSL -I$(SYSROOT)/usr/local/ssl/include
+LIBS += -lsrp -L$(SYSROOT)/usr/local/ssl/lib -lcrypto
TARGETS += srp-entry
EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
MANPAGES += srp-entry.8
-@@ -119,7 +119,7 @@ endif
+@@ -124,7 +124,7 @@ endif
ifdef NO_CRYPT_HACK
- COMPILE_FLAGS += -DNO_CRYPT_HACK
+ CFLAGS += -DNO_CRYPT_HACK
else
-ifneq ($(wildcard /usr/include/crypt.h),)
+ifdef USE_CRYPT
- COMPILE_FLAGS += -DHAVE_CRYPT_H=1
+ CFLAGS += -DHAVE_CRYPT_H=1
LIBS += -lcrypt
endif
diff --git a/patches/ppp-2.4.5/0034-pppd-make-the-self-made-configure-cross-aware.patch b/patches/ppp-2.4.7/0031-pppd-make-the-self-made-configure-cross-aware.patch
similarity index 84%
rename from patches/ppp-2.4.5/0034-pppd-make-the-self-made-configure-cross-aware.patch
rename to patches/ppp-2.4.7/0031-pppd-make-the-self-made-configure-cross-aware.patch
index 0e2604b33..0747d58b6 100644
--- a/patches/ppp-2.4.5/0034-pppd-make-the-self-made-configure-cross-aware.patch
+++ b/patches/ppp-2.4.7/0031-pppd-make-the-self-made-configure-cross-aware.patch
@@ -6,12 +6,12 @@ Give us a chance to setup targets Kernel and arch.
Signed-off-by: Juergen Beisert <juergen@kreuzholzen.de>
---
- configure | 10 ++++++++++
- pppd/plugins/Makefile.linux | 2 +-
+ configure | 10 ++++++++++
+ pppd/plugins/Makefile.linux | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
-index 56816b8..00143d3 100755
+index 6a55e0f08be4..3886564fa495 100755
--- a/configure
+++ b/configure
@@ -14,6 +14,16 @@ SYSCONF=/etc
@@ -32,10 +32,10 @@ index 56816b8..00143d3 100755
Linux)
makext="linux";
diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux
-index 47613d7..7950596 100644
+index 732cc8b411d2..193d884b898b 100644
--- a/pppd/plugins/Makefile.linux
+++ b/pppd/plugins/Makefile.linux
-@@ -40,5 +40,5 @@ clean:
+@@ -44,5 +44,5 @@ clean:
for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean; done
depend:
diff --git a/patches/ppp-2.4.7/series b/patches/ppp-2.4.7/series
new file mode 100644
index 000000000..16d682fd7
--- /dev/null
+++ b/patches/ppp-2.4.7/series
@@ -0,0 +1,34 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-adaptive_echos.patch
+0002-Makefiles-cleanup.patch
+0003-Bug-306261-pppd-does-not-properly-close-dev-ppp-on-p.patch
+0004-Bug-284382-ppp-linkpidfile-is-not-created-upon-detac.patch
+0005-support-building-pppdump-with-the-system-zlib.patch
+0006-disable-unneeded-code-in-the-pppoatm-plugin.patch
+0007-cosmetic-cleanup-of-the-pppoatm-plugin.patch
+0008-pppoe_noads.patch
+0009-make-_PATH_CONNERRS-world-readable.patch
+0010-Correct-unkown-unknown-typo.patch
+0011-pppoe-custom-host-uniq-tag.patch
+0012-scripts_redialer.patch
+0013-Add-replacedefaultroute-option.patch
+0014-ppp-2.3.11-oedod.patch
+0015-add-support-for-the-Framed-MTU-Radius-attribute.patch
+0016-ip-up_option.patch
+0017-ppp-2.4.2-stripMSdomain.patch
+0018-export-CALL_FILE-to-the-link-scripts.patch
+0019-ipv6-accept-remote.patch
+0020-allow-use-of-arbitrary-interface-names.patch
+0021-fix-a-potential-buffer-overflow-in-clientid.c-rc_map.patch
+0022-scripts-README.patch
+0023-no_crypt_hack.patch
+0024-resolv.conf_no_log.patch
+0025-Debian-specific-changes.patch
+0026-secure-card-interpreter-fix.patch
+0027-Fix-buffer-overflow-in-rc_mksid.patch
+0028-Add-a-SONAME-to-the-pppd-binary.patch
+0029-Fix-FTBFS-in-rp-pppoe.patch
+0030-pppd-make-makefile-sysroot-aware.patch
+0031-pppd-make-the-self-made-configure-cross-aware.patch
+# f55804e4f06ed6ed1e5f0e3f1db50b6a - git-ptx-patches magic
diff --git a/rules/ppp.make b/rules/ppp.make
index 867176091..d3e20fbe1 100644
--- a/rules/ppp.make
+++ b/rules/ppp.make
@@ -18,8 +18,8 @@ PACKAGES-$(PTXCONF_PPP) += ppp
#
# Paths and names
#
-PPP_VERSION := 2.4.5
-PPP_MD5 := 4621bc56167b6953ec4071043fe0ec57
+PPP_VERSION := 2.4.7
+PPP_MD5 := 78818f40e6d33a1d1de68a1551f6595a
PPP := ppp-$(PPP_VERSION)
PPP_SUFFIX := tar.gz
PPP_URL := http://ftp.samba.org/pub/ppp/$(PPP).$(PPP_SUFFIX)
--
2.11.0
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 6+ messages in thread