prevent dhcp from starting when netif link is down (only when LWIP_DHCP_CHECK_LINK_UP==1, which is disabled by default for compatibility reasons)

This commit is contained in:
goldsimon
2014-12-19 16:04:48 +01:00
parent a883fe7b8e
commit 32c6f96000
4 changed files with 36 additions and 8 deletions

View File

@@ -161,9 +161,9 @@ void dhcp_fine_tmr(void);
#define DHCP_REBINDING 4
#define DHCP_RENEWING 5
#define DHCP_SELECTING 6
#define DHCP_INFORMING 7
/* not yet implemented #define DHCP_INFORMING 7*/
#define DHCP_CHECKING 8
#define DHCP_PERMANENT 9
/* not yet implemented #define DHCP_PERMANENT 9*/
#define DHCP_BOUND 10
/** not yet implemented #define DHCP_RELEASING 11 */
#define DHCP_BACKING_OFF 12

View File

@@ -751,6 +751,16 @@
#define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP))
#endif
/**
* LWIP_DHCP_CHECK_LINK_UP==1: dhcp_start() only really starts if the netif has
* NETIF_FLAG_LINK_UP set in its flags. As this is only an optimization and
* netif drivers might not set this flag, the default is off. If enabled,
* netif_set_link_up() must be called to continue dhcp starting.
*/
#ifndef LWIP_DHCP_CHECK_LINK_UP
#define LWIP_DHCP_CHECK_LINK_UP 0
#endif
/**
* LWIP_DHCP_BOOTP_FILE==1: Store offered_si_addr and boot_file_name.
*/