Skip to content

Commit 886ea5f

Browse files
n0toosemkroening
andcommitted
style: align DHCP and non-DHCP log messages
Co-authored-by: Martin Kröning <[email protected]>
1 parent 3d00db1 commit 886ea5f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/executor/device.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl<'a> NetworkInterface<'a> {
6666
let ethernet_addr = EthernetAddress([mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]]);
6767
let hardware_addr = HardwareAddress::Ethernet(ethernet_addr);
6868

69-
info!("MAC address {hardware_addr}");
69+
info!("MAC address: {hardware_addr}");
7070
let capabilities = device.capabilities();
7171
info!("{:?}", capabilities.checksum);
7272
info!("MTU: {} bytes", capabilities.max_transmission_unit);
@@ -131,12 +131,12 @@ impl<'a> NetworkInterface<'a> {
131131
let hardware_addr = HardwareAddress::Ethernet(ethernet_addr);
132132
let ip_addr = IpCidr::from(Ipv4Cidr::from_netmask(myip, mymask).unwrap());
133133

134-
info!("MAC address {hardware_addr}");
135-
info!("Configure network interface with address {ip_addr}");
136-
info!("Configure gateway with address {mygw}");
134+
info!("MAC address: {hardware_addr}");
137135
let capabilities = device.capabilities();
138136
info!("{:?}", capabilities.checksum);
139137
info!("MTU: {} bytes", capabilities.max_transmission_unit);
138+
info!("IP address: {ip_addr}");
139+
info!("Gateway: {mygw}");
140140

141141
// use the current time based on the wall-clock time as seed
142142
let mut config = Config::new(hardware_addr);

src/executor/network.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ async fn dhcpv4_run() {
130130
None => {}
131131
Some(dhcpv4::Event::Configured(config)) => {
132132
info!("DHCP config acquired!");
133-
info!("IP address: {}", config.address);
133+
info!("IP address: {}", config.address);
134134
nic.iface.update_ip_addrs(|addrs| {
135135
if let Some(dest) = addrs.iter_mut().next() {
136136
*dest = IpCidr::Ipv4(config.address);
@@ -139,20 +139,20 @@ async fn dhcpv4_run() {
139139
}
140140
});
141141
if let Some(router) = config.router {
142-
info!("Default gateway: {router}");
142+
info!("Gateway: {router}");
143143
nic.iface
144144
.routes_mut()
145145
.add_default_ipv4_route(router)
146146
.unwrap();
147147
} else {
148-
info!("Default gateway: None");
148+
info!("Gateway: None");
149149
nic.iface.routes_mut().remove_default_ipv4_route();
150150
}
151151

152152
#[cfg(feature = "dns")]
153153
let mut dns_servers: Vec<IpAddress> = Vec::new();
154154
for (i, s) in config.dns_servers.iter().enumerate() {
155-
info!("DNS server {i}: {s}");
155+
info!("DNS server {i}: {s}");
156156
#[cfg(feature = "dns")]
157157
dns_servers.push(IpAddress::Ipv4(*s));
158158
}

0 commit comments

Comments
 (0)