3 @@ -203,7 +203,7 @@ static int driver_is_old = 0;
4 static int restore_term = 0; /* 1 => we've munged the terminal */
5 static struct termios inittermios; /* Initial TTY termios */
7 -int new_style_driver = 0;
8 +static const int new_style_driver = 1;
10 static char loop_name[20];
11 static unsigned char inbuf[512]; /* buffer for chars read from loopback */
12 @@ -220,8 +220,8 @@ static int looped; /* 1 if using loop
13 static int link_mtu; /* mtu for the link (not bundle) */
15 static struct utsname utsname; /* for the kernel version */
16 -static int kernel_version;
17 #define KVERSION(j,n,p) ((j)*1000000 + (n)*1000 + (p))
18 +static const int kernel_version = KVERSION(2,6,37);
22 @@ -1438,11 +1438,12 @@ int ccp_fatal_error (int unit)
24 * path_to_procfs - find the path to the proc file system mount point
26 -static char proc_path[MAXPATHLEN];
27 -static int proc_path_len;
28 +static char proc_path[MAXPATHLEN] = "/proc";
29 +static int proc_path_len = 5;
31 static char *path_to_procfs(const char *tail)
34 struct mntent *mntent;
37 @@ -1464,6 +1465,7 @@ static char *path_to_procfs(const char *
43 strlcpy(proc_path + proc_path_len, tail,
44 sizeof(proc_path) - proc_path_len);
45 @@ -2116,15 +2118,19 @@ int ppp_available(void)
46 int my_version, my_modification, my_patch;
47 int osmaj, osmin, ospatch;
50 /* get the kernel version now, since we are called before sys_init */
52 osmaj = osmin = ospatch = 0;
53 sscanf(utsname.release, "%d.%d.%d", &osmaj, &osmin, &ospatch);
54 kernel_version = KVERSION(osmaj, osmin, ospatch);
57 fd = open("/dev/ppp", O_RDWR);
63 /* XXX should get from driver */
65 @@ -2185,6 +2191,7 @@ int ppp_available(void)
67 if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP))
72 * This is the PPP device. Validate the version of the driver at this
73 @@ -2678,6 +2685,7 @@ get_pty(master_fdp, slave_fdp, slave_nam
79 /* the old way - scan through the pty name space */
80 for (i = 0; i < 64; ++i) {
81 @@ -2696,6 +2704,7 @@ get_pty(master_fdp, slave_fdp, slave_nam
89 --- a/pppd/plugins/pppoatm/pppoatm.c
90 +++ b/pppd/plugins/pppoatm/pppoatm.c
91 @@ -171,14 +171,6 @@ static void disconnect_pppoatm(void)
93 void plugin_init(void)
96 - extern int new_style_driver; /* From sys-linux.c */
97 - if (!ppp_available() && !new_style_driver)
98 - fatal("Kernel doesn't support ppp_generic - "
99 - "needed for PPPoATM");
101 - fatal("No PPPoATM support on this OS");
103 info("PPPoATM plugin_init");
104 add_options(pppoa_options);
106 --- a/pppd/plugins/rp-pppoe/plugin.c
107 +++ b/pppd/plugins/rp-pppoe/plugin.c
108 @@ -60,9 +60,6 @@ static char const RCSID[] =
110 char pppd_version[] = VERSION;
112 -/* From sys-linux.c in pppd -- MUST FIX THIS! */
113 -extern int new_style_driver;
115 char *pppd_pppoe_service = NULL;
116 static char *acName = NULL;
117 static char *existingSession = NULL;
118 @@ -340,10 +337,6 @@ PPPoEDevnameHook(char *cmd, char **argv,
122 - if (!ppp_available() && !new_style_driver) {
123 - fatal("Linux kernel does not support PPPoE -- are you running 2.4.x?");
126 add_options(Options);
128 info("RP-PPPoE plugin version %s compiled against pppd %s",