diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2011-02-10 17:13:46 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-02-10 17:13:46 +0100 |
commit | cfe55847a066960b05c73e27436500c58f9efbcb (patch) | |
tree | 62770a9ccda6db428eb290b2ba24760c8d89f2ac /src/tethering.c | |
parent | fd9bf56e5fa7a3441fe80aedca6725b72a232d67 (diff) | |
download | connman-cfe55847a066960b05c73e27436500c58f9efbcb.tar.gz connman-cfe55847a066960b05c73e27436500c58f9efbcb.tar.bz2 connman-cfe55847a066960b05c73e27436500c58f9efbcb.zip |
tethering: Check for kernel bridge support
Diffstat (limited to 'src/tethering.c')
-rw-r--r-- | src/tethering.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tethering.c b/src/tethering.c index 2609ab02..705f5ee5 100644 --- a/src/tethering.c +++ b/src/tethering.c @@ -23,6 +23,8 @@ #include <config.h> #endif +#include <sys/types.h> +#include <sys/stat.h> #include <unistd.h> #include <stdio.h> #include <sys/ioctl.h> @@ -33,6 +35,8 @@ #include <gdhcp/gdhcp.h> +#define BRIDGE_SYSFS_DIR "/sys/module/bridge" + #define BRIDGE_NAME "tether" #define BRIDGE_IP "192.168.218.1" #define BRIDGE_BCAST "192.168.218.255" @@ -47,6 +51,13 @@ static GDHCPServer *tethering_dhcp_server = NULL; const char *__connman_tethering_get_bridge(void) { + struct stat st; + + if (stat(BRIDGE_SYSFS_DIR, &st) < 0) { + connman_error("Missing support for 802.1d ethernet bridging"); + return NULL; + } + return BRIDGE_NAME; } |