2011-03-07 02:09:48 +00:00
|
|
|
--- a/pppd/sys-linux.c
|
|
|
|
+++ b/pppd/sys-linux.c
|
|
|
|
@@ -203,7 +203,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 */
|
|
|
|
|
|
|
|
-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 */
|
|
|
|
@@ -220,8 +220,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 */
|
|
|
|
-static int kernel_version;
|
|
|
|
#define KVERSION(j,n,p) ((j)*1000000 + (n)*1000 + (p))
|
|
|
|
+static const int kernel_version = KVERSION(2,6,37);
|
|
|
|
|
|
|
|
#define MAX_IFS 100
|
|
|
|
|
2011-07-28 16:51:12 +00:00
|
|
|
@@ -1438,11 +1438,12 @@ int ccp_fatal_error (int unit)
|
2011-03-07 02:09:48 +00:00
|
|
|
*
|
|
|
|
* 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;
|
|
|
|
|
2011-07-28 16:51:12 +00:00
|
|
|
@@ -1464,6 +1465,7 @@ static char *path_to_procfs(const char *
|
2011-03-07 02:09:48 +00:00
|
|
|
fclose (fp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
strlcpy(proc_path + proc_path_len, tail,
|
|
|
|
sizeof(proc_path) - proc_path_len);
|
2011-07-28 16:51:12 +00:00
|
|
|
@@ -2116,15 +2118,19 @@ int ppp_available(void)
|
|
|
|
int my_version, my_modification, my_patch;
|
|
|
|
int osmaj, osmin, ospatch;
|
2011-03-07 02:09:48 +00:00
|
|
|
|
|
|
|
+#if 0
|
|
|
|
/* get the kernel version now, since we are called before sys_init */
|
|
|
|
uname(&utsname);
|
|
|
|
osmaj = osmin = ospatch = 0;
|
|
|
|
sscanf(utsname.release, "%d.%d.%d", &osmaj, &osmin, &ospatch);
|
|
|
|
kernel_version = KVERSION(osmaj, osmin, ospatch);
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
fd = open("/dev/ppp", O_RDWR);
|
|
|
|
if (fd >= 0) {
|
|
|
|
+#if 0
|
|
|
|
new_style_driver = 1;
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
/* XXX should get from driver */
|
|
|
|
driver_version = 2;
|
2011-07-28 16:51:12 +00:00
|
|
|
@@ -2185,6 +2191,7 @@ int ppp_available(void)
|
2011-03-07 02:09:48 +00:00
|
|
|
|
|
|
|
if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP))
|
|
|
|
ok = 0;
|
|
|
|
+ return ok;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the PPP device. Validate the version of the driver at this
|
2011-07-28 16:51:12 +00:00
|
|
|
@@ -2678,6 +2685,7 @@ get_pty(master_fdp, slave_fdp, slave_nam
|
2011-03-07 02:09:48 +00:00
|
|
|
}
|
|
|
|
#endif /* TIOCGPTN */
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
if (sfd < 0) {
|
|
|
|
/* the old way - scan through the pty name space */
|
|
|
|
for (i = 0; i < 64; ++i) {
|
2011-07-28 16:51:12 +00:00
|
|
|
@@ -2696,6 +2704,7 @@ get_pty(master_fdp, slave_fdp, slave_nam
|
2011-03-07 02:09:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
if (sfd < 0)
|
|
|
|
return 0;
|
2011-04-02 02:24:38 +00:00
|
|
|
--- a/pppd/plugins/pppoatm/pppoatm.c
|
|
|
|
+++ b/pppd/plugins/pppoatm/pppoatm.c
|
2011-07-28 16:51:12 +00:00
|
|
|
@@ -171,14 +171,6 @@ static void disconnect_pppoatm(void)
|
2011-04-02 02:24:38 +00:00
|
|
|
|
|
|
|
void plugin_init(void)
|
|
|
|
{
|
|
|
|
-#ifdef linux
|
|
|
|
- extern int new_style_driver; /* From sys-linux.c */
|
|
|
|
- if (!ppp_available() && !new_style_driver)
|
|
|
|
- fatal("Kernel doesn't support ppp_generic - "
|
|
|
|
- "needed for PPPoATM");
|
|
|
|
-#else
|
|
|
|
- fatal("No PPPoATM support on this OS");
|
|
|
|
-#endif
|
2011-07-28 16:51:12 +00:00
|
|
|
info("PPPoATM plugin_init");
|
2011-04-02 02:24:38 +00:00
|
|
|
add_options(pppoa_options);
|
|
|
|
}
|
|
|
|
--- a/pppd/plugins/rp-pppoe/plugin.c
|
|
|
|
+++ b/pppd/plugins/rp-pppoe/plugin.c
|
2011-07-28 16:51:12 +00:00
|
|
|
@@ -60,9 +60,6 @@ static char const RCSID[] =
|
2011-04-02 02:24:38 +00:00
|
|
|
|
|
|
|
char pppd_version[] = 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;
|
2011-07-28 16:51:12 +00:00
|
|
|
@@ -340,10 +337,6 @@ PPPoEDevnameHook(char *cmd, char **argv,
|
2011-04-02 02:24:38 +00:00
|
|
|
void
|
|
|
|
plugin_init(void)
|
|
|
|
{
|
|
|
|
- if (!ppp_available() && !new_style_driver) {
|
|
|
|
- fatal("Linux kernel does not support PPPoE -- are you running 2.4.x?");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
add_options(Options);
|
|
|
|
|
2011-07-28 16:51:12 +00:00
|
|
|
info("RP-PPPoE plugin version %s compiled against pppd %s",
|