]> git.ipfire.org Git - people/ms/network.git/commitdiff
libnetwork: Don't fail when wireless devices are not supported by nl80211
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 6 Feb 2018 13:31:48 +0000 (13:31 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 6 Feb 2018 13:31:48 +0000 (13:31 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
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) {