diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2017-08-22 18:16:29 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2017-08-22 23:24:59 -0500 |
commit | 8d690efa834a12fb528b820cc8a7c83f5afab5b4 (patch) | |
tree | 0bc6a3a6c47065f505fc7966fc1cc8ad2aa3765f /drivers/cdmamodem | |
parent | fb179957210a5a6c3726ea4b285e88009e6a4cd1 (diff) | |
download | ofono-8d690efa834a12fb528b820cc8a7c83f5afab5b4.tar.gz |
at/cdma/ifxmodem: Use /dev/net/tun to check for TUN support
Previously, these drivers would check /sys/devices/virtual/misc/tun to
see if TUN is supported, and bail out otherwise. However, the tun module
can sometimes be autoloaded by opening the /dev/net/tun file. In this
case the /dev file already exists, but the /sys file only gets created
after the modul is loaded.
Additionally, the ppp code does not use the /sys file, but only the
/dev file, so checking for the existence of the latter seems a better
indicator of expected success.
Diffstat (limited to 'drivers/cdmamodem')
-rw-r--r-- | drivers/cdmamodem/connman.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cdmamodem/connman.c b/drivers/cdmamodem/connman.c index 8c3265a1..7f0f54b6 100644 --- a/drivers/cdmamodem/connman.c +++ b/drivers/cdmamodem/connman.c @@ -43,7 +43,7 @@ #include "cdmamodem.h" #include "drivers/atmodem/vendor.h" -#define TUN_SYSFS_DIR "/sys/devices/virtual/misc/tun" +#define TUN_DEV "/dev/net/tun" #define STATIC_IP_NETMASK "255.255.255.255" @@ -285,7 +285,7 @@ static int cdma_connman_probe(struct ofono_cdma_connman *cm, DBG(""); - if (stat(TUN_SYSFS_DIR, &st) < 0) { + if (stat(TUN_DEV, &st) < 0) { ofono_error("Missing support for TUN/TAP devices"); return -ENODEV; } |