From 984a18529971be918e399b2172759d241958bf47 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 6 Feb 2018 13:31:48 +0000 Subject: [PATCH] libnetwork: Don't fail when wireless devices are not supported by nl80211 Signed-off-by: Michael Tremer --- src/libnetwork/phy.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) { -- 2.39.2