summaryrefslogtreecommitdiff
path: root/package/ppp/patches/101-debian_ip-up_option.patch
blob: 2461f123f7ab1a88ec41b0e7a0975aa26551ddcc (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
Index: ppp-2.4.3/pppd/ipcp.c
===================================================================
--- ppp-2.4.3.orig/pppd/ipcp.c	2007-06-04 13:22:08.478566344 +0200
+++ ppp-2.4.3/pppd/ipcp.c	2007-06-04 13:22:09.003486544 +0200
@@ -1846,7 +1846,7 @@
      */
     if (ipcp_script_state == s_down && ipcp_script_pid == 0) {
 	ipcp_script_state = s_up;
-	ipcp_script(_PATH_IPUP);
+	ipcp_script(path_ipup);
     }
 }
 
@@ -1896,7 +1896,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);
     }
 }
 
@@ -1950,13 +1950,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;
     }
Index: ppp-2.4.3/pppd/main.c
===================================================================
--- ppp-2.4.3.orig/pppd/main.c	2007-06-04 13:22:08.487564976 +0200
+++ ppp-2.4.3/pppd/main.c	2007-06-04 13:22:09.004486392 +0200
@@ -314,6 +314,9 @@
     struct protent *protp;
     char numbuf[16];
 
+    strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup));
+    strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown));
+
     link_stats_valid = 0;
     new_phase(PHASE_INITIALIZE);
 
Index: ppp-2.4.3/pppd/options.c
===================================================================
--- ppp-2.4.3.orig/pppd/options.c	2007-06-04 13:22:08.495563760 +0200
+++ ppp-2.4.3/pppd/options.c	2007-06-04 13:22:09.005486240 +0200
@@ -108,6 +108,8 @@
 bool	tune_kernel;		/* may alter kernel settings */
 int	connect_delay = 1000;	/* wait this many ms after connect script */
 int	req_unit = -1;		/* requested interface unit */
+char	path_ipup[MAXPATHLEN];	/* pathname of ip-up script */
+char	path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
 bool	multilink = 0;		/* Enable multilink operation */
 char	*bundle_name = NULL;	/* bundle name for multilink */
 bool	dump_options;		/* print out option values */
@@ -276,6 +278,13 @@
       "Number of seconds to wait for child processes at exit",
       OPT_PRIO },
 
+    { "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,
       "Enable multilink operation", OPT_PRIO | 1 },
Index: ppp-2.4.3/pppd/pppd.h
===================================================================
--- ppp-2.4.3.orig/pppd/pppd.h	2007-06-04 13:22:08.505562240 +0200
+++ ppp-2.4.3/pppd/pppd.h	2007-06-04 13:22:09.005486240 +0200
@@ -312,6 +312,8 @@
 extern int	connect_delay;	/* Time to delay after connect script */
 extern int	max_data_rate;	/* max bytes/sec through charshunt */
 extern int	req_unit;	/* interface unit number to use */
+extern char	path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
+extern char	path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
 extern bool	multilink;	/* enable multilink operation */
 extern bool	noendpoint;	/* don't send or accept endpt. discrim. */
 extern char	*bundle_name;	/* bundle name for multilink */