- if (getenv ("eth1addr") == NULL &&
- get_mac_address (1, mac, str, sizeof (str)) > 0) {
- setenv ("eth1addr", str);
- memcpy (gd->bd->bi_enet1addr, mac, 6);
+ if (!eth_getenv_enetaddr("eth1addr", mac)) {
+ get_mac_address(1, mac);
+ eth_setenv_enetaddr("eth1addr", mac);