summaryrefslogtreecommitdiff
path: root/drivers/ifxmodem/gprs-context.c
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2017-08-22 18:16:29 +0200
committerDenis Kenzior <denkenz@gmail.com>2017-08-22 23:24:59 -0500
commit8d690efa834a12fb528b820cc8a7c83f5afab5b4 (patch)
tree0bc6a3a6c47065f505fc7966fc1cc8ad2aa3765f /drivers/ifxmodem/gprs-context.c
parentfb179957210a5a6c3726ea4b285e88009e6a4cd1 (diff)
downloadofono-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/ifxmodem/gprs-context.c')
-rw-r--r--drivers/ifxmodem/gprs-context.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ifxmodem/gprs-context.c b/drivers/ifxmodem/gprs-context.c
index b7b102b9..52a3672c 100644
--- a/drivers/ifxmodem/gprs-context.c
+++ b/drivers/ifxmodem/gprs-context.c
@@ -42,7 +42,7 @@
#include "ifxmodem.h"
-#define TUN_SYSFS_DIR "/sys/devices/virtual/misc/tun"
+#define TUN_DEV "/dev/net/tun"
#define STATIC_IP_NETMASK "255.255.255.255"
@@ -470,7 +470,7 @@ static int ifx_gprs_context_probe(struct ofono_gprs_context *gc,
DBG("");
- if (stat(TUN_SYSFS_DIR, &st) < 0) {
+ if (stat(TUN_DEV, &st) < 0) {
ofono_error("Missing support for TUN/TAP devices");
return -ENODEV;
}