| 1 | --- a/pppd/ipcp.c |
| 2 | +++ b/pppd/ipcp.c |
| 3 | @@ -1850,7 +1850,7 @@ ipcp_up(f) |
| 4 | */ |
| 5 | if (ipcp_script_state == s_down && ipcp_script_pid == 0) { |
| 6 | ipcp_script_state = s_up; |
| 7 | - ipcp_script(_PATH_IPUP, 0); |
| 8 | + ipcp_script(path_ipup, 0); |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | @@ -1900,7 +1900,7 @@ ipcp_down(f) |
| 13 | /* Execute the ip-down script */ |
| 14 | if (ipcp_script_state == s_up && ipcp_script_pid == 0) { |
| 15 | ipcp_script_state = s_down; |
| 16 | - ipcp_script(_PATH_IPDOWN, 0); |
| 17 | + ipcp_script(path_ipdown, 0); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | @@ -1954,13 +1954,13 @@ ipcp_script_done(arg) |
| 22 | case s_up: |
| 23 | if (ipcp_fsm[0].state != OPENED) { |
| 24 | ipcp_script_state = s_down; |
| 25 | - ipcp_script(_PATH_IPDOWN, 0); |
| 26 | + ipcp_script(path_ipdown, 0); |
| 27 | } |
| 28 | break; |
| 29 | case s_down: |
| 30 | if (ipcp_fsm[0].state == OPENED) { |
| 31 | ipcp_script_state = s_up; |
| 32 | - ipcp_script(_PATH_IPUP, 0); |
| 33 | + ipcp_script(path_ipup, 0); |
| 34 | } |
| 35 | break; |
| 36 | } |
| 37 | --- a/pppd/main.c |
| 38 | +++ b/pppd/main.c |
| 39 | @@ -315,6 +315,9 @@ main(argc, argv) |
| 40 | struct protent *protp; |
| 41 | char numbuf[16]; |
| 42 | |
| 43 | + strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup)); |
| 44 | + strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown)); |
| 45 | + |
| 46 | link_stats_valid = 0; |
| 47 | new_phase(PHASE_INITIALIZE); |
| 48 | |
| 49 | --- a/pppd/options.c |
| 50 | +++ b/pppd/options.c |
| 51 | @@ -113,6 +113,8 @@ char linkname[MAXPATHLEN]; /* logical na |
| 52 | bool tune_kernel; /* may alter kernel settings */ |
| 53 | int connect_delay = 1000; /* wait this many ms after connect script */ |
| 54 | int req_unit = -1; /* requested interface unit */ |
| 55 | +char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ |
| 56 | +char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */ |
| 57 | bool multilink = 0; /* Enable multilink operation */ |
| 58 | char *bundle_name = NULL; /* bundle name for multilink */ |
| 59 | bool dump_options; /* print out option values */ |
| 60 | @@ -281,6 +283,13 @@ option_t general_options[] = { |
| 61 | "Number of seconds to wait for child processes at exit", |
| 62 | OPT_PRIO }, |
| 63 | |
| 64 | + { "ip-up-script", o_string, path_ipup, |
| 65 | + "Set pathname of ip-up script", |
| 66 | + OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, |
| 67 | + { "ip-down-script", o_string, path_ipdown, |
| 68 | + "Set pathname of ip-down script", |
| 69 | + OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, |
| 70 | + |
| 71 | #ifdef HAVE_MULTILINK |
| 72 | { "multilink", o_bool, &multilink, |
| 73 | "Enable multilink operation", OPT_PRIO | 1 }, |
| 74 | --- a/pppd/pppd.h |
| 75 | +++ b/pppd/pppd.h |
| 76 | @@ -312,6 +312,8 @@ extern bool tune_kernel; /* May alter ke |
| 77 | extern int connect_delay; /* Time to delay after connect script */ |
| 78 | extern int max_data_rate; /* max bytes/sec through charshunt */ |
| 79 | extern int req_unit; /* interface unit number to use */ |
| 80 | +extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */ |
| 81 | +extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */ |
| 82 | extern bool multilink; /* enable multilink operation */ |
| 83 | extern bool noendpoint; /* don't send or accept endpt. discrim. */ |
| 84 | extern char *bundle_name; /* bundle name for multilink */ |
| 85 | |