diff --git a/src/core/dhcp.c b/src/core/dhcp.c index 52877294..4019e2e6 100644 --- a/src/core/dhcp.c +++ b/src/core/dhcp.c @@ -115,8 +115,7 @@ #define DHCP_OPTION_IDX_T2 5 #define DHCP_OPTION_IDX_SUBNET_MASK 6 #define DHCP_OPTION_IDX_ROUTER 7 -#define DHCP_OPTION_IDX_BROADCAST 8 -#define DHCP_OPTION_IDX_DNS_SERVER 9 +#define DHCP_OPTION_IDX_DNS_SERVER 8 #define DHCP_OPTION_IDX_MAX (DHCP_OPTION_IDX_DNS_SERVER + DNS_MAX_SERVERS) /** Holds the decoded option values, only valid while in dhcp_recv. @@ -501,7 +500,6 @@ dhcp_handle_ack(struct netif *netif) /* clear options we might not get from the ACK */ dhcp->offered_sn_mask.addr = 0; dhcp->offered_gw_addr.addr = 0; - dhcp->offered_bc_addr.addr = 0; #if LWIP_DHCP_BOOTP_FILE dhcp->offered_si_addr.addr = 0; #endif /* LWIP_DHCP_BOOTP_FILE */ @@ -548,11 +546,6 @@ dhcp_handle_ack(struct netif *netif) if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_ROUTER)) { dhcp->offered_gw_addr.addr = htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_ROUTER)); } - - /* broadcast address */ - if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_BROADCAST)) { - dhcp->offered_bc_addr.addr = htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_BROADCAST)); - } #if LWIP_DNS /* DNS servers */ @@ -1160,8 +1153,9 @@ dhcp_release(struct netif *netif) dhcp_set_state(dhcp, DHCP_OFF); /* clean old DHCP offer */ dhcp->server_ip_addr.addr = 0; - dhcp->offered_ip_addr.addr = dhcp->offered_sn_mask.addr = 0; - dhcp->offered_gw_addr.addr = dhcp->offered_bc_addr.addr = 0; + dhcp->offered_ip_addr.addr = 0; + dhcp->offered_sn_mask.addr = 0; + dhcp->offered_gw_addr.addr = 0; #if LWIP_DHCP_BOOTP_FILE dhcp->offered_si_addr.addr = 0; #endif /* LWIP_DHCP_BOOTP_FILE */ @@ -1377,10 +1371,6 @@ again: LWIP_ASSERT("len >= decode_len", len >= decode_len); decode_idx = DHCP_OPTION_IDX_DNS_SERVER; break; - case(DHCP_OPTION_BROADCAST): - LWIP_ASSERT("len == 4", len == 4); - decode_idx = DHCP_OPTION_IDX_BROADCAST; - break; case(DHCP_OPTION_LEASE_TIME): LWIP_ASSERT("len == 4", len == 4); decode_idx = DHCP_OPTION_IDX_LEASE_TIME; diff --git a/src/include/lwip/dhcp.h b/src/include/lwip/dhcp.h index 678b40d3..a5851cea 100644 --- a/src/include/lwip/dhcp.h +++ b/src/include/lwip/dhcp.h @@ -38,6 +38,9 @@ struct dhcp u8_t state; /** retries of current request */ u8_t tries; +#if LWIP_DHCP_AUTOIP_COOP + u8_t autoip_coop_state; +#endif struct pbuf *p_out; /* pbuf of outcoming msg */ struct dhcp_msg *msg_out; /* outgoing msg */ @@ -49,14 +52,10 @@ struct dhcp struct ip_addr offered_ip_addr; struct ip_addr offered_sn_mask; struct ip_addr offered_gw_addr; - struct ip_addr offered_bc_addr; u32_t offered_t0_lease; /* lease period (in seconds) */ u32_t offered_t1_renew; /* recommended renew time (usually 50% of lease period) */ u32_t offered_t2_rebind; /* recommended rebind time (usually 66% of lease period) */ -#if LWIP_DHCP_AUTOIP_COOP - u8_t autoip_coop_state; -#endif /* @todo: LWIP_DHCP_BOOTP_FILE configuration option? integrate with possible TFTP-client for booting? */ #if LWIP_DHCP_BOOTP_FILE