mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-06-13 08:23:56 +08:00
dhcp: convert 'subnet_mask_given' to 'flags'
Don't waste 7 bits (in preparation for more flags)
This commit is contained in:
@@ -673,9 +673,9 @@ dhcp_handle_ack(struct netif *netif, struct dhcp_msg *msg_in)
|
||||
if (dhcp_option_given(dhcp, DHCP_OPTION_IDX_SUBNET_MASK)) {
|
||||
/* remember given subnet mask */
|
||||
ip4_addr_set_u32(&dhcp->offered_sn_mask, lwip_htonl(dhcp_get_option_value(dhcp, DHCP_OPTION_IDX_SUBNET_MASK)));
|
||||
dhcp->subnet_mask_given = 1;
|
||||
dhcp->flags |= DHCP_FLAG_SUBNET_MASK_GIVEN;
|
||||
} else {
|
||||
dhcp->subnet_mask_given = 0;
|
||||
dhcp->flags &= ~DHCP_FLAG_SUBNET_MASK_GIVEN;
|
||||
}
|
||||
|
||||
/* gateway router */
|
||||
@@ -1088,7 +1088,7 @@ dhcp_bind(struct netif *netif)
|
||||
dhcp->t1_timeout = 0;
|
||||
}
|
||||
|
||||
if (dhcp->subnet_mask_given) {
|
||||
if (dhcp->flags & DHCP_FLAG_SUBNET_MASK_GIVEN) {
|
||||
/* copy offered network mask */
|
||||
ip4_addr_copy(sn_mask, dhcp->offered_sn_mask);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user