+
+#if defined(CONFIG_CMD_LINK_LOCAL)
+static int do_link_local(cmd_tbl_t *cmdtp, int flag, int argc,
+ char * const argv[])
+{
+ char tmp[22];
+
+ if (net_loop(LINKLOCAL) < 0)
+ return CMD_RET_FAILURE;
+
+ net_gateway.s_addr = 0;
+ ip_to_string(net_gateway, tmp);
+ setenv("gatewayip", tmp);
+
+ ip_to_string(net_netmask, tmp);
+ setenv("netmask", tmp);
+
+ ip_to_string(net_ip, tmp);
+ setenv("ipaddr", tmp);
+ setenv("llipaddr", tmp); /* store this for next time */
+
+ return CMD_RET_SUCCESS;
+}
+
+U_BOOT_CMD(
+ linklocal, 1, 1, do_link_local,
+ "acquire a network IP address using the link-local protocol",
+ ""
+);
+
+#endif /* CONFIG_CMD_LINK_LOCAL */