Robust interface detection — retry fallback chain for headless boot (#206)
Fixes interface auto-detection failures on Pi Zero 2W where wlan0 doesn't exist at boot. Implementation: - Added detect_interface_with_retry() function with 3x retry fallback chain - Config-supplied interface preferred, then /proc/net/route, then UP interface - Exponential backoff: 5s, 10s, 20s delays between retries - Filters excluded prefixes: lo, tailscale*, wg*, tun*, docker*, veth*, br-* - Used in Engine.__init__(), PacketCapture.start(), MacManager.start() - Full test coverage: 10 tests for detection, backoff, filtering Addresses issue where network stack initializes after boot and interfaces become available after 5-10 second delay.
This commit is contained in:
@@ -3,6 +3,7 @@ from utils.networking import (
|
||||
get_primary_interface, get_bridge_candidates, get_wifi_interfaces,
|
||||
get_mac, set_mac, get_ip, compile_bpf, send_gratuitous_arp,
|
||||
interface_up, interface_down, create_vlan_interface,
|
||||
detect_interface_with_retry,
|
||||
)
|
||||
from utils.logging import BBLogger
|
||||
from utils.stealth import (
|
||||
|
||||
Reference in New Issue
Block a user