summaryrefslogtreecommitdiff
path: root/plugins/ipv4.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-10-07 14:21:02 +0200
committerMarcel Holtmann <marcel@holtmann.org>2008-10-07 14:21:02 +0200
commit6fa6bdc6f6a8d239142b32979318245da8941d2b (patch)
tree3d8bc2078482c7c1a304c8595fa4652e0d74c1bd /plugins/ipv4.c
parent18886b7ef037884eff0bac7b9de673aa0a058493 (diff)
downloadconnman-6fa6bdc6f6a8d239142b32979318245da8941d2b.tar.gz
connman-6fa6bdc6f6a8d239142b32979318245da8941d2b.tar.bz2
connman-6fa6bdc6f6a8d239142b32979318245da8941d2b.zip
Fail if address, netmask or gateway are not provided
Diffstat (limited to 'plugins/ipv4.c')
-rw-r--r--plugins/ipv4.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/ipv4.c b/plugins/ipv4.c
index 0a66a237..67d1ed10 100644
--- a/plugins/ipv4.c
+++ b/plugins/ipv4.c
@@ -192,6 +192,9 @@ static int ipv4_probe(struct connman_element *element)
DBG("netmask %s", netmask);
DBG("gateway %s", gateway);
+ if (address == NULL || netmask == NULL || gateway == NULL)
+ return -EINVAL;
+
memset(&ipv4, 0, sizeof(ipv4));
ipv4.address.s_addr = inet_addr(address);
ipv4.netmask.s_addr = inet_addr(netmask);