1 pppd: Allow specifying ipv6-up and ipv6-down scripts
3 This patch implements the "ipv6-up-script" and "ipv6-down-script" options
4 which allow to specify the path of the ipv6-up and ipv6-down scripts to call.
6 These options default to _PATH_IPV6UP and _PATH_IPV6DOWN to retain the
9 The patch originated from the Debian project.
11 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
15 @@ -318,6 +318,8 @@ main(argc, argv)
17 strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup));
18 strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown));
19 + strlcpy(path_ipv6up, _PATH_IPV6UP, sizeof(path_ipv6up));
20 + strlcpy(path_ipv6down, _PATH_IPV6DOWN, sizeof(path_ipv6down));
23 new_phase(PHASE_INITIALIZE);
26 @@ -116,6 +116,8 @@ int connect_delay = 1000; /* wait this m
27 int req_unit = -1; /* requested interface unit */
28 char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
29 char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
30 +char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */
31 +char path_ipv6down[MAXPATHLEN];/* pathname of ipv6-down script */
32 bool multilink = 0; /* Enable multilink operation */
33 char *bundle_name = NULL; /* bundle name for multilink */
34 bool dump_options; /* print out option values */
35 @@ -308,6 +310,13 @@ option_t general_options[] = {
36 "Set pathname of ip-down script",
37 OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
39 + { "ipv6-up-script", o_string, path_ipv6up,
40 + "Set pathname of ipv6-up script",
41 + OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
42 + { "ipv6-down-script", o_string, path_ipv6down,
43 + "Set pathname of ipv6-down script",
44 + OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
47 { "multilink", o_bool, &multilink,
48 "Enable multilink operation", OPT_PRIO | 1 },
51 @@ -1269,7 +1269,7 @@ ipv6cp_up(f)
53 if (ipv6cp_script_state == s_down && ipv6cp_script_pid == 0) {
54 ipv6cp_script_state = s_up;
55 - ipv6cp_script(_PATH_IPV6UP);
56 + ipv6cp_script(path_ipv6up);
60 @@ -1321,7 +1321,7 @@ ipv6cp_down(f)
61 /* Execute the ipv6-down script */
62 if (ipv6cp_script_state == s_up && ipv6cp_script_pid == 0) {
63 ipv6cp_script_state = s_down;
64 - ipv6cp_script(_PATH_IPV6DOWN);
65 + ipv6cp_script(path_ipv6down);
69 @@ -1364,13 +1364,13 @@ ipv6cp_script_done(arg)
71 if (ipv6cp_fsm[0].state != OPENED) {
72 ipv6cp_script_state = s_down;
73 - ipv6cp_script(_PATH_IPV6DOWN);
74 + ipv6cp_script(path_ipv6down);
78 if (ipv6cp_fsm[0].state == OPENED) {
79 ipv6cp_script_state = s_up;
80 - ipv6cp_script(_PATH_IPV6UP);
81 + ipv6cp_script(path_ipv6up);
87 @@ -320,6 +320,8 @@ extern int max_data_rate; /* max bytes/s
88 extern int req_unit; /* interface unit number to use */
89 extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
90 extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
91 +extern char path_ipv6up[MAXPATHLEN]; /* pathname of ipv6-up script */
92 +extern char path_ipv6down[MAXPATHLEN]; /* pathname of ipv6-down script */
93 extern bool multilink; /* enable multilink operation */
94 extern bool noendpoint; /* don't send or accept endpt. discrim. */
95 extern char *bundle_name; /* bundle name for multilink */