]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
net/net.c: Update ipaddr if the environment has changed
authorEnric Balletbo i Serra <eballetbo@iseebcn.com>
Tue, 31 May 2011 21:01:47 +0000 (21:01 +0000)
committerWolfgang Denk <wd@denx.de>
Wed, 1 Jun 2011 20:17:49 +0000 (22:17 +0200)
commit23a70bf9c352ec5b6ac52d5be8087b963c2073dd
tree02ecb4defbb22d8f395abf8c3812649a9f8d9132
parentf345334d250c83a20bf5d37fab408f8a0eec3e54
net/net.c: Update ipaddr if the environment has changed

At least on ARM the ipaddr is only set in board_init_r function. The
problem is if ipaddr is not defined in environment importing another
environment defined don't update the ipaddr value.

For example, suppose we've a default environment without net variables
defined and we want to import an uEnv.txt environment from SD-card like
this:

  ipaddr=192.168.2.240
  netmask=255.255.255.0
  gatewayip=192.168.2.1
  serverip=192.168.2.114

Then if you try boot from NFS results in:

  Importing environment from mmc ...
  Running uenvcmd ...
  smc911x: detected LAN9221 controller
  smc911x: phy initialized
  smc911x: MAC ac:de:48:00:00:00
  *** ERROR: `ipaddr' not set

The ipaddr at this point is NULL beacause is only set at board_init_r
function. This patch updates the ipaddr value if the environment has
changed.

Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
net/net.c