bug in ethernet dhcp.bas
Posted: Mon Jun 29, 2009 1:22 pm
just ran across a subtle bug in the dhcp.bas file. The file has
The correct code should be
notice the missing assignment to AppConfig.Flags.bIsDHCPEnabled in the first routine, causing the code to evaluate to
which probably isn't what you want!
Code: Select all
Public Sub DHCPEnable()
If smDHCPState = SM_DHCP_DISABLED Then
AppConfig.Flags.bIsDHCPEnabled =
smDHCPState = SM_DHCP_GET_SOCKET
DHCPBindCount = 0
DHCPFlags.Bits.bIsBound = false
EndIf
End Sub
Code: Select all
Public Sub DHCPEnable()
If smDHCPState = SM_DHCP_DISABLED Then
AppConfig.Flags.bIsDHCPEnabled = true
smDHCPState = SM_DHCP_GET_SOCKET
DHCPBindCount = 0
DHCPFlags.Bits.bIsBound = false
EndIf
End Sub
Code: Select all
AppConfig.Flags.bIsDHCPEnabled = smDHCPState = SM_DHCP_GET_SOCKET