Now that our product is out in "the wild" we've found that a fair amount of dhcp servers are giving "bogus" DNS server information. After poking around in the utasker code, I found that fnReadDHCP_IP() is setup to return the last IP of possibly multiple DNS server IP addresses.
Example option 6 response:
IP Address: 2.2.2.2
IP Address: 3.3.3.3
IP Address: 192.168.10.2
IP Address: 192.168.10.1
fnReadDHCP_IP() will return 192.168.10.1.
Is there a reason to use the last IP given, as opposed to the first one?
Please ignore the actual values of of the first two IPs, this is my testing of what to do when we receive bad DNS values.
Thanks,
Aaron
EDIT:
I've made the following change to fnReadDHCP_IP(), and so far so good.
//unsigned char *ptr = (*data + ucMsgLength - IPV4_LENGTH + 1);
unsigned char *ptr = (*data + 1);
But I'm not an Ethernet expert. Are there times when this could cause problems for the other IPs that are passed in?