Added WiFi ifindex discovery and enhanced error handling