summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChengyi Zhao <chengyix.zhao@gmail.com>2013-10-25 11:24:37 +0300
committerChengyi Zhao <chengyi1.zhao@archermind.com>2013-10-31 16:46:10 +0800
commit9b0177687eaa09a07b48b9ef7aaedb0a8ea4a5e4 (patch)
tree32e3064cac498ea9866da014600d37a92a42a0aa
parent5a22bc4edb22b103545763e257c62781f03c67a7 (diff)
downloadconnman-9b0177687eaa09a07b48b9ef7aaedb0a8ea4a5e4.tar.gz
connman-9b0177687eaa09a07b48b9ef7aaedb0a8ea4a5e4.tar.bz2
connman-9b0177687eaa09a07b48b9ef7aaedb0a8ea4a5e4.zip
Upstream/rtnl: Set service type to unknown if interface can not be found
If the system can't find the related network interface in /sys/class/net/, ConnMan will set the interface type to "unknown". Upstream commit Id: d06050d3ad668b0ba67b33869d7a4a281c300e0f Change-Id: I417c7eafd0b000fd6d42f9be07fd78ed34aeac86 Signed-off-by: Chengyi Zhao <chengyi1.zhao@archermind.com>
-rw-r--r--src/rtnl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rtnl.c b/src/rtnl.c
index af8ab707..9a77efc1 100644
--- a/src/rtnl.c
+++ b/src/rtnl.c
@@ -139,8 +139,11 @@ static void read_uevent(struct interface_data *interface)
g_free(filename);
- if (f == NULL)
+ if (!f) {
+ interface->service_type = CONNMAN_SERVICE_TYPE_UNKNOWN;
+ interface->device_type = CONNMAN_DEVICE_TYPE_UNKNOWN;
return;
+ }
found_devtype = FALSE;
while (fgets(line, sizeof(line), f)) {