summaryrefslogtreecommitdiffstats
path: root/configure.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-01-22 23:52:20 +0000
committerRoy Marples <roy@marples.name>2009-01-22 23:52:20 +0000
commit88a69342c855c381e9167fbda973b0b6cbf7e996 (patch)
tree641d5f86f2a560936b75d0e4ea4920b55d30031b /configure.c
parentbf91047e8fabb1fd4d9a756b1d95ab0cb96773a5 (diff)
downloaddhcpcd-88a69342c855c381e9167fbda973b0b6cbf7e996.tar.xz
ssid should be old_ and new_.
Diffstat (limited to 'configure.c')
-rw-r--r--configure.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/configure.c b/configure.c
index fbc8fafc..95667469 100644
--- a/configure.c
+++ b/configure.c
@@ -168,8 +168,6 @@ make_env(const struct interface *iface, char ***argv)
/* Make our env */
elen = 6;
- if (iface->wireless)
- elen++;
env = xmalloc(sizeof(char *) * (elen + 1));
e = strlen("interface") + strlen(iface->name) + 2;
env[0] = xmalloc(e);
@@ -200,9 +198,17 @@ make_env(const struct interface *iface, char ***argv)
}
*--p = '\0';
if (iface->wireless) {
- e = strlen("ssid=") + strlen(iface->ssid) + 2;
- env[6] = xmalloc(e);
- snprintf(env[6], e, "ssid=%s", iface->ssid);
+ e = strlen("new_ssid=") + strlen(iface->ssid) + 2;
+ if (iface->state->new != NULL) {
+ env = xrealloc(env, sizeof(char *) * (elen + 2));
+ env[elen] = xmalloc(e);
+ snprintf(env[elen++], e, "new_ssid=%s", iface->ssid);
+ }
+ if (iface->state->old != NULL) {
+ env = xrealloc(env, sizeof(char *) * (elen + 2));
+ env[elen] = xmalloc(e);
+ snprintf(env[elen++], e, "old_ssid=%s", iface->ssid);
+ }
}
if (iface->state->old) {
e = configure_env(NULL, NULL, iface->state->old, ifo);