From: Michael Tremer Date: Tue, 6 Feb 2018 13:31:48 +0000 (+0000) Subject: libnetwork: Don't fail when wireless devices are not supported by nl80211 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=984a18529971be918e399b2172759d241958bf47;p=people%2Fjschlag%2Fnetwork.git libnetwork: Don't fail when wireless devices are not supported by nl80211 Signed-off-by: Michael Tremer --- diff --git a/src/libnetwork/phy.c b/src/libnetwork/phy.c index de20aa9..6662eae 100644 --- a/src/libnetwork/phy.c +++ b/src/libnetwork/phy.c @@ -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) {