diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2013-03-07 10:24:37 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-03-07 10:55:55 +0200 |
commit | b7aa76b6ea4e2da2400320c000c000ca8da77b4d (patch) | |
tree | afe595ffda54d835659bc944e6d6abdd1e88b845 /src/device.c | |
parent | c6031d229acb3694db2660a98428156ebc0b6cde (diff) | |
download | connman-b7aa76b6ea4e2da2400320c000c000ca8da77b4d.tar.gz connman-b7aa76b6ea4e2da2400320c000c000ca8da77b4d.tar.bz2 connman-b7aa76b6ea4e2da2400320c000c000ca8da77b4d.zip |
device: Check positive device filter correctly
The -i or --device command line option contains the device names
that we should use. Unfortunately the check fails if there are
multiple interfaces in that list and we ignore the interfaces instead.
Fixes BMC#25979
Diffstat (limited to 'src/device.c')
-rw-r--r-- | src/device.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/device.c b/src/device.c index fbfb2b58..2e0dbdca 100644 --- a/src/device.c +++ b/src/device.c @@ -1306,17 +1306,23 @@ connman_bool_t __connman_device_isfiltered(const char *devname) { char **pattern; char **blacklisted_interfaces; + gboolean match; if (device_filter == NULL) goto nodevice; - for (pattern = device_filter; *pattern; pattern++) { - if (g_pattern_match_simple(*pattern, devname) == FALSE) { - DBG("ignoring device %s (match)", devname); - return TRUE; + for (pattern = device_filter, match = FALSE; *pattern; pattern++) { + if (g_pattern_match_simple(*pattern, devname) == TRUE) { + match = TRUE; + break; } } + if (match == FALSE) { + DBG("ignoring device %s (match)", devname); + return TRUE; + } + nodevice: if (g_pattern_match_simple("dummy*", devname) == TRUE) { DBG("ignoring dummy networking devices"); |