_ip-up_option

Gbp-Pq: Name 018_ip-up_option.diff
This commit is contained in:
Ubuntu Developers 2022-05-14 02:43:52 +08:00 committed by openKylinBot
parent 46634da027
commit c21da86147
4 changed files with 18 additions and 4 deletions

View File

@ -1984,7 +1984,7 @@ ipcp_up(f)
*/
if (ipcp_script_state == s_down && ipcp_script_pid == 0) {
ipcp_script_state = s_up;
ipcp_script(_PATH_IPUP, 0);
ipcp_script(path_ipup, 0);
}
}
@ -2034,7 +2034,7 @@ ipcp_down(f)
/* Execute the ip-down script */
if (ipcp_script_state == s_up && ipcp_script_pid == 0) {
ipcp_script_state = s_down;
ipcp_script(_PATH_IPDOWN, 0);
ipcp_script(path_ipdown, 0);
}
}
@ -2097,13 +2097,13 @@ ipcp_script_done(arg)
case s_up:
if (ipcp_fsm[0].state != OPENED) {
ipcp_script_state = s_down;
ipcp_script(_PATH_IPDOWN, 0);
ipcp_script(path_ipdown, 0);
}
break;
case s_down:
if (ipcp_fsm[0].state == OPENED) {
ipcp_script_state = s_up;
ipcp_script(_PATH_IPUP, 0);
ipcp_script(path_ipup, 0);
}
break;
}

View File

@ -308,6 +308,9 @@ main(argc, argv)
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);

View File

@ -114,6 +114,8 @@ char linkname[MAXPATHLEN]; /* logical name for link */
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 */
char req_ifname[MAXIFNAMELEN]; /* requested interface name */
bool multilink = 0; /* Enable multilink operation */
char *bundle_name = NULL; /* bundle name for multilink */
@ -304,6 +306,13 @@ option_t general_options[] = {
"Unset user environment variable",
OPT_A2PRINTER | OPT_NOPRINT, (void *)user_unsetprint },
{ "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 },

View File

@ -328,6 +328,8 @@ extern bool tune_kernel; /* May alter kernel settings as necessary */
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 char req_ifname[MAXIFNAMELEN]; /* interface name to use */
extern bool multilink; /* enable multilink operation */
extern bool noendpoint; /* don't send or accept endpt. discrim. */