Skip to content

Commit

Permalink
network: Add error message if iw couldn't be found
Browse files Browse the repository at this point in the history
When iw is not installed on the host, lxc fails to move wireless devices
into a container. Unfortunately there is no real error message yet
(other than that it didn't work), so its quite unobvious what causes
this. This commit adds a error message that clearly states the
application iw is missing.

Signed-off-by: Maximilian Blenk <blenkmax@gmail.com>
  • Loading branch information
blenk92 authored and Christian Brauner committed Feb 26, 2021
1 parent 41e9f73 commit 06151d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lxc/network.c
Expand Up @@ -1237,8 +1237,10 @@ int lxc_netdev_move_wlan(char *physname, const char *ifname, pid_t pid,
* the 80211 module, so for now just call out to iw.
*/
cmd = on_path("iw", NULL);
if (!cmd)
if (!cmd) {
ERROR("Couldn't find the application iw in PATH");
return -1;
}

fpid = fork();
if (fpid < 0)
Expand Down

0 comments on commit 06151d4

Please sign in to comment.