tools/patchelf: update to 0.18.0
[openwrt/staging/dedeckeh.git] / package / network / services / ppp / patches / 120-debian_ipv6_updown_option.patch
1 pppd: Allow specifying ipv6-up and ipv6-down scripts
2
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.
5
6 These options default to _PATH_IPV6UP and _PATH_IPV6DOWN to retain the
7 existing behaviour.
8
9 The patch originated from the Debian project.
10
11 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
12
13 --- a/pppd/main.c
14 +++ b/pppd/main.c
15 @@ -295,6 +295,8 @@ main(int argc, char *argv[])
16
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));
21
22 link_stats_valid = 0;
23 new_phase(PHASE_INITIALIZE);
24 --- a/pppd/options.c
25 +++ b/pppd/options.c
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 },
38
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 },
45 +
46 #ifdef HAVE_MULTILINK
47 { "multilink", o_bool, &multilink,
48 "Enable multilink operation", OPT_PRIO | 1 },
49 --- a/pppd/ipv6cp.c
50 +++ b/pppd/ipv6cp.c
51 @@ -1295,7 +1295,7 @@ ipv6cp_up(fsm *f)
52 */
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);
57 }
58 }
59
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);
66 }
67 }
68
69 @@ -1384,13 +1384,13 @@ ipv6cp_script_done(void *arg)
70 case s_up:
71 if (ipv6cp_fsm[0].state != OPENED) {
72 ipv6cp_script_state = s_down;
73 - ipv6cp_script(_PATH_IPV6DOWN);
74 + ipv6cp_script(path_ipv6down);
75 }
76 break;
77 case s_down:
78 if (ipv6cp_fsm[0].state == OPENED) {
79 ipv6cp_script_state = s_up;
80 - ipv6cp_script(_PATH_IPV6UP);
81 + ipv6cp_script(path_ipv6up);
82 }
83 break;
84 }
85 --- a/pppd/pppd.h
86 +++ b/pppd/pppd.h
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 */