summaryrefslogtreecommitdiffstats
path: root/net/dhcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dhcp.c')
-rw-r--r--net/dhcp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/dhcp.c b/net/dhcp.c
index 79aa75d878..670a6a6422 100644
--- a/net/dhcp.c
+++ b/net/dhcp.c
@@ -562,6 +562,8 @@ out:
int dhcp_set_result(struct eth_device *edev, struct dhcp_result *res)
{
+ int ret;
+
net_set_ip(edev, res->ip);
net_set_netmask(edev, res->netmask);
net_set_gateway(res->gateway);
@@ -580,8 +582,8 @@ int dhcp_set_result(struct eth_device *edev, struct dhcp_result *res)
if (res->tftp_server_name) {
IPaddr_t ip;
- ip = resolv(res->tftp_server_name);
- if (ip)
+ ret = resolv(res->tftp_server_name, &ip);
+ if (!ret)
net_set_serverip_empty(ip);
} else if (res->serverip) {
net_set_serverip_empty(res->serverip);