}
static int set_tethering(struct connman_technology *technology,
- const char *bridge, connman_bool_t enabled)
+ connman_bool_t enabled)
{
- const char *ident, *passphrase;
+ const char *ident, *passphrase, *bridge;
ident = technology->tethering_ident;
passphrase = technology->tethering_passphrase;
technology->driver->set_tethering == NULL)
return -EOPNOTSUPP;
+ bridge = __connman_tethering_get_bridge();
+ if (bridge == NULL)
+ return -EOPNOTSUPP;
+
if (technology->type == CONNMAN_SERVICE_TYPE_WIFI &&
(ident == NULL || passphrase == NULL))
return -EINVAL;
if (g_str_equal(name, "Tethering") == TRUE) {
int err;
connman_bool_t tethering;
- const char *bridge;
if (type != DBUS_TYPE_BOOLEAN)
return __connman_error_invalid_arguments(msg);
if (technology->tethering == tethering)
return __connman_error_in_progress(msg);
- bridge = __connman_tethering_get_bridge();
- if (bridge == NULL)
- return __connman_error_not_supported(msg);
-
- err = set_tethering(technology, bridge, tethering);
+ err = set_tethering(technology, tethering);
if (err < 0)
return __connman_error_failed(msg, -err);