Hi Lucio,
On Tue, Sep 21, 2010 at 03:16:43PM -0300, Lucio Maciel wrote:
> From: Lucio Maciel <[email protected]>
>
> Support multiple comma-separeted interfaces for -i and -I
> command line option.
>
> E.g.:
> connmand -i eth*,wlan*,ppp*
> connmand -I virbr*,usb*,ppp*
>
> ---
> src/element.c | 34 ++++++++++++++++++++++------------
> 1 files changed, 22 insertions(+), 12 deletions(-)
>
> diff --git a/src/element.c b/src/element.c
> index 3e745da..0bf72f6 100644
> --- a/src/element.c
> +++ b/src/element.c
> @@ -36,8 +36,8 @@ static DBusConnection *connection;
> static GNode *element_root = NULL;
> static GSList *driver_list = NULL;
> -static gchar *device_filter = NULL;
> -static gchar *nodevice_filter = NULL;
> +static gchar **device_filter = NULL;
> +static gchar **nodevice_filter = NULL;
> static gboolean started = FALSE;
> @@ -1063,21 +1063,28 @@ static void register_element(gpointer data,
> gpointer user_data)
> gboolean __connman_element_device_isfiltered(const char *devname)
> {
> + char **pattern;
> +
> if (device_filter == NULL)
> goto nodevice;
> - if (g_pattern_match_simple(device_filter, devname) == FALSE) {
> - DBG("ignoring device %s (match)", devname);
> - return TRUE;
> + for (pattern = device_filter; *pattern; pattern++) {
> + if (g_pattern_match_simple(*pattern, devname) == TRUE)
> + return FALSE;
We should keep the same logic as the curent one, which means:
+ for (pattern = device_filter; *pattern; pattern++) {
+ if (g_pattern_match_simple(*pattern, devname) == FALSE)
+ return TRUE;
+
And then continue with the nodevice case.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman