[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH 1/2 master] Make ssid and wepkey in boot params and stage 1 kickstart work (#473803)



> @@ -2119,4 +2186,33 @@ int get_connection(iface_t *iface) {
>      return 3;
>  }
>  
> +int isWirelessDevice(char *device) {
> +    NMClient *client = NULL;
> +    const GPtrArray *devices;
> +    const char *iface;
> +    int i;
> +
> +    client = nm_client_new();
> +    if (!client) {
> +        logMessage(ERROR, "%s (%d): could not connect to system bus",
> +                   __func__, __LINE__);
> +        return 0;
> +    }
> +
> +    devices = nm_client_get_devices(client);
> +    for (i = 0; devices && (i < devices->len); i++) {
> +        NMDevice *candidate = g_ptr_array_index(devices, i);
> +        if (NM_IS_DEVICE_WIFI (candidate)) {
> +            iface = nm_device_get_iface(candidate);
> +            if (!strcmp(device, iface)) {
> +                g_object_unref(client);
> +                return 1;
> +            }
> +        }
> +
> +    }
> +    g_object_unref(client);
> +    return 0;
> +}
> +

We already have isWireless in isys.py.  It might be worth taking your
above function, moving it to isys.c, and then hooking it up so
isWireless uses that.  Two implementations of the same thing when we
don't need them isn't so great.

- Chris


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]