summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-12-31 08:47:08 +0100
committerMarcel Holtmann <marcel@holtmann.org>2008-12-31 08:47:08 +0100
commite6de96640ddfad332fa033f98863644c83343c4a (patch)
treebc89f2bd0654444e1638e4bbd346ac4d1c43bed6 /scripts
parent35475b9c854895dbb365d78d47b93fef97e31267 (diff)
downloadconnman-e6de96640ddfad332fa033f98863644c83343c4a.tar.gz
connman-e6de96640ddfad332fa033f98863644c83343c4a.tar.bz2
connman-e6de96640ddfad332fa033f98863644c83343c4a.zip
Handle missing environment variables
Diffstat (limited to 'scripts')
-rw-r--r--scripts/udhcpc-script.c14
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);