diff options
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | net/net.c | 9 |
2 files changed, 14 insertions, 0 deletions
@@ -1184,6 +1184,11 @@ The following options need to be configured: Defines a default value for the IP address of a TFTP server to contact when using the "tftboot" command. + CONFIG_KEEP_SERVERADDR + + Keeps the server's MAC address, in the env 'serveraddr' + for passing to bootargs (like Linux's netconsole option) + - Multicast TFTP Mode: CONFIG_MCAST_TFTP @@ -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); |