[U-Boot] DHCP regression on 2009-06

Robin Getz rgetz at blackfin.uclinux.org
Fri Jul 10 18:27:53 CEST 2009


http://git.denx.de/?p=u-boot/u-boot-net.git;a=commitdiff;h=3c172c4fdbbb5858fae38478d6399be4a16be3fc

causes a regression on my network's DHCP server.

The part of the diff that causes the problem:

 #if defined(CONFIG_CMD_DHCP)

                case DHCP:
-                       /* Start with a clean slate... */
                        BootpTry = 0;
-                       NetOurIP = 0;
-                       NetServerIP = getenv_IPaddr ("serverip");
                        DhcpRequest();          /* Basically same as BOOTP */
                        break;

Since we are leaving the "NetOurIP" to whatever it was... The test at:
NetReceive():

         case PROT_IP:
            [snip]
                tmp = NetReadIP(&ip->ip_dst);
                if (NetOurIP && tmp != NetOurIP && tmp != 0xFFFFFFFF) {
#ifdef CONFIG_MCAST_TFTP
                        if (Mcast_addr != tmp)
#endif
                        return;
                }

Will return - (we leave the 'NetOurIP' set to the old value, the offered 
address (what is in tmp) is not our's and tmp is not 0xFFFFFFFF).

You never process the DHCP_OFFER...

There are multiple ways of fixing things - setting "NetOurIP = 0;" (revert one 
line of the change, which may expose the bug that Michael was trying to fix), 
or try to be more tricky in the "not our address" check....





More information about the U-Boot mailing list