Sometimes, the TFTP/NFS server is different from the DHCP server. To handle such situations, a global 'serverip' variable is introduced. If present and set with a valid IP address, it will be used instead of the address returned by the DHCP server. Signed-off-by: Wolfram Sang <w.sang@xxxxxxxxxxxxxx> --- defaultenv/config | 3 ++- net/dhcp.c | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/defaultenv/config b/defaultenv/config index 0aaead5..235deca 100644 --- a/defaultenv/config +++ b/defaultenv/config @@ -9,11 +9,12 @@ machine=FIXME # use 'dhcp' to do dhcp in barebox and in kernel # use 'none' if you want to skip kernel ip autoconfiguration ip=dhcp +# IP of the TFTP/NFS-server. If empty (or invalid), DHCP server will be used +#serverip=a.b.c.d # or set your networking parameters here #eth0.ipaddr=a.b.c.d #eth0.netmask=a.b.c.d -#eth0.serverip=a.b.c.d #eth0.gateway=a.b.c.d # can be either 'tftp', 'nfs', 'nand', 'nor' or 'disk' diff --git a/net/dhcp.c b/net/dhcp.c index d1781bc..899c873 100644 --- a/net/dhcp.c +++ b/net/dhcp.c @@ -113,8 +113,11 @@ static void bootp_copy_net_params(struct bootp *bp) tmp_ip = net_read_ip(&bp->bp_yiaddr); net_set_ip(tmp_ip); - tmp_ip = net_read_ip(&bp->bp_siaddr); - if (tmp_ip != 0) + tmp_ip = getenv_ip("serverip"); + if (!tmp_ip) + tmp_ip = net_read_ip(&bp->bp_siaddr); + + if (tmp_ip) net_set_serverip(tmp_ip); if (strlen(bp->bp_file) > 0) -- 1.7.5.4 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox