summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorManfred Kober <manfred.kober@gmx.de>2012-06-21 09:40:32 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-06-25 09:33:05 +0300
commit94647cff574377932b17e415d394812c3159884f (patch)
tree8d81846b45ba9951f1ddac10b222843e4468e356 /src/device.c
parent8d403887bfd3facff8ecba0424d5fefd92bd8803 (diff)
downloadconnman-94647cff574377932b17e415d394812c3159884f.tar.gz
connman-94647cff574377932b17e415d394812c3159884f.tar.bz2
connman-94647cff574377932b17e415d394812c3159884f.zip
device: Consider blacklisted interfaces from main.conf when filtering
Interfaces blacklisted in main.conf are now also taken into account by connman_device_isfiltered. This is done in addition to what gets passed with -i or -I on the command line.
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c
index 3a5e467d..4a80b767 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1113,6 +1113,7 @@ int __connman_device_request_hidden_scan(struct connman_device *device,
connman_bool_t __connman_device_isfiltered(const char *devname)
{
char **pattern;
+ char **blacklisted_interfaces;
if (device_filter == NULL)
goto nodevice;
@@ -1131,7 +1132,7 @@ nodevice:
}
if (nodevice_filter == NULL)
- return FALSE;
+ goto list;
for (pattern = nodevice_filter; *pattern; pattern++) {
if (g_pattern_match_simple(*pattern, devname) == TRUE) {
@@ -1140,6 +1141,19 @@ nodevice:
}
}
+list:
+ blacklisted_interfaces =
+ connman_setting_get_string_list("BlacklistedInterfaces");
+ if (blacklisted_interfaces == NULL)
+ return FALSE;
+
+ for (pattern = blacklisted_interfaces; *pattern; pattern++) {
+ if (g_str_has_prefix(devname, *pattern) == TRUE) {
+ DBG("ignoring device %s (blacklist)", devname);
+ return TRUE;
+ }
+ }
+
return FALSE;
}