include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ppp
-PKG_VERSION:=2.5.0
+PKG_VERSION:=2.5.1
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/ppp-project/ppp
-PKG_SOURCE_DATE:=2023-03-18
-PKG_SOURCE_VERSION:=760ce18f82670eb81cc186fb792919339a2e2fbe
-PKG_MIRROR_HASH:=e7fe5947ce9e59d73f6d2fdec5d2e40832e656b9edad288578391f8f169b8b9b
+PKG_SOURCE_DATE:=2024-09-18
+PKG_SOURCE_VERSION:=d5aeec65752d4a9b3bb46771d0b221c4a4a6539e
+PKG_MIRROR_HASH:=b98125933d8160ff3476b053414e787e65a94948c0ecee53f6261cd403ff4b03
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=BSD-4-Clause
CONFIGURE_ARGS += \
with_openssl=no \
+ with_pam=no \
with_pcap=no \
+ with_srp=no \
with_static_pcap=yes
define Package/ppp/Default
+++ /dev/null
-configure: Allow overriding uname results
-
-In a cross compile setting it makes no sense to rely on the "uname" values
-reported by the build host system. This patch allows overriding the
-"uname -r", "uname -s" and "uname -m" results with the "UNAME_R", "UNAME_S"
-and "UNAME_M" environment variables.
-
-Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -354,7 +354,7 @@ Setting up SunOS kernel module(s)"
- fi
- }
-
-- release=`uname -r`
-+ release=${UNAME_R:-`uname -r`}
- karch=`/usr/bin/isainfo -k`
- makext="sol2"
- archvariant=
--- /dev/null
+From: Shiji Yang <yangshiji66@outlook.com>
+Date: Fri, 4 Oct 2024 12:19:42 +0000
+Subject: [PATCH] pppd/crypto: fix build without openssl
+
+Compile openssl relevant code only when PPP_WITH_OPENSSL is defined.
+
+Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
+---
+ pppd/crypto.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/pppd/crypto.c
++++ b/pppd/crypto.c
+@@ -199,6 +199,7 @@ int PPP_crypto_init()
+ {
+ int retval = 0;
+
++#ifdef PPP_WITH_OPENSSL
+ #if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ g_crypto_ctx.legacy = OSSL_PROVIDER_load(NULL, "legacy");
+ if (g_crypto_ctx.legacy == NULL)
+@@ -214,6 +215,7 @@ int PPP_crypto_init()
+ goto done;
+ }
+ #endif
++#endif
+
+ retval = 1;
+
+@@ -224,6 +226,7 @@ done:
+
+ int PPP_crypto_deinit()
+ {
++#ifdef PPP_WITH_OPENSSL
+ #if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ if (g_crypto_ctx.legacy) {
+ OSSL_PROVIDER_unload(g_crypto_ctx.legacy);
+@@ -239,6 +242,7 @@ int PPP_crypto_deinit()
+ #if OPENSSL_VERSION_NUMBER < 0x10100000L
+ ERR_free_strings();
+ #endif
++#endif
+ return 1;
+ }
+
--- /dev/null
+From: Shiji Yang <yangshiji66@outlook.com>
+Date: Fri, 4 Oct 2024 14:02:14 +0000
+Subject: [PATCH] pppd: make pid directory before create the pid file
+
+If multilink feature is not enabled, the '/var/run/pppd' directory
+won't be created before adding pid file.
+
+Fixes error message:
+'Failed to create pid file /var/run/pppd/pppoe-wan.pid: No such file or directory'
+
+Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
+---
+ pppd/main.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/pppd/main.c
++++ b/pppd/main.c
+@@ -921,6 +921,9 @@ create_pidfile(int pid)
+ {
+ FILE *pidfile;
+
++#ifndef PPP_WITH_TDB
++ mkdir_recursive(PPP_PATH_VARRUN);
++#endif
+ slprintf(pidfilename, sizeof(pidfilename), "%s/%s.pid",
+ PPP_PATH_VARRUN, ifname);
+ if ((pidfile = fopen(pidfilename, "w")) != NULL) {
--- /dev/null
+From: Tan Zien <nabsdh9@gmail.com>
+Date: Tue, 1 Oct 2024 10:38:45 +0800
+Subject: [PATCH] pppd/crypto: fix gcc 14 build
+
+fix this:
+
+crypto.c: In function 'PPP_crypto_error':
+crypto.c:178:11: error: implicit declaration of function 'vsnprintf' [-Wimplicit-function-declaration]
+ 178 | off = vsnprintf(buf, len, fmt, args);
+ | ^~~~~~~~~
+crypto.c:41:1: note: include '<stdio.h>' or provide a declaration of 'vsnprintf'
+ 40 | #include "crypto-priv.h"
+ +++ |+#include <stdio.h>
+ 41 |
+crypto.c:178:26: warning: 'vsnprintf' argument 2 type is 'int' where 'long unsigned int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
+ 178 | off = vsnprintf(buf, len, fmt, args);
+ | ^~~
+<built-in>: note: built-in 'vsnprintf' declared here
+
+Signed-off-by: Tan Zien <nabsdh9@gmail.com>
+---
+ pppd/crypto.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/pppd/crypto.c
++++ b/pppd/crypto.c
+@@ -34,6 +34,7 @@
+
+ #include <stdlib.h>
+ #include <string.h>
++#include <stdio.h>
+
+ #include "pppd.h"
+ #include "crypto.h"
+@@ -247,7 +248,6 @@ int PPP_crypto_deinit()
+ }
+
+ #ifdef UNIT_TEST
+-#include <stdio.h>
+
+ int debug;
+ int error_count;
} else {
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
-@@ -1911,7 +1911,7 @@ ipcp_up(fsm *f)
+@@ -1915,7 +1915,7 @@ ipcp_up(fsm *f)
proxy_arp_set[f->unit] = 1;
}
} else {
--- a/pppd/pppd-private.h
+++ b/pppd/pppd-private.h
-@@ -362,7 +362,7 @@ void demand_conf(void); /* config interf
+@@ -368,7 +368,7 @@ void demand_conf(void); /* config interf
void demand_block(void); /* set all NPs to queue up packets */
void demand_unblock(void); /* set all NPs to pass packets */
void demand_discard(void); /* set all NPs to discard packets */
--- a/pppd/plugins/radius/config.c
+++ b/pppd/plugins/radius/config.c
-@@ -377,31 +377,37 @@ static int test_config(char *filename)
+@@ -381,31 +381,37 @@ static int test_config(char *filename)
}
#endif
--- a/pppd/plugins/pppoe/discovery.c
+++ b/pppd/plugins/pppoe/discovery.c
-@@ -685,7 +685,9 @@ discovery1(PPPoEConnection *conn)
+@@ -689,7 +689,9 @@ discovery1(PPPoEConnection *conn, int wa
conn->discoveryState = STATE_SENT_PADI;
- waitForPADO(conn, timeout);
+ waitForPADO(conn, timeout, waitWholeTimeoutForPADO);
+#if 0
timeout *= 2;
} while (conn->discoveryState == STATE_SENT_PADI);
}
-@@ -715,7 +717,9 @@ discovery2(PPPoEConnection *conn)
+@@ -719,7 +721,9 @@ discovery2(PPPoEConnection *conn)
sendPADR(conn);
conn->discoveryState = STATE_SENT_PADR;
waitForPADS(conn, timeout);
--- a/pppd/lcp.c
+++ b/pppd/lcp.c
-@@ -1868,12 +1868,12 @@ lcp_up(fsm *f)
+@@ -1888,12 +1888,12 @@ lcp_up(fsm *f)
* the interface MTU is set to the lowest of that, the
* MTU we want to use, and our link MRU.
*/
--- a/pppd/main.c
+++ b/pppd/main.c
-@@ -1116,7 +1116,8 @@ get_input(void)
+@@ -1152,7 +1152,8 @@ get_input(void)
}
notice("Modem hangup");
hungup = 1;
--- a/configure.ac
+++ b/configure.ac
-@@ -296,6 +296,9 @@ AM_CONDITIONAL(PPP_WITH_PAM, test "x${wi
+@@ -306,6 +306,9 @@ AM_CONDITIONAL(PPP_WITH_PAM, test "x${wi
# With libpcap support, activate pppd on network activity
AX_CHECK_PCAP
#
# SunOS provides a version of libpcap that would work, but SunOS has no support for activity filter
AM_CONDITIONAL([PPP_WITH_FILTER], [ test "x${with_pcap}" = "xyes" && test "x${build_sunos}" != "xyes" ])
-@@ -417,6 +420,7 @@ $PACKAGE_NAME version $PACKAGE_VERSION
+@@ -359,6 +362,7 @@ $PACKAGE_NAME version $PACKAGE_VERSION
With libatm..........: ${with_atm:-no}
With libpam..........: ${with_pam:-no}
With libpcap.........: ${with_pcap:-no}
Linker...............: $LD $LDFLAGS $LIBS
--- a/pppd/Makefile.am
+++ b/pppd/Makefile.am
-@@ -128,6 +128,12 @@ pppd_LDFLAGS += $(PCAP_LDFLAGS)
+@@ -138,6 +138,12 @@ pppd_LDFLAGS += $(PCAP_LDFLAGS)
pppd_LIBS += $(PCAP_LIBS)
endif
/*
* There have been 3 or 4 different names for this in libpcap CVS, but
* this seems to be what they have settled on...
-@@ -178,6 +179,13 @@ static int setlogfile(char **);
+@@ -182,6 +183,13 @@ static int setlogfile(char **);
static int loadplugin(char **);
#endif
#ifdef PPP_WITH_FILTER
static int setpassfilter(char **);
static int setactivefilter(char **);
-@@ -374,6 +382,14 @@ struct option general_options[] = {
+@@ -391,6 +399,14 @@ struct option general_options[] = {
"set filter for active pkts", OPT_PRIO },
#endif
{ "maxoctets", o_int, &maxoctets,
"Set connection traffic limit",
OPT_PRIO | OPT_LLIMIT | OPT_NOINCR | OPT_ZEROINF },
-@@ -1648,6 +1664,27 @@ callfile(char **argv)
+@@ -1666,6 +1682,27 @@ callfile(char **argv)
return ok;
}
&& memcmp(vd.dptr, key.dptr, vd.dsize) == 0;
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
-@@ -994,6 +994,16 @@ void cfg_bundle(int mrru, int mtru, int
+@@ -984,6 +984,16 @@ void cfg_bundle(int mrru, int mtru, int
add_fd(ppp_dev_fd);
}
/*
* make_new_bundle - create a new PPP unit (i.e. a bundle)
* and connect our channel to it. This should only get called
-@@ -1012,6 +1022,8 @@ void make_new_bundle(int mrru, int mtru,
+@@ -1002,6 +1012,8 @@ void make_new_bundle(int mrru, int mtru,
/* set the mrru and flags */
cfg_bundle(mrru, mtru, rssn, tssn);
+++ /dev/null
-pppd: Retain foreign default routes on Linux
-
-On Linux, when pppd attempts to delete its default route it does not fill
-the rt_dev field of the struct rtentry used to match the system default route.
-As a consequence, pppd happily deletes any default route even if it belongs
-to another interface.
-
-This patch makes pppd fill out the rt_dev field so that only own default
-routes are ever matched.
-
-Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-
---- a/pppd/sys-linux.c
-+++ b/pppd/sys-linux.c
-@@ -2293,6 +2293,7 @@ int cifdefaultroute (int unit, u_int32_t
- SIN_ADDR(rt.rt_genmask) = 0L;
- }
-
-+ rt.rt_dev = ifname;
- rt.rt_flags = RTF_UP;
- if (ioctl(sock_fd, SIOCDELRT, &rt) < 0 && errno != ESRCH) {
- if (still_ppp()) {
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
-@@ -2243,6 +2243,9 @@ int sifdefaultroute (int unit, u_int32_t
+@@ -2251,6 +2251,9 @@ int sifdefaultroute (int unit, u_int32_t
memset (&rt, 0, sizeof (rt));
SET_SA_FAMILY (rt.rt_dst, AF_INET);
rt.rt_dev = ifname;
rt.rt_metric = dfl_route_metric + 1; /* +1 for binary compatibility */
-@@ -2251,7 +2254,7 @@ int sifdefaultroute (int unit, u_int32_t
+@@ -2259,7 +2262,7 @@ int sifdefaultroute (int unit, u_int32_t
SIN_ADDR(rt.rt_genmask) = 0L;
}
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
-@@ -241,7 +241,7 @@ static int driver_is_old = 0;
+@@ -231,7 +231,7 @@ static int driver_is_old = 0;
static int restore_term = 0; /* 1 => we've munged the terminal */
static struct termios inittermios; /* Initial TTY termios */
static char loop_name[20];
static unsigned char inbuf[512]; /* buffer for chars read from loopback */
-@@ -260,8 +260,8 @@ static int looped; /* 1 if using loop
+@@ -250,8 +250,8 @@ static int looped; /* 1 if using loop
static int link_mtu; /* mtu for the link (not bundle) */
static struct utsname utsname; /* for the kernel version */
#define MAX_IFS 100
-@@ -1978,11 +1978,12 @@ int ccp_fatal_error (int unit)
+@@ -1970,11 +1970,12 @@ int ccp_fatal_error (int unit)
*
* path_to_procfs - find the path to the proc file system mount point
*/
struct mntent *mntent;
FILE *fp;
-@@ -2004,6 +2005,7 @@ static char *path_to_procfs(const char *
+@@ -1996,6 +1997,7 @@ static char *path_to_procfs(const char *
fclose (fp);
}
}
strlcpy(proc_path + proc_path_len, tail,
sizeof(proc_path) - proc_path_len);
-@@ -2888,15 +2890,19 @@ int ppp_check_kernel_support(void)
+@@ -2895,15 +2897,19 @@ int ppp_check_kernel_support(void)
int my_version, my_modification, my_patch;
int osmaj, osmin, ospatch;
/* XXX should get from driver */
driver_version = 2;
-@@ -2956,6 +2962,7 @@ int ppp_check_kernel_support(void)
+@@ -2963,6 +2969,7 @@ int ppp_check_kernel_support(void)
if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP))
ok = 0;
/*
* This is the PPP device. Validate the version of the driver at this
-@@ -3570,6 +3577,7 @@ get_pty(int *master_fdp, int *slave_fdp,
+@@ -3577,6 +3584,7 @@ get_pty(int *master_fdp, int *slave_fdp,
}
#endif /* TIOCGPTN */
if (sfd < 0) {
/* the old way - scan through the pty name space */
for (i = 0; i < 64; ++i) {
-@@ -3594,6 +3602,7 @@ get_pty(int *master_fdp, int *slave_fdp,
+@@ -3601,6 +3609,7 @@ get_pty(int *master_fdp, int *slave_fdp,
}
}
}
char *pppd_pppoe_service = NULL;
static char *acName = NULL;
static char *existingSession = NULL;
-@@ -416,10 +413,6 @@ PPPoEDevnameHook(char *cmd, char **argv,
+@@ -421,10 +418,6 @@ PPPoEDevnameHook(char *cmd, char **argv,
void
plugin_init(void)
{
--- a/pppd/pppd-private.h
+++ b/pppd/pppd-private.h
-@@ -185,7 +185,6 @@ extern int holdoff; /* Dead time before
+@@ -187,7 +187,6 @@ extern int holdoff; /* Dead time before
extern bool holdoff_specified; /* true if user gave a holdoff value */
extern bool notty; /* Stdin/out is not a tty */
extern char *pty_socket; /* Socket to connect to pty */
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
-@@ -3026,6 +3026,7 @@ int ppp_check_kernel_support(void)
+@@ -3033,6 +3033,7 @@ int ppp_check_kernel_support(void)
void logwtmp (const char *line, const char *name, const char *host)
{
struct utmp ut, *utp;
pid_t mypid = getpid();
#if __GLIBC__ < 2
-@@ -3091,6 +3092,7 @@ void logwtmp (const char *line, const ch
+@@ -3098,6 +3099,7 @@ void logwtmp (const char *line, const ch
close (wtmp);
}
#endif
--- a/pppd/main.c
+++ b/pppd/main.c
-@@ -948,14 +948,17 @@ struct protocol_list {
+@@ -984,14 +984,17 @@ struct protocol_list {
const char *name;
} protocol_list[] = {
{ 0x21, "IP" },
{ 0x33, "Stream Protocol ST-II" },
{ 0x35, "Banyan Vines" },
{ 0x39, "AppleTalk EDDP" },
-@@ -969,8 +972,11 @@ struct protocol_list {
+@@ -1005,8 +1008,11 @@ struct protocol_list {
{ 0x49, "Serial Data Transport Protocol (PPP-SDTP)" },
{ 0x4b, "SNA over 802.2" },
{ 0x4d, "SNA" },
{ 0x53, "Encryption" },
{ 0x55, "Individual Link Encryption" },
{ 0x57, "IPv6" },
-@@ -981,12 +987,15 @@ struct protocol_list {
+@@ -1017,12 +1023,15 @@ struct protocol_list {
{ 0x65, "RTP IPHC Compressed non-TCP" },
{ 0x67, "RTP IPHC Compressed UDP 8" },
{ 0x69, "RTP IPHC Compressed RTP 8" },
{ 0x0203, "IBM Source Routing BPDU" },
{ 0x0205, "DEC LANBridge100 Spanning Tree" },
{ 0x0207, "Cisco Discovery Protocol" },
-@@ -998,15 +1007,19 @@ struct protocol_list {
+@@ -1034,15 +1043,19 @@ struct protocol_list {
{ 0x0231, "Luxcom" },
{ 0x0233, "Sigma Network Systems" },
{ 0x0235, "Apple Client Server Protocol" },
{ 0x4001, "Cray Communications Control Protocol" },
{ 0x4003, "CDPD Mobile Network Registration Protocol" },
{ 0x4005, "Expand accelerator protocol" },
-@@ -1017,8 +1030,10 @@ struct protocol_list {
+@@ -1053,8 +1066,10 @@ struct protocol_list {
{ 0x4023, "RefTek Protocol" },
{ 0x4025, "Fibre Channel" },
{ 0x4027, "EMIT Protocols" },
{ 0x8023, "OSI Network Layer Control Protocol" },
{ 0x8025, "Xerox NS IDP Control Protocol" },
{ 0x8027, "DECnet Phase IV Control Protocol" },
-@@ -1027,7 +1042,9 @@ struct protocol_list {
+@@ -1063,7 +1078,9 @@ struct protocol_list {
{ 0x8031, "Bridging NCP" },
{ 0x8033, "Stream Protocol Control Protocol" },
{ 0x8035, "Banyan Vines Control Protocol" },
{ 0x803f, "NETBIOS Framing Control Protocol" },
{ 0x8041, "Cisco Systems Control Protocol" },
{ 0x8043, "Ascom Timeplex" },
-@@ -1036,18 +1053,24 @@ struct protocol_list {
+@@ -1072,18 +1089,24 @@ struct protocol_list {
{ 0x8049, "Serial Data Control Protocol (PPP-SDCP)" },
{ 0x804b, "SNA over 802.2 Control Protocol" },
{ 0x804d, "SNA Control Protocol" },
{ 0x8207, "Cisco Discovery Protocol Control" },
{ 0x8209, "Netcs Twin Routing" },
{ 0x820b, "STP - Control Protocol" },
-@@ -1056,24 +1079,29 @@ struct protocol_list {
+@@ -1092,24 +1115,29 @@ struct protocol_list {
{ 0x8281, "MPLSCP" },
{ 0x8285, "IEEE p1284.4 standard - Protocol Control" },
{ 0x8287, "ETSI TETRA TNP1 Control Protocol" },
--- a/pppd/options.c
+++ b/pppd/options.c
-@@ -362,13 +362,14 @@ struct option general_options[] = {
+@@ -379,13 +379,14 @@ struct option general_options[] = {
"Enable multilink operation", OPT_PRIOSUB | OPT_ALIAS | 1 },
{ "nomultilink", o_bool, &multilink,
"Disable multilink operation", OPT_PRIOSUB | 0 },
--- a/configure.ac
+++ b/configure.ac
-@@ -336,6 +336,7 @@ AC_CONFIG_FILES([
+@@ -344,6 +344,7 @@ AC_CONFIG_FILES([
pppd/plugins/pppoatm/Makefile
pppd/plugins/pppol2tp/Makefile
pppd/plugins/radius/Makefile
+
+#include "pptp_callmgr.h"
+#include <net/if.h>
-+#include <net/ethernet.h>
++#include <linux/if_ether.h>
+#include <linux/if_pppox.h>
+
+#include <stdio.h>
+++ /dev/null
---- a/pppd/plugins/pptp/pptp.c
-+++ b/pppd/plugins/pptp/pptp.c
-@@ -50,7 +50,7 @@
-
- #include "pptp_callmgr.h"
- #include <net/if.h>
--#include <net/ethernet.h>
-+#include <linux/if_ether.h>
- #include <linux/if_pppox.h>
-
- #include <stdio.h>
+++ /dev/null
---- a/pppd/ppp-sha1.c
-+++ b/pppd/ppp-sha1.c
-@@ -107,6 +107,7 @@ static void sha1_clean(PPP_MD_CTX *ctx)
- */
-
- #include <string.h>
-+#include <sys/types.h>
- #include <netinet/in.h> /* htonl() */
-
- typedef struct {
+++ /dev/null
---- a/pppd/crypto_ms.c
-+++ b/pppd/crypto_ms.c
-@@ -122,8 +122,6 @@ MakeKey(const unsigned char *key, unsign
- DES_set_odd_parity((DES_cblock *)des_key);
- }
-
--#include <openssl/evp.h>
--
- int
- DesEncrypt(const unsigned char *clear, const unsigned char *key, unsigned char *cipher)
- {