diff --git a/src/executor/device.rs b/src/executor/device.rs index fbe32872fc..2873ed0b08 100644 --- a/src/executor/device.rs +++ b/src/executor/device.rs @@ -58,16 +58,15 @@ impl<'a> NetworkInterface<'a> { #[cfg(feature = "trace")] let mut device = Tracer::new(device, |timestamp, printer| trace!("{timestamp} {printer}")); - if hermit_var!("HERMIT_IP").is_some() { - warn!( - "A static IP address is specified with the environment variable HERMIT_IP, but the device is configured to use DHCPv4!" - ); + if let Some(hermit_ip) = hermit_var!("HERMIT_IP") { + warn!("HERMIT_IP was set to {hermit_ip}, but Hermit was built with DHCPv4."); + warn!("Ignoring HERMIT_IP."); } let ethernet_addr = EthernetAddress([mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]]); let hardware_addr = HardwareAddress::Ethernet(ethernet_addr); - info!("MAC address {hardware_addr}"); + info!("MAC address: {hardware_addr}"); let capabilities = device.capabilities(); info!("{:?}", capabilities.checksum); info!("MTU: {} bytes", capabilities.max_transmission_unit); @@ -132,12 +131,12 @@ impl<'a> NetworkInterface<'a> { let hardware_addr = HardwareAddress::Ethernet(ethernet_addr); let ip_addr = IpCidr::from(Ipv4Cidr::from_netmask(myip, mymask).unwrap()); - info!("MAC address {hardware_addr}"); - info!("Configure network interface with address {ip_addr}"); - info!("Configure gateway with address {mygw}"); + info!("MAC address: {hardware_addr}"); let capabilities = device.capabilities(); info!("{:?}", capabilities.checksum); info!("MTU: {} bytes", capabilities.max_transmission_unit); + info!("IP address: {ip_addr}"); + info!("Gateway: {mygw}"); // use the current time based on the wall-clock time as seed let mut config = Config::new(hardware_addr); diff --git a/src/executor/network.rs b/src/executor/network.rs index 0b07ed6e1f..881d7bbb82 100644 --- a/src/executor/network.rs +++ b/src/executor/network.rs @@ -130,7 +130,7 @@ async fn dhcpv4_run() { None => {} Some(dhcpv4::Event::Configured(config)) => { info!("DHCP config acquired!"); - info!("IP address: {}", config.address); + info!("IP address: {}", config.address); nic.iface.update_ip_addrs(|addrs| { if let Some(dest) = addrs.iter_mut().next() { *dest = IpCidr::Ipv4(config.address); @@ -139,20 +139,20 @@ async fn dhcpv4_run() { } }); if let Some(router) = config.router { - info!("Default gateway: {router}"); + info!("Gateway: {router}"); nic.iface .routes_mut() .add_default_ipv4_route(router) .unwrap(); } else { - info!("Default gateway: None"); + info!("Gateway: None"); nic.iface.routes_mut().remove_default_ipv4_route(); } #[cfg(feature = "dns")] let mut dns_servers: Vec = Vec::new(); for (i, s) in config.dns_servers.iter().enumerate() { - info!("DNS server {i}: {s}"); + info!("DNS server {i}: {s}"); #[cfg(feature = "dns")] dns_servers.push(IpAddress::Ipv4(*s)); }