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 @@ -1414,11 +1414,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 @@ -1440,6 +1441,7 @@ static char *path_to_procfs(const char *
43 strlcpy(proc_path + proc_path_len, tail,
44 sizeof(proc_path) - proc_path_len);
45 @@ -2098,11 +2100,13 @@ int ppp_available(void)
46 "ppp.o exists in /lib/modules/`uname -r`/net.\n"
47 "See README.linux file in the ppp distribution for more details.\n";
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);
59 @@ -2121,7 +2125,9 @@ int ppp_available(void)
67 /* XXX should get from driver */
69 @@ -2168,6 +2174,7 @@ int ppp_available(void)
71 if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP))
76 * This is the PPP device. Validate the version of the driver at this
77 @@ -2659,6 +2666,7 @@ get_pty(master_fdp, slave_fdp, slave_nam
83 /* the old way - scan through the pty name space */
84 for (i = 0; i < 64; ++i) {
85 @@ -2677,6 +2685,7 @@ get_pty(master_fdp, slave_fdp, slave_nam
93 --- a/pppd/plugins/pppoatm/pppoatm.c
94 +++ b/pppd/plugins/pppoatm/pppoatm.c
95 @@ -210,14 +210,6 @@ static void recv_config_pppoa(int mru,
97 void plugin_init(void)
100 - extern int new_style_driver; /* From sys-linux.c */
101 - if (!ppp_available() && !new_style_driver)
102 - fatal("Kernel doesn't support ppp_generic - "
103 - "needed for PPPoATM");
105 - fatal("No PPPoATM support on this OS");
107 add_options(pppoa_options);
110 --- a/pppd/plugins/rp-pppoe/plugin.c
111 +++ b/pppd/plugins/rp-pppoe/plugin.c
112 @@ -55,9 +55,6 @@ static char const RCSID[] =
114 char pppd_version[] = VERSION;
116 -/* From sys-linux.c in pppd -- MUST FIX THIS! */
117 -extern int new_style_driver;
119 char *pppd_pppoe_service = NULL;
120 static char *acName = NULL;
121 static char *existingSession = NULL;
122 @@ -312,10 +309,6 @@ PPPoEDevnameHook(char *cmd, char **argv,
126 - if (!ppp_available() && !new_style_driver) {
127 - fatal("Linux kernel does not support PPPoE -- are you running 2.4.x?");
130 add_options(Options);