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 @@ -295,6 +295,8 @@ main(int argc, char *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 @@ -118,6 +118,8 @@ int req_unit = -1; /* requested interfa
27 char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
28 char path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
29 char req_ifname[MAXIFNAMELEN]; /* requested interface name */
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 @@ -324,6 +326,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 @@ -1295,7 +1295,7 @@ ipv6cp_up(fsm *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 @@ -1346,7 +1346,7 @@ ipv6cp_down(fsm *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 @@ -1384,13 +1384,13 @@ ipv6cp_script_done(void *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 @@ -328,6 +328,8 @@ extern int req_unit; /* interface unit n
88 extern char path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
89 extern char path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
90 extern char req_ifname[MAXIFNAMELEN]; /* interface name to use */
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 */