From 674f5b6d772c3d292420016d06eedab96e28f06e Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Wed, 28 Feb 2024 09:39:19 +0100 Subject: [PATCH] Always use the mac handle of the network scheme instead of the mac config --- src/smolnetd/main.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/smolnetd/main.rs b/src/smolnetd/main.rs index 2651a8c3e8..36a34dffbd 100644 --- a/src/smolnetd/main.rs +++ b/src/smolnetd/main.rs @@ -12,10 +12,8 @@ use std::fs::File; use std::os::unix::io::{FromRawFd, RawFd}; use std::process; use std::rc::Rc; -use std::str::FromStr; use event::EventQueue; -use netutils::getcfg; use redox_netstack::error::{Error, Result}; use redox_netstack::logger; use scheme::Smolnetd; @@ -37,10 +35,7 @@ fn run(daemon: redox_daemon::Daemon) -> Result<()> { let hardware_addr = std::fs::read("network:mac") .map(|mac_address| EthernetAddress::from_bytes(&mac_address)) - .unwrap_or_else(|_| { - EthernetAddress::from_str(getcfg("mac").unwrap().trim()) - .expect("Can't parse the 'mac' cfg") - }); + .expect("failed to get mac address from network adapter"); trace!("opening :ip"); let ip_fd = syscall::open(":ip", O_RDWR | O_CREAT | O_NONBLOCK)