]> git.ipfire.org Git - people/jschlag/network.git/blobdiff - src/libnetwork/phy.c
libnetwork: Don't fail when wireless devices are not supported by nl80211
[people/jschlag/network.git] / src / libnetwork / phy.c
index de20aa907c7df126e8e115f6e87d529cdb01a03c..6662eae489c50f0115a4d9e3f37309a3de155ed2 100644 (file)
@@ -181,7 +181,15 @@ static int phy_get_info(struct network_phy* phy) {
        if (!msg)
                return -1;
 
-       return network_send_netlink_message(phy->ctx, msg, phy_parse_info, phy);
+       int r = network_send_netlink_message(phy->ctx, msg, phy_parse_info, phy);
+
+       // This is fine since some devices are not supported by NL80211
+       if (r == -ENODEV) {
+               DEBUG(phy->ctx, "Could not fetch information from kernel\n");
+               return 0;
+       }
+
+       return r;
 }
 
 static void network_phy_free(struct network_phy* phy) {