Skip to content
Snippets Groups Projects
  • Enric Balletbo i Serra's avatar
    23a70bf9
    net/net.c: Update ipaddr if the environment has changed · 23a70bf9
    Enric Balletbo i Serra authored
    
    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: default avatarEnric Balletbo i Serra <eballetbo@iseebcn.com>
    Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
    23a70bf9
    History
    net/net.c: Update ipaddr if the environment has changed
    Enric Balletbo i Serra authored
    
    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: default avatarEnric Balletbo i Serra <eballetbo@iseebcn.com>
    Acked-by: default avatarMike Frysinger <vapier@gentoo.org>