fix(net): silence benign no-network warnings; add e1000e (82574) support
- smolnetd: an empty ip_router (DHCP-managed or deliberately network-less like the bare target) is a valid 'no default gateway' state, not a malformed config -> no warning. - router: a limited/directed IPv4 broadcast (DHCP DISCOVER to 255.255.255.255 before any lease/route exists) legitimately has no routing-table entry; don't warn 'No route found' for broadcast destinations. - e1000d: add the 82574L (0x10d3, QEMU '-device e1000e') to the E1000 match list; it keeps the legacy descriptor/register interface this driver uses. I219 is intentionally excluded (integrated MDIO PHY, different init).
This commit is contained in:
@@ -112,12 +112,18 @@ impl Smolnetd {
|
||||
// than panicking. The route lookup below will return None for
|
||||
// an invalid gateway, which is the correct degraded behavior.
|
||||
let default_gw = match getcfg("ip_router") {
|
||||
Ok(s) if s.trim().is_empty() => {
|
||||
// Empty ip_router is a valid "no default gateway" configuration
|
||||
// (DHCP will fill it in, or the host is deliberately network-less
|
||||
// like the bare target). Not a warning.
|
||||
Ipv4Address::new(0, 0, 0, 0)
|
||||
}
|
||||
Ok(s) => Ipv4Address::from_str(s.trim()).unwrap_or_else(|_| {
|
||||
log::warn!("smolnetd: invalid ip_router '{}' in cfg, using 0.0.0.0", s);
|
||||
Ipv4Address::new(0, 0, 0, 0)
|
||||
}),
|
||||
Err(e) => {
|
||||
log::warn!("smolnetd: ip_router not set in cfg ({:?}), using 0.0.0.0", e);
|
||||
Err(_) => {
|
||||
// File absent = no gateway configured; also a normal state.
|
||||
Ipv4Address::new(0, 0, 0, 0)
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user