From: Jukka Rissanen Date: Thu, 7 Mar 2013 08:24:37 +0000 (+0200) Subject: device: Check positive device filter correctly X-Git-Tag: 1.13~111 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7aa76b6ea4e2da2400320c000c000ca8da77b4d;p=platform%2Fupstream%2Fconnman.git 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 --- diff --git a/src/device.c b/src/device.c index fbfb2b5..2e0dbdc 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");