English Language flag
// Log In
// CVSweb
Project: FreeWRT
// Summary // Activity // Search // Tracker // Lists // News // SCM // Wiki

SCM Repository

ViewVC logotype

Contents of /branches/common-nfo/package/busybox/patches/960-ifupdown-env.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3427 - (show annotations) (download)
Wed Aug 8 11:08:41 2007 UTC (6 years, 6 months ago) by tg
File size: 1677 byte(s)
merge in trunk rev. 3426
1
2 what's this supposed to do?
3
4 --- old/networking/ifupdown.c 2007-04-10 18:02:16.000000000 +0200
5 +++ new/networking/ifupdown.c 2007-04-17 20:14:10.780486423 +0200
6 @@ -874,8 +874,9 @@
7 {
8 char **environend;
9 int i;
10 - const int n_env_entries = iface->n_options + 5;
11 + const int n_env_entries = iface->n_options + 6;
12 char **ppch;
13 + char *ifupdown_env;
14
15 if (my_environ != NULL) {
16 for (ppch = my_environ; *ppch; ppch++) {
17 @@ -896,12 +897,17 @@
18 }
19 *(environend++) = setlocalenv("IF_%s=%s", iface->option[i].name, iface->option[i].value);
20 }
21 +
22 + ifupdown_env = getenv("IFUPDOWN_ENV");
23 + if (ifupdown_env == NULL)
24 + ifupdown_env = "";
25
26 *(environend++) = setlocalenv("%s=%s", "IFACE", iface->iface);
27 *(environend++) = setlocalenv("%s=%s", "ADDRFAM", iface->address_family->name);
28 *(environend++) = setlocalenv("%s=%s", "METHOD", iface->method->name);
29 *(environend++) = setlocalenv("%s=%s", "MODE", mode);
30 *(environend++) = setlocalenv("%s=%s", "PATH", startup_PATH);
31 + *(environend++) = setlocalenv("%s=%s", "IFUPDOWN_ENV", ifupdown_env);
32 }
33
34 static int doit(char *str)
35 @@ -956,6 +962,7 @@
36 {
37 if (!iface->method->up(iface, check)) return -1;
38 set_environ(iface, "start");
39 + remove("/tmp/ifupdown/env"); /* cleanup */
40 if (!execute_all(iface, "pre-up")) return 0;
41 if (!iface->method->up(iface, doit)) return 0;
42 if (!execute_all(iface, "up")) return 0;
43 @@ -966,6 +973,7 @@
44 {
45 if (!iface->method->down(iface,check)) return -1;
46 set_environ(iface, "stop");
47 + remove("/tmp/ifupdown/env"); /* cleanup */
48 if (!execute_all(iface, "down")) return 0;
49 if (!iface->method->down(iface, doit)) return 0;
50 if (!execute_all(iface, "post-down")) return 0;

root@freewrt.org:443
ViewVC Help
Powered by ViewVC 1.1.20