提交 2c00e099 编写于 作者: J Joe Hershberger

net: Add option CONFIG_BOOTP_MAY_FAIL

This is useful if you want to look for a DHCP server, but try some
other settings if not available.
Signed-off-by: NJoe Hershberger <joe.hershberger@ni.com>
Acked-by: NSimon Glass <sjg@chromium.org>
上级 1752f0fd
...@@ -1592,10 +1592,17 @@ The following options need to be configured: ...@@ -1592,10 +1592,17 @@ The following options need to be configured:
CONFIG_BOOTP_NTPSERVER CONFIG_BOOTP_NTPSERVER
CONFIG_BOOTP_TIMEOFFSET CONFIG_BOOTP_TIMEOFFSET
CONFIG_BOOTP_VENDOREX CONFIG_BOOTP_VENDOREX
CONFIG_BOOTP_MAY_FAIL
CONFIG_BOOTP_SERVERIP - TFTP server will be the serverip CONFIG_BOOTP_SERVERIP - TFTP server will be the serverip
environment variable, not the BOOTP server. environment variable, not the BOOTP server.
CONFIG_BOOTP_MAY_FAIL - If the DHCP server is not found
after the configured retry count, the call will fail
instead of starting over. This can be used to fail over
to Link-local IP address configuration if the DHCP server
is not available.
CONFIG_BOOTP_DNS2 - If a DHCP client requests the DNS CONFIG_BOOTP_DNS2 - If a DHCP client requests the DNS
serverip from a DHCP server, it is possible that more serverip from a DHCP server, it is possible that more
than one DNS serverip is offered to the client. than one DNS serverip is offered to the client.
......
...@@ -326,8 +326,13 @@ static void ...@@ -326,8 +326,13 @@ static void
BootpTimeout(void) BootpTimeout(void)
{ {
if (BootpTry >= TIMEOUT_COUNT) { if (BootpTry >= TIMEOUT_COUNT) {
#ifdef CONFIG_BOOTP_MAY_FAIL
puts("\nRetry count exceeded\n");
NetSetState(NETLOOP_FAIL);
#else
puts("\nRetry count exceeded; starting again\n"); puts("\nRetry count exceeded; starting again\n");
NetStartAgain(); NetStartAgain();
#endif
} else { } else {
NetSetTimeout(TIMEOUT, BootpTimeout); NetSetTimeout(TIMEOUT, BootpTimeout);
BootpRequest(); BootpRequest();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册