Fix #206: Resolve auto interface to actual interface name

- Engine.__init__ now detects actual interface when config has 'auto'
- Uses get_primary_interface() to find default route interface
- PacketCapture module updated to use detected interface with fallback
- Handles Pi Zero 2W (wlan0) and other non-eth0 systems
This commit is contained in:
Cobra
2026-04-06 11:35:52 -04:00
parent 841d43a3b3
commit 59cdda0596
2 changed files with 10 additions and 1 deletions
+8
View File
@@ -24,6 +24,7 @@ from typing import Optional, Type
from core.bus import EventBus, Event
from core.state import StateManager
from modules.base import BaseModule
from utils.networking import get_primary_interface
logger = logging.getLogger("bb.engine")
@@ -217,6 +218,13 @@ class Engine:
self._tier_limits = HARDWARE_TIERS.get(self._tier, HARDWARE_TIERS["generic"])
self._scope = config.get("scope", {})
self._phase = config.get("engagement_phase", {}).get("mode", "passive_only")
# Resolve "auto" interface to actual interface name
if self.config.get("network", {}).get("primary_interface") == "auto":
actual_iface = get_primary_interface()
if actual_iface:
self.config.setdefault("network", {})["primary_interface"] = actual_iface
logger.debug("Resolved auto interface to: %s", actual_iface)
self._lock = multiprocessing.Lock()
logger.info("Engine initialized (tier=%s, phase=%s)", self._tier, self._phase)