Skip to content

Commit 3d00db1

Browse files
mkroeningn0toose
andcommitted
style: improve DHCP + static IP warning
Co-authored-by: Panagiotis "Ivory" Vasilopoulos <[email protected]>
1 parent 376b966 commit 3d00db1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/executor/device.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@ impl<'a> NetworkInterface<'a> {
5858
#[cfg(feature = "trace")]
5959
let mut device = Tracer::new(device, |timestamp, printer| trace!("{timestamp} {printer}"));
6060

61-
if hermit_var!("HERMIT_IP").is_some() {
62-
warn!(
63-
"A static IP address is specified with the environment variable HERMIT_IP, but the device is configured to use DHCPv4!"
64-
);
61+
if let Some(hermit_ip) = hermit_var!("HERMIT_IP") {
62+
warn!("HERMIT_IP was set to {hermit_ip}, but Hermit was built with DHCPv4.");
63+
warn!("Ignoring HERMIT_IP.");
6564
}
6665

6766
let ethernet_addr = EthernetAddress([mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]]);

0 commit comments

Comments
 (0)