Commit 9c76efa5 authored by Santtu Lakkala's avatar Santtu Lakkala

[connman] Set properties to network even if they are empty. Contributes to JB#45980

parent 8be80d41
......@@ -5467,36 +5467,9 @@ static DBusMessage *disconnect_service(DBusConnection *conn,
bool __connman_service_remove(struct connman_service *service)
{
size_t i;
if (service->type == CONNMAN_SERVICE_TYPE_ETHERNET ||
service->type == CONNMAN_SERVICE_TYPE_GADGET)
return false;
if (service->immutable || service->hidden ||
__connman_provider_is_immutable(service->provider))
return false;
/* Not clear what was the meaning of this restriction: */
// if (!service->favorite && service->state !=
// CONNMAN_SERVICE_STATE_FAILURE)
// return false;
/*
* We don't want the service files to stay around forever unless the
* service file belongs to a VPN connection. The VPN connection specific
* configuration files contain autoconnect and split routing information
* that should be kept between connman restarts. Otherwise autoconnect
* for VPNs cannot operate. The VPN connection service file is removed
* when vpnd removes the connection. It should not be removed here.
*/
if (service->type != CONNMAN_SERVICE_TYPE_VPN)
__connman_storage_remove_service(service->identifier);
__connman_service_disconnect(service);
#define SVC_PROP(name, member, access) \
{ name, G_STRUCT_OFFSET(struct connman_service, member), access }
struct {
const struct {
const char *name;
size_t offset;
enum connman_access default_access;
......@@ -5526,6 +5499,32 @@ bool __connman_service_remove(struct connman_service *service)
};
#undef SVC_PROP
if (service->type == CONNMAN_SERVICE_TYPE_ETHERNET ||
service->type == CONNMAN_SERVICE_TYPE_GADGET)
return false;
if (service->immutable || service->hidden ||
__connman_provider_is_immutable(service->provider))
return false;
/* Not clear what was the meaning of this restriction: */
// if (!service->favorite && service->state !=
// CONNMAN_SERVICE_STATE_FAILURE)
// return false;
/*
* We don't want the service files to stay around forever unless the
* service file belongs to a VPN connection. The VPN connection specific
* configuration files contain autoconnect and split routing information
* that should be kept between connman restarts. Otherwise autoconnect
* for VPNs cannot operate. The VPN connection service file is removed
* when vpnd removes the connection. It should not be removed here.
*/
if (service->type != CONNMAN_SERVICE_TYPE_VPN)
__connman_storage_remove_service(service->identifier);
__connman_service_disconnect(service);
for (i = 0; i < G_N_ELEMENTS(cleared_properties); i++) {
char **member = &G_STRUCT_MEMBER(char *, service,
cleared_properties[i].offset);
......@@ -7620,11 +7619,9 @@ static void prepare_8021x(struct connman_service *service)
"WiFi.AnonymousIdentity",
service->anonymous_identity);
if (service->ca_cert)
connman_network_set_string(service->network, "WiFi.CACert",
connman_network_set_string(service->network, "WiFi.CACert",
service->ca_cert);
else if (service->ca_cert_file)
connman_network_set_string(service->network, "WiFi.CACertFile",
connman_network_set_string(service->network, "WiFi.CACertFile",
service->ca_cert_file);
if (service->subject_match)
......@@ -7643,21 +7640,17 @@ static void prepare_8021x(struct connman_service *service)
connman_network_set_string(service->network, "WiFi.DomainMatch",
service->domain_match);
if (service->client_cert)
connman_network_set_string(service->network,
connman_network_set_string(service->network,
"WiFi.ClientCert",
service->client_cert);
else if (service->client_cert_file)
connman_network_set_string(service->network,
connman_network_set_string(service->network,
"WiFi.ClientCertFile",
service->client_cert_file);
if (service->private_key)
connman_network_set_string(service->network,
connman_network_set_string(service->network,
"WiFi.PrivateKey",
service->private_key);
else if (service->private_key_file)
connman_network_set_string(service->network,
connman_network_set_string(service->network,
"WiFi.PrivateKeyFile",
service->private_key_file);
......@@ -7666,8 +7659,7 @@ static void prepare_8021x(struct connman_service *service)
"WiFi.PrivateKeyPassphrase",
service->private_key_passphrase);
if (service->phase2)
connman_network_set_string(service->network, "WiFi.Phase2",
connman_network_set_string(service->network, "WiFi.Phase2",
service->phase2);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment