diff --git a/net/dhcp.c b/net/dhcp.c index 7324c94..1261b2d 100644 --- a/net/dhcp.c +++ b/net/dhcp.c @@ -527,9 +527,6 @@ popt += oplen + 2; /* Process next option */ } - - if (dhcp_tftpname[0] != 0) - net_set_serverip(resolv(dhcp_tftpname)); } static int dhcp_message_type(unsigned char *popt) @@ -787,6 +784,12 @@ } } + if (dhcp_tftpname[0] != 0) { + IPaddr_t tftpserver = resolv(dhcp_tftpname); + if (tftpserver) + net_set_serverip(tftpserver); + } + out1: net_unregister(dhcp_con); out: