diff options
author | Robin Getz <rgetz@blackfin.uclinux.org> | 2009-07-21 12:15:28 -0400 |
---|---|---|
committer | Ben Warren <biggerbadderben@gmail.com> | 2009-07-22 23:17:01 -0700 |
commit | 97cfe86163505ea18e7ff7b71e78df5bb03dad57 (patch) | |
tree | d4b32be4b5765ba9de50864a3b17af7286ba2cc0 /net/net.c | |
parent | 0b23fb368d08c9669fac647971ff249c3f9fee8f (diff) | |
download | u-boot-imx-97cfe86163505ea18e7ff7b71e78df5bb03dad57.zip u-boot-imx-97cfe86163505ea18e7ff7b71e78df5bb03dad57.tar.gz u-boot-imx-97cfe86163505ea18e7ff7b71e78df5bb03dad57.tar.bz2 |
Save server's MAC address in environment
Linux's netconsole works much better when you can pass it the MAC address of
the server. (otherwise it just uses broadcast, which everyone else on my
network complains about :)
This sets the env var "serveraddr" (to match ethaddr), so that you can pass
it to linux with whatever bootargs you want to....
addnetconsole=set bootargs $(bootargs) netconsole=@$(ipaddr)/eth0,@$(serverip)/$(serveraddr)
Signed-of-by: Robin Getz <rgetz@blackfin.uclinux.org>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'net/net.c')
-rw-r--r-- | net/net.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1287,6 +1287,15 @@ NetReceive(volatile uchar * inpkt, int len) /* are we waiting for a reply */ if (!NetArpWaitPacketIP || !NetArpWaitPacketMAC) break; + +#ifdef CONFIG_KEEP_SERVERADDR + if (NetServerIP == NetArpWaitPacketIP) { + char buf[20]; + sprintf(buf, "%pM", arp->ar_data); + setenv("serveraddr", buf); + } +#endif + #ifdef ET_DEBUG printf("Got ARP REPLY, set server/gtwy eth addr (%pM)\n", arp->ar_data); |