Update to 2.5.3 and use the official tarball. Changelog: https://github.com/ppp-project/ppp/releases/tag/v2.5.3 Removed upstreamed: - 000-pppd-session-fixed-building-with-gcc-15.patch - 001-pppdump-fixed-building-with-gcc-15.patch - 501-fix-memcpy-fortify.patch - 502-remove_mru.patch Manually rebased: - 500-add-pptp-plugin.patch Add a pending patch to relax the check to avoid breaking existing configurations. Signed-off-by: Qingfang Deng <dqfext@gmail.com> Link: https://github.com/openwrt/openwrt/pull/23540 Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
161 lines
4.4 KiB
Diff
161 lines
4.4 KiB
Diff
pppd: Remove runtime kernel checks
|
|
|
|
On embedded system distributions the required kernel features for pppd are
|
|
more or less guaranteed to be present, so there is not much point in
|
|
performing runtime checks, it just increases the binary size.
|
|
|
|
This patch removes the runtime kernel feature checks.
|
|
|
|
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
|
|
|
--- a/pppd/sys-linux.c
|
|
+++ b/pppd/sys-linux.c
|
|
@@ -218,14 +218,10 @@ static int chindex; /* channel index (n
|
|
static unsigned routing_table_id = RT_TABLE_MAIN;
|
|
|
|
static int has_proxy_arp = 0;
|
|
-static int driver_version = 0;
|
|
-static int driver_modification = 0;
|
|
-static int driver_patch = 0;
|
|
-static int driver_is_old = 0;
|
|
static int restore_term = 0; /* 1 => we've munged the terminal */
|
|
static struct termios inittermios; /* Initial TTY termios */
|
|
|
|
-int new_style_driver = 0;
|
|
+static const int new_style_driver = 1;
|
|
|
|
static char loop_name[20];
|
|
static unsigned char inbuf[512]; /* buffer for chars read from loopback */
|
|
@@ -241,9 +237,8 @@ static int dynaddr_set; /* 1 if ip_dyna
|
|
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 */
|
|
-static int kernel_version;
|
|
#define KVERSION(j,n,p) ((j)*1000000 + (n)*1000 + (p))
|
|
+static const int kernel_version = KVERSION(4,9,0);
|
|
|
|
#define MAX_IFS 100
|
|
|
|
@@ -2067,11 +2062,12 @@ int ccp_fatal_error (int unit)
|
|
*
|
|
* path_to_procfs - find the path to the proc file system mount point
|
|
*/
|
|
-static char proc_path[MAXPATHLEN];
|
|
-static int proc_path_len;
|
|
+static char proc_path[MAXPATHLEN] = "/proc";
|
|
+static int proc_path_len = 5;
|
|
|
|
static char *path_to_procfs(const char *tail)
|
|
{
|
|
+#if 0
|
|
struct mntent *mntent;
|
|
FILE *fp;
|
|
|
|
@@ -2093,6 +2089,7 @@ static char *path_to_procfs(const char *
|
|
fclose (fp);
|
|
}
|
|
}
|
|
+#endif
|
|
|
|
strlcpy(proc_path + proc_path_len, tail,
|
|
sizeof(proc_path) - proc_path_len);
|
|
@@ -2874,6 +2871,8 @@ ppp_registered(void)
|
|
|
|
int ppp_check_kernel_support(void)
|
|
{
|
|
+ return 1; /* OpenWrt support ppp device "/dev/ppp" by default */
|
|
+#if 0
|
|
int s, ok, fd;
|
|
struct ifreq ifr;
|
|
int size;
|
|
@@ -3001,6 +3000,7 @@ int ppp_check_kernel_support(void)
|
|
}
|
|
close(s);
|
|
return ok;
|
|
+#endif
|
|
}
|
|
|
|
#ifndef HAVE_LOGWTMP
|
|
@@ -3562,6 +3562,7 @@ get_pty(int *master_fdp, int *slave_fdp,
|
|
}
|
|
#endif /* TIOCGPTN */
|
|
|
|
+#if 0
|
|
if (sfd < 0) {
|
|
/* the old way - scan through the pty name space */
|
|
for (i = 0; i < 64; ++i) {
|
|
@@ -3586,6 +3587,7 @@ get_pty(int *master_fdp, int *slave_fdp,
|
|
}
|
|
}
|
|
}
|
|
+#endif
|
|
|
|
if (sfd < 0)
|
|
return 0;
|
|
@@ -3701,6 +3703,7 @@ get_host_seed(void)
|
|
int
|
|
sys_check_options(void)
|
|
{
|
|
+#if 0
|
|
if (demand && driver_is_old) {
|
|
ppp_option_error("demand dialling is not supported by kernel driver "
|
|
"version %d.%d.%d", driver_version, driver_modification,
|
|
@@ -3711,6 +3714,7 @@ sys_check_options(void)
|
|
warn("Warning: multilink is not supported by the kernel driver");
|
|
multilink = 0;
|
|
}
|
|
+#endif
|
|
return 1;
|
|
}
|
|
|
|
--- a/pppd/plugins/pppoatm/pppoatm.c
|
|
+++ b/pppd/plugins/pppoatm/pppoatm.c
|
|
@@ -180,10 +180,6 @@ static void disconnect_pppoatm(void)
|
|
void plugin_init(void)
|
|
{
|
|
#ifdef linux
|
|
- extern int new_style_driver; /* From sys-linux.c */
|
|
- if (!ppp_check_kernel_support() && !new_style_driver)
|
|
- fatal("Kernel doesn't support ppp_generic - "
|
|
- "needed for PPPoATM");
|
|
#else
|
|
fatal("No PPPoATM support on this OS");
|
|
#endif
|
|
--- a/pppd/plugins/pppoe/plugin.c
|
|
+++ b/pppd/plugins/pppoe/plugin.c
|
|
@@ -54,9 +54,6 @@
|
|
|
|
char pppd_version[] = PPPD_VERSION;
|
|
|
|
-/* From sys-linux.c in pppd -- MUST FIX THIS! */
|
|
-extern int new_style_driver;
|
|
-
|
|
char *pppd_pppoe_service = NULL;
|
|
static char *acName = NULL;
|
|
static char *existingSession = NULL;
|
|
@@ -418,10 +415,6 @@ PPPoEDevnameHook(char *cmd, char **argv,
|
|
void
|
|
plugin_init(void)
|
|
{
|
|
- if (!ppp_check_kernel_support() && !new_style_driver) {
|
|
- fatal("Linux kernel does not support PPPoE -- are you running 2.4.x?");
|
|
- }
|
|
-
|
|
ppp_add_options(Options);
|
|
|
|
info("PPPoE plugin from pppd %s", PPPD_VERSION);
|
|
--- a/pppd/plugins/pppol2tp/pppol2tp.c
|
|
+++ b/pppd/plugins/pppol2tp/pppol2tp.c
|
|
@@ -502,10 +502,6 @@ static void pppol2tp_cleanup(void)
|
|
void plugin_init(void)
|
|
{
|
|
#if defined(__linux__)
|
|
- extern int new_style_driver; /* From sys-linux.c */
|
|
- if (!ppp_check_kernel_support() && !new_style_driver)
|
|
- fatal("Kernel doesn't support ppp_generic - "
|
|
- "needed for PPPoL2TP");
|
|
#else
|
|
fatal("No PPPoL2TP support on this OS");
|
|
#endif
|