Skip to content

Instantly share code, notes, and snippets.

@shimarin
Created January 29, 2020 04:22
Show Gist options
  • Save shimarin/3e9e88edc0de1ed8f203e0b29bc304b4 to your computer and use it in GitHub Desktop.
Save shimarin/3e9e88edc0de1ed8f203e0b29bc304b4 to your computer and use it in GitHub Desktop.
A patch to force systemd deal with KUSO wifi dongle like R8188EU
diff --git a/src/network/networkd-wifi.c b/src/network/networkd-wifi.c
index 14a8687458..12cf4eda23 100644
--- a/src/network/networkd-wifi.c
+++ b/src/network/networkd-wifi.c
@@ -35,7 +35,7 @@ int wifi_get_info(Link *link) {
_cleanup_free_ char *ssid = NULL;
r = wifi_get_interface(link->manager->genl, link->ifindex, &link->wlan_iftype, &ssid);
if (r < 0)
- return r;
+ return 0;
if (r > 0 && streq_ptr(link->ssid, ssid))
r = 0;
free_and_replace(link->ssid, ssid);
@shimarin
Copy link
Author

shimarin commented Jan 29, 2020

Some WiFi chips do not support functions to provide information about the interface. Despite so, systemd assumes that any WiFi chip support such functions properly and eventually fails to setup the interface because of that. This patch makes systemd stop dealing with such KUSO WiFi chips seriously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment