[package] update ppp to v2.4.4 (#5102)
[openwrt.git] / package / ppp / patches / 100-debian_ip-ip_option.patch
1 diff -Naur ppp-2.4.4.orig/pppd/ipcp.c ppp-2.4.4/pppd/ipcp.c
2 --- ppp-2.4.4.orig/pppd/ipcp.c  2005-08-25 19:59:34.000000000 -0400
3 +++ ppp-2.4.4/pppd/ipcp.c       2009-05-07 15:47:29.000000000 -0400
4 @@ -1850,7 +1850,7 @@
5       */
6      if (ipcp_script_state == s_down && ipcp_script_pid == 0) {
7         ipcp_script_state = s_up;
8 -       ipcp_script(_PATH_IPUP, 0);
9 +       ipcp_script(path_ipup, 0);
10      }
11  }
12  
13 @@ -1900,7 +1900,7 @@
14      /* Execute the ip-down script */
15      if (ipcp_script_state == s_up && ipcp_script_pid == 0) {
16         ipcp_script_state = s_down;
17 -       ipcp_script(_PATH_IPDOWN, 0);
18 +       ipcp_script(path_ipdown, 0);
19      }
20  }
21  
22 @@ -1954,13 +1954,13 @@
23      case s_up:
24         if (ipcp_fsm[0].state != OPENED) {
25             ipcp_script_state = s_down;
26 -           ipcp_script(_PATH_IPDOWN, 0);
27 +           ipcp_script(path_ipdown, 0);
28         }
29         break;
30      case s_down:
31         if (ipcp_fsm[0].state == OPENED) {
32             ipcp_script_state = s_up;
33 -           ipcp_script(_PATH_IPUP, 0);
34 +           ipcp_script(path_ipup, 0);
35         }
36         break;
37      }
38 diff -Naur ppp-2.4.4.orig/pppd/main.c ppp-2.4.4/pppd/main.c
39 --- ppp-2.4.4.orig/pppd/main.c  2006-06-03 23:52:50.000000000 -0400
40 +++ ppp-2.4.4/pppd/main.c       2009-05-07 15:47:29.000000000 -0400
41 @@ -315,6 +315,9 @@
42      struct protent *protp;
43      char numbuf[16];
44  
45 +    strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup));
46 +    strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown));
47 +
48      link_stats_valid = 0;
49      new_phase(PHASE_INITIALIZE);
50  
51 diff -Naur ppp-2.4.4.orig/pppd/options.c ppp-2.4.4/pppd/options.c
52 --- ppp-2.4.4.orig/pppd/options.c       2006-06-18 07:26:00.000000000 -0400
53 +++ ppp-2.4.4/pppd/options.c    2009-05-07 15:47:29.000000000 -0400
54 @@ -113,6 +113,8 @@
55  bool   tune_kernel;            /* may alter kernel settings */
56  int    connect_delay = 1000;   /* wait this many ms after connect script */
57  int    req_unit = -1;          /* requested interface unit */
58 +char   path_ipup[MAXPATHLEN];  /* pathname of ip-up script */
59 +char   path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
60  bool   multilink = 0;          /* Enable multilink operation */
61  char   *bundle_name = NULL;    /* bundle name for multilink */
62  bool   dump_options;           /* print out option values */
63 @@ -281,6 +283,13 @@
64        "Number of seconds to wait for child processes at exit",
65        OPT_PRIO },
66  
67 +    { "ip-up-script", o_string, path_ipup,
68 +      "Set pathname of ip-up script",
69 +      OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
70 +    { "ip-down-script", o_string, path_ipdown,
71 +      "Set pathname of ip-down script",
72 +      OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
73 +
74  #ifdef HAVE_MULTILINK
75      { "multilink", o_bool, &multilink,
76        "Enable multilink operation", OPT_PRIO | 1 },
77 diff -Naur ppp-2.4.4.orig/pppd/pppd.h ppp-2.4.4/pppd/pppd.h
78 --- ppp-2.4.4.orig/pppd/pppd.h  2005-08-25 19:59:34.000000000 -0400
79 +++ ppp-2.4.4/pppd/pppd.h       2009-05-07 15:47:29.000000000 -0400
80 @@ -312,6 +312,8 @@
81  extern int     connect_delay;  /* Time to delay after connect script */
82  extern int     max_data_rate;  /* max bytes/sec through charshunt */
83  extern int     req_unit;       /* interface unit number to use */
84 +extern char    path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
85 +extern char    path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
86  extern bool    multilink;      /* enable multilink operation */
87  extern bool    noendpoint;     /* don't send or accept endpt. discrim. */
88  extern char    *bundle_name;   /* bundle name for multilink */
89 diff -Naur ppp-2.4.4.orig/pppd/ipcp.c ppp-2.4.4/pppd/ipcp.c
90 --- ppp-2.4.4.orig/pppd/ipcp.c  2005-08-25 19:59:34.000000000 -0400
91 +++ ppp-2.4.4/pppd/ipcp.c       2009-05-07 15:47:29.000000000 -0400
92 @@ -1850,7 +1850,7 @@
93       */
94      if (ipcp_script_state == s_down && ipcp_script_pid == 0) {
95         ipcp_script_state = s_up;
96 -       ipcp_script(_PATH_IPUP, 0);
97 +       ipcp_script(path_ipup, 0);
98      }
99  }
100  
101 @@ -1900,7 +1900,7 @@
102      /* Execute the ip-down script */
103      if (ipcp_script_state == s_up && ipcp_script_pid == 0) {
104         ipcp_script_state = s_down;
105 -       ipcp_script(_PATH_IPDOWN, 0);
106 +       ipcp_script(path_ipdown, 0);
107      }
108  }
109  
110 @@ -1954,13 +1954,13 @@
111      case s_up:
112         if (ipcp_fsm[0].state != OPENED) {
113             ipcp_script_state = s_down;
114 -           ipcp_script(_PATH_IPDOWN, 0);
115 +           ipcp_script(path_ipdown, 0);
116         }
117         break;
118      case s_down:
119         if (ipcp_fsm[0].state == OPENED) {
120             ipcp_script_state = s_up;
121 -           ipcp_script(_PATH_IPUP, 0);
122 +           ipcp_script(path_ipup, 0);
123         }
124         break;
125      }
126 diff -Naur ppp-2.4.4.orig/pppd/main.c ppp-2.4.4/pppd/main.c
127 --- ppp-2.4.4.orig/pppd/main.c  2006-06-03 23:52:50.000000000 -0400
128 +++ ppp-2.4.4/pppd/main.c       2009-05-07 15:47:29.000000000 -0400
129 @@ -315,6 +315,9 @@
130      struct protent *protp;
131      char numbuf[16];
132  
133 +    strlcpy(path_ipup, _PATH_IPUP, sizeof(path_ipup));
134 +    strlcpy(path_ipdown, _PATH_IPDOWN, sizeof(path_ipdown));
135 +
136      link_stats_valid = 0;
137      new_phase(PHASE_INITIALIZE);
138  
139 diff -Naur ppp-2.4.4.orig/pppd/options.c ppp-2.4.4/pppd/options.c
140 --- ppp-2.4.4.orig/pppd/options.c       2006-06-18 07:26:00.000000000 -0400
141 +++ ppp-2.4.4/pppd/options.c    2009-05-07 15:47:29.000000000 -0400
142 @@ -113,6 +113,8 @@
143  bool   tune_kernel;            /* may alter kernel settings */
144  int    connect_delay = 1000;   /* wait this many ms after connect script */
145  int    req_unit = -1;          /* requested interface unit */
146 +char   path_ipup[MAXPATHLEN];  /* pathname of ip-up script */
147 +char   path_ipdown[MAXPATHLEN];/* pathname of ip-down script */
148  bool   multilink = 0;          /* Enable multilink operation */
149  char   *bundle_name = NULL;    /* bundle name for multilink */
150  bool   dump_options;           /* print out option values */
151 @@ -281,6 +283,13 @@
152        "Number of seconds to wait for child processes at exit",
153        OPT_PRIO },
154  
155 +    { "ip-up-script", o_string, path_ipup,
156 +      "Set pathname of ip-up script",
157 +      OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
158 +    { "ip-down-script", o_string, path_ipdown,
159 +      "Set pathname of ip-down script",
160 +      OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN },
161 +
162  #ifdef HAVE_MULTILINK
163      { "multilink", o_bool, &multilink,
164        "Enable multilink operation", OPT_PRIO | 1 },
165 diff -Naur ppp-2.4.4.orig/pppd/pppd.h ppp-2.4.4/pppd/pppd.h
166 --- ppp-2.4.4.orig/pppd/pppd.h  2005-08-25 19:59:34.000000000 -0400
167 +++ ppp-2.4.4/pppd/pppd.h       2009-05-07 15:47:29.000000000 -0400
168 @@ -312,6 +312,8 @@
169  extern int     connect_delay;  /* Time to delay after connect script */
170  extern int     max_data_rate;  /* max bytes/sec through charshunt */
171  extern int     req_unit;       /* interface unit number to use */
172 +extern char    path_ipup[MAXPATHLEN]; /* pathname of ip-up script */
173 +extern char    path_ipdown[MAXPATHLEN]; /* pathname of ip-down script */
174  extern bool    multilink;      /* enable multilink operation */
175  extern bool    noendpoint;     /* don't send or accept endpt. discrim. */
176  extern char    *bundle_name;   /* bundle name for multilink */