Skip to content

Commit

Permalink
servers/net: DHCPClient: Hard-code the message IDs.
Browse files Browse the repository at this point in the history
Even though C++ should increment the enum for us, since these IDs
are set and used by things outside of this file, we should hard-code
the numbers.

No functional change (or if there is, it means there's a compiler bug
somewhere.)
  • Loading branch information
waddlesplash committed Jul 25, 2015
1 parent 971f8f5 commit d6f83df
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/servers/net/DHCPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ enum message_option {

enum message_type {
DHCP_NONE = 0,
DHCP_DISCOVER,
DHCP_OFFER,
DHCP_REQUEST,
DHCP_DECLINE,
DHCP_ACK,
DHCP_NACK,
DHCP_RELEASE,
DHCP_INFORM
DHCP_DISCOVER = 1,
DHCP_OFFER = 2,
DHCP_REQUEST = 3,
DHCP_DECLINE = 4,
DHCP_ACK = 5,
DHCP_NACK = 6,
DHCP_RELEASE = 7,
DHCP_INFORM = 8
};

struct dhcp_option_cookie {
Expand Down Expand Up @@ -913,7 +913,7 @@ DHCPClient::_TimeoutShift(int socket, dhcp_state& state, time_t& timeout,
state = INIT;
return false;
}

tries++;
timeout += timeout;
if (timeout > MAX_TIMEOUT)
Expand Down

0 comments on commit d6f83df

Please sign in to comment.