Merge branch 'pu/dhcp'
This commit is contained in:
commit
8fae46a207
15
net/dhcp.c
15
net/dhcp.c
|
@ -527,9 +527,6 @@ static void dhcp_options_process(unsigned char *popt, struct bootp *bp)
|
|||
|
||||
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)
|
||||
|
@ -767,8 +764,10 @@ static int do_dhcp(int argc, char *argv[])
|
|||
goto out1;
|
||||
|
||||
while (dhcp_state != BOUND) {
|
||||
if (ctrlc())
|
||||
break;
|
||||
if (ctrlc()) {
|
||||
ret = -EINTR;
|
||||
goto out1;
|
||||
}
|
||||
if (!retries) {
|
||||
ret = -ETIMEDOUT;
|
||||
goto out1;
|
||||
|
@ -785,6 +784,12 @@ static int do_dhcp(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
if (dhcp_tftpname[0] != 0) {
|
||||
IPaddr_t tftpserver = resolv(dhcp_tftpname);
|
||||
if (tftpserver)
|
||||
net_set_serverip(tftpserver);
|
||||
}
|
||||
|
||||
out1:
|
||||
net_unregister(dhcp_con);
|
||||
out:
|
||||
|
|
Loading…
Reference in New Issue