- reporting link state with DHCP off fixed

This commit is contained in:
Wiesner András 2025-01-27 17:27:30 +01:00
parent c3f8e53006
commit 398a448eba

View File

@ -122,14 +122,14 @@ static ThreadReturnType task_ethintf(ThreadParamType param) {
} else { // if link is off } else { // if link is off
dhcp_stop(intf->dhcp); dhcp_stop(intf->dhcp);
} }
}
// print generic message // print generic message
MSG("ETH LINK: %s%s", (ls ? (ANSI_COLOR_BGREEN "UP ") : (ANSI_COLOR_BRED "DOWN\n")), ANSI_COLOR_RESET); MSG("ETH LINK: %s%s", (ls ? (ANSI_COLOR_BGREEN "UP ") : (ANSI_COLOR_BRED "DOWN\n")), ANSI_COLOR_RESET);
// print link properties // print link properties
if (ls) { if (ls) {
MSG("(%u Mbps, %s duplex)\n", speed, duplex ? "FULL" : "HALF"); MSG("(%u Mbps, %s duplex)\n", speed, duplex ? "FULL" : "HALF");
}
} }
} break; } break;
@ -262,7 +262,7 @@ void ethinf_get_config(EthInterface *intf, EthInterfaceNetworkConfig *config) {
config->manageDhcp = intf->manageDhcp; config->manageDhcp = intf->manageDhcp;
} }
void ethinf_print_info(const EthInterface * intf) { void ethinf_print_info(const EthInterface *intf) {
MSG("IP: " ANSI_COLOR_BYELLOW); MSG("IP: " ANSI_COLOR_BYELLOW);
PRINT_IPv4(intf->ip); PRINT_IPv4(intf->ip);
MSG(ANSI_COLOR_RESET "\nRouter: "); MSG(ANSI_COLOR_RESET "\nRouter: ");
@ -277,7 +277,7 @@ void ethinf_print_info(const EthInterface * intf) {
bool on = dhcp_get_fsm_state(intf->dhcp) != DHCP_STOPPED; bool on = dhcp_get_fsm_state(intf->dhcp) != DHCP_STOPPED;
MSG("DHCP is %s" ANSI_COLOR_RESET " %s.", on ? (ANSI_COLOR_BGREEN "RUNNING") : (ANSI_COLOR_BRED "STOPPED"), intf->manageDhcp ? "[automanaged]" : ""); MSG("DHCP is %s" ANSI_COLOR_RESET " %s.", on ? (ANSI_COLOR_BGREEN "RUNNING") : (ANSI_COLOR_BRED "STOPPED"), intf->manageDhcp ? "[automanaged]" : "");
} else { } else {
MSG ("DHCP is " ANSI_COLOR_RED "ABSENT" ANSI_COLOR_RESET "."); MSG("DHCP is " ANSI_COLOR_RED "ABSENT" ANSI_COLOR_RESET ".");
} }
MSG("\n"); MSG("\n");