[PATCH] net: dns: Return error when nameserver not given

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When no nameserver is given then return an error instead of returning
successfully with 0.0.0.0 as return IP.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 net/dns.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dns.c b/net/dns.c
index 8b5e8d59e8..fdddb3f915 100644
--- a/net/dns.c
+++ b/net/dns.c
@@ -226,7 +226,7 @@ int resolv(const char *host, IPaddr_t *ip)
 	nameserver = net_get_nameserver();
 	if (!nameserver) {
 		pr_err("no nameserver specified in $global.net.nameserver\n");
-		return 0;
+		return -ENOENT;
 	}
 
 	pr_debug("resolving host %s via nameserver %pI4\n", host, &nameserver);
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux