Page 1 of 1

bug in ethernet dhcp.bas

Posted: Mon Jun 29, 2009 1:22 pm
by Jerry Messina
just ran across a subtle bug in the dhcp.bas file. The file has

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
The correct code should be

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
notice the missing assignment to AppConfig.Flags.bIsDHCPEnabled in the first routine, causing the code to evaluate to

Code: Select all

AppConfig.Flags.bIsDHCPEnabled = smDHCPState = SM_DHCP_GET_SOCKET
which probably isn't what you want!