OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
Line 8... | Line 8... | |||
8 | |
8 | |
|
Line 9... | Line 9... | |||
9 | Signed-off-by: Jo-Philipp Wich <jo@mein.io> |
9 | Signed-off-by: Jo-Philipp Wich <jo@mein.io> |
|
10 | |
10 | |
|
11 | --- a/pppd/sys-linux.c |
11 | --- a/pppd/sys-linux.c |
|
12 | +++ b/pppd/sys-linux.c |
12 | +++ b/pppd/sys-linux.c |
|
13 | @@ -192,7 +192,7 @@ static int driver_is_old = 0; |
13 | @@ -196,7 +196,7 @@ static int driver_is_old = 0; |
|
Line 14... | Line 14... | |||
14 | static int restore_term = 0; /* 1 => we've munged the terminal */ |
14 | static int restore_term = 0; /* 1 => we've munged the terminal */ |
|
15 | static struct termios inittermios; /* Initial TTY termios */ |
15 | static struct termios inittermios; /* Initial TTY termios */ |
|
Line 16... | Line 16... | |||
16 | |
16 | |
|
17 | -int new_style_driver = 0; |
17 | -int new_style_driver = 0; |
|
18 | +static const int new_style_driver = 1; |
18 | +static const int new_style_driver = 1; |
|
19 | |
19 | |
|
Line 20... | Line 20... | |||
20 | static char loop_name[20]; |
20 | static char loop_name[20]; |
|
21 | static unsigned char inbuf[512]; /* buffer for chars read from loopback */ |
21 | static unsigned char inbuf[512]; /* buffer for chars read from loopback */ |
|
22 | @@ -210,8 +210,8 @@ static int looped; /* 1 if using loop |
22 | @@ -214,8 +214,8 @@ static int looped; /* 1 if using loop |
|
23 | static int link_mtu; /* mtu for the link (not bundle) */ |
23 | static int link_mtu; /* mtu for the link (not bundle) */ |
|
Line 24... | Line 24... | |||
24 | |
24 | |
|
Line 25... | Line 25... | |||
25 | static struct utsname utsname; /* for the kernel version */ |
25 | static struct utsname utsname; /* for the kernel version */ |
|
26 | -static int kernel_version; |
26 | -static int kernel_version; |
|
27 | #define KVERSION(j,n,p) ((j)*1000000 + (n)*1000 + (p)) |
27 | #define KVERSION(j,n,p) ((j)*1000000 + (n)*1000 + (p)) |
|
28 | +static const int kernel_version = KVERSION(2,6,37); |
28 | +static const int kernel_version = KVERSION(2,6,37); |
|
29 | |
29 | |
|
30 | #define MAX_IFS 100 |
30 | #define MAX_IFS 100 |
|
Line 42... | Line 42... | |||
42 | { |
42 | { |
|
43 | +#if 0 |
43 | +#if 0 |
|
44 | struct mntent *mntent; |
44 | struct mntent *mntent; |
|
45 | FILE *fp; |
45 | FILE *fp; |
|
Line 46... | Line 46... | |||
46 | |
46 | |
|
47 | @@ -1465,6 +1466,7 @@ static char *path_to_procfs(const char * |
47 | @@ -1477,6 +1478,7 @@ static char *path_to_procfs(const char * |
|
48 | fclose (fp); |
48 | fclose (fp); |
|
49 | } |
49 | } |
|
50 | } |
50 | } |
|
Line 51... | Line 51... | |||
51 | +#endif |
51 | +#endif |
|
52 | |
52 | |
|
53 | strlcpy(proc_path + proc_path_len, tail, |
53 | strlcpy(proc_path + proc_path_len, tail, |
|
54 | sizeof(proc_path) - proc_path_len); |
54 | sizeof(proc_path) - proc_path_len); |
|
55 | @@ -2126,15 +2128,19 @@ int ppp_available(void) |
55 | @@ -2129,15 +2131,19 @@ int ppp_available(void) |
|
Line 56... | Line 56... | |||
56 | int my_version, my_modification, my_patch; |
56 | int my_version, my_modification, my_patch; |
|
57 | int osmaj, osmin, ospatch; |
57 | int osmaj, osmin, ospatch; |
|
Line 70... | Line 70... | |||
70 | new_style_driver = 1; |
70 | new_style_driver = 1; |
|
71 | +#endif |
71 | +#endif |
|
Line 72... | Line 72... | |||
72 | |
72 | |
|
73 | /* XXX should get from driver */ |
73 | /* XXX should get from driver */ |
|
74 | driver_version = 2; |
74 | driver_version = 2; |
|
Line 75... | Line 75... | |||
75 | @@ -2194,6 +2200,7 @@ int ppp_available(void) |
75 | @@ -2197,6 +2203,7 @@ int ppp_available(void) |
|
76 | |
76 | |
|
77 | if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP)) |
77 | if (ok && ((ifr.ifr_hwaddr.sa_family & ~0xFF) != ARPHRD_PPP)) |
|
Line 78... | Line 78... | |||
78 | ok = 0; |
78 | ok = 0; |
|
79 | + return ok; |
79 | + return ok; |
|
80 | |
80 | |
|
81 | /* |
81 | /* |
|
82 | * This is the PPP device. Validate the version of the driver at this |
82 | * This is the PPP device. Validate the version of the driver at this |
|
Line 83... | Line 83... | |||
83 | @@ -2727,6 +2734,7 @@ get_pty(master_fdp, slave_fdp, slave_nam |
83 | @@ -2730,6 +2737,7 @@ get_pty(master_fdp, slave_fdp, slave_nam |
|
84 | } |
84 | } |
|
85 | #endif /* TIOCGPTN */ |
85 | #endif /* TIOCGPTN */ |
|
86 | |
86 | |
|
87 | +#if 0 |
87 | +#if 0 |
|
88 | if (sfd < 0) { |
88 | if (sfd < 0) { |
|
89 | /* the old way - scan through the pty name space */ |
89 | /* the old way - scan through the pty name space */ |
|
90 | for (i = 0; i < 64; ++i) { |
90 | for (i = 0; i < 64; ++i) { |
|
91 | @@ -2745,6 +2753,7 @@ get_pty(master_fdp, slave_fdp, slave_nam |
91 | @@ -2748,6 +2756,7 @@ get_pty(master_fdp, slave_fdp, slave_nam |
|
Line 123... | Line 123... | |||
123 | -extern int new_style_driver; |
123 | -extern int new_style_driver; |
|
124 | - |
124 | - |
|
125 | char *pppd_pppoe_service = NULL; |
125 | char *pppd_pppoe_service = NULL; |
|
126 | static char *acName = NULL; |
126 | static char *acName = NULL; |
|
127 | static char *existingSession = NULL; |
127 | static char *existingSession = NULL; |
|
128 | @@ -372,10 +369,6 @@ PPPoEDevnameHook(char *cmd, char **argv, |
128 | @@ -371,10 +368,6 @@ PPPoEDevnameHook(char *cmd, char **argv, |
|
129 | void |
129 | void |
|
130 | plugin_init(void) |
130 | plugin_init(void) |
|
131 | { |
131 | { |
|
132 | - if (!ppp_available() && !new_style_driver) { |
132 | - if (!ppp_available() && !new_style_driver) { |
|
133 | - fatal("Linux kernel does not support PPPoE -- are you running 2.4.x?"); |
133 | - fatal("Linux kernel does not support PPPoE -- are you running 2.4.x?"); |