summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2008-08-20 13:19:15 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2008-08-20 17:46:47 +0200
commitc0d02ffc3d11e96977b549563f679c5bfe30f359 (patch)
tree3470589077bff99339d192a095949617ce992f53 /lib
parent33c488f8c13bb606a6b60df04461d56fc782574a (diff)
downloadbarebox-c0d02ffc3d11e96977b549563f679c5bfe30f359.tar.gz
barebox-c0d02ffc3d11e96977b549563f679c5bfe30f359.tar.xz
Fix string_to_ip
Use a pointer to an ip address instead of the return value in string_to_ip and use the return value for error indication only. 0.0.0.0 can be a valid ip address Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/parameter.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/parameter.c b/lib/parameter.c
index 7c7338d48a..6d8ac485b2 100644
--- a/lib/parameter.c
+++ b/lib/parameter.c
@@ -58,7 +58,12 @@ const char *dev_get_param(struct device_d *dev, const char *name)
#ifdef CONFIG_NET
IPaddr_t dev_get_param_ip(struct device_d *dev, char *name)
{
- return string_to_ip(dev_get_param(dev, name));
+ IPaddr_t ip;
+
+ if (string_to_ip(dev_get_param(dev, name), &ip))
+ return 0;
+
+ return ip;
}
int dev_set_param_ip(struct device_d *dev, char *name, IPaddr_t ip)