summaryrefslogtreecommitdiffstats
path: root/obsolete-buildroot/sources/openwrt/patches/ppp/018_ip-up_option.diff
blob: 0dee9248e81714c377db86e2197e30299eedd793 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
--- ppp-2.4.1/pppd/ipcp.c	Thu Mar  8 06:11:12 2001
+++ ppp-2.4.1-new/pppd/ipcp.c	Tue Jun 19 15:35:36 2001
@@ -1734,7 +1734,7 @@
      */
     if (ipcp_script_state == s_down && ipcp_script_pid == 0) {
 	ipcp_script_state = s_up;
-	ipcp_script(_PATH_IPUP);
+	ipcp_script(path_ipup);
     }
 }
 
@@ -1777,7 +1777,7 @@
     /* Execute the ip-down script */
     if (ipcp_script_state == s_up && ipcp_script_pid == 0) {
 	ipcp_script_state = s_down;
-	ipcp_script(_PATH_IPDOWN);
+	ipcp_script(path_ipdown);
     }
 }
 
@@ -1828,13 +1828,13 @@
     case s_up:
 	if (ipcp_fsm[0].state != OPENED) {
 	    ipcp_script_state = s_down;
-	    ipcp_script(_PATH_IPDOWN);
+	    ipcp_script(path_ipdown);
 	}
 	break;
     case s_down:
 	if (ipcp_fsm[0].state == OPENED) {
 	    ipcp_script_state = s_up;
-	    ipcp_script(_PATH_IPUP);
+	    ipcp_script(path_ipup);
 	}
 	break;
     }

--- ppp-2.4.1/pppd/main.c	Tue Mar 13 06:56:19 2001
+++ ppp-2.4.1-new/pppd/main.c	Tue Jun 19 15:35:36 2001
@@ -233,6 +233,9 @@
     struct protent *protp;
     char numbuf[16];
 
+    strlcpy(path_ipup, "/etc/ppp/ip-up", sizeof(path_ipup));
+    strlcpy(path_ipdown, "/etc/ppp/ip-down", sizeof(path_ipdown));
+
     link_stats_valid = 0;
     new_phase(PHASE_INITIALIZE);
 

--- ppp-2.4.1/pppd/options.c	Tue Mar 13 06:56:19 2001
+++ ppp-2.4.1-new/pppd/options.c	Tue Jun 19 15:38:32 2001
@@ -85,6 +85,8 @@
 bool	dump_options;		/* print out option values */
 bool	dryrun;			/* print out option values and exit */
 char	*domain;		/* domain name set by domain option */
+char	path_ipup[MAXPATHLEN];  /* pathname of ip-up script */
+char	path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
 
 extern option_t auth_options[];
 extern struct stat devstat;
@@ -231,6 +233,12 @@
       "Print out option values after parsing all options", 1 },
     { "dryrun", o_bool, &dryrun,
       "Stop after parsing, printing, and checking options", 1 },
+    { "ip-up-script", o_string, path_ipup,
+      "Set pathname of ip-up script",
+      OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
+    { "ip-down-script", o_string, path_ipdown,
+      "Set pathname of ip-down script",
+      OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
 
 #ifdef HAVE_MULTILINK
     { "multilink", o_bool, &multilink,

--- ppp-2.4.1/pppd/pathnames.h	Thu Mar  8 06:15:37 2001
+++ ppp-2.4.1-new/pppd/pathnames.h	Tue Jun 19 15:35:36 2001
@@ -21,8 +21,6 @@
 #define _PATH_UPAPFILE 	 _ROOT_PATH "/etc/ppp/pap-secrets"
 #define _PATH_CHAPFILE 	 _ROOT_PATH "/etc/ppp/chap-secrets"
 #define _PATH_SYSOPTIONS _ROOT_PATH "/etc/ppp/options"
-#define _PATH_IPUP	 _ROOT_PATH "/etc/ppp/ip-up"
-#define _PATH_IPDOWN	 _ROOT_PATH "/etc/ppp/ip-down"
 #define _PATH_AUTHUP	 _ROOT_PATH "/etc/ppp/auth-up"
 #define _PATH_AUTHDOWN	 _ROOT_PATH "/etc/ppp/auth-down"
 #define _PATH_TTYOPT	 _ROOT_PATH "/etc/ppp/options."

--- ppp-2.4.1/pppd/pppd.h	Tue Mar 13 06:54:37 2001
+++ ppp-2.4.1-new/pppd/pppd.h	Tue Jun 19 15:39:39 2001
@@ -272,6 +272,8 @@
 extern char	*bundle_name;	/* bundle name for multilink */
 extern bool	dump_options;	/* print out option values */
 extern bool	dryrun;		/* check everything, print options, exit */
+extern char	path_ipup[MAXPATHLEN];  /* pathname of ip-up script */
+extern char	path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
 
 #ifdef PPP_FILTER
 extern struct	bpf_program pass_filter;   /* Filter for pkts to pass */