diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-12-31 08:47:08 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-12-31 08:47:08 +0100 |
commit | e6de96640ddfad332fa033f98863644c83343c4a (patch) | |
tree | bc89f2bd0654444e1638e4bbd346ac4d1c43bed6 /scripts | |
parent | 35475b9c854895dbb365d78d47b93fef97e31267 (diff) | |
download | connman-e6de96640ddfad332fa033f98863644c83343c4a.tar.gz connman-e6de96640ddfad332fa033f98863644c83343c4a.tar.bz2 connman-e6de96640ddfad332fa033f98863644c83343c4a.zip |
Handle missing environment variables
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/udhcpc-script.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/udhcpc-script.c b/scripts/udhcpc-script.c index fb2168bc..e5ac3e90 100644 --- a/scripts/udhcpc-script.c +++ b/scripts/udhcpc-script.c @@ -51,10 +51,24 @@ int main(int argc, char *argv[]) interface = getenv("interface"); address = getenv("ip"); + if (address == NULL) + address = ""; + netmask = getenv("subnet"); + if (netmask == NULL) + netmask = ""; + broadcast = getenv("broadcast"); + if (broadcast == NULL) + broadcast = ""; + gateway = getenv("router"); + if (gateway == NULL) + gateway = ""; + dns = getenv("dns"); + if (dns == NULL) + dns = ""; dbus_error_init(&error); |