Fix subtype conversion for networks
authorMarcel Holtmann <marcel@holtmann.org>
Thu, 1 Jan 2009 18:45:18 +0000 (19:45 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 1 Jan 2009 18:45:18 +0000 (19:45 +0100)
src/network.c

index 977a48e..1f4b265 100644 (file)
@@ -258,6 +258,12 @@ struct connman_network *connman_network_create(const char *identifier,
        network->element.index = -1;
 
        switch (type) {
+       case CONNMAN_NETWORK_TYPE_UNKNOWN:
+               network->element.subtype = CONNMAN_ELEMENT_SUBTYPE_UNKNOWN;
+               break;
+       case CONNMAN_NETWORK_TYPE_WIFI:
+               network->element.subtype = CONNMAN_ELEMENT_SUBTYPE_WIFI;
+               break;
        case CONNMAN_NETWORK_TYPE_BLUETOOTH_PAN:
        case CONNMAN_NETWORK_TYPE_BLUETOOTH_DUN:
                network->element.subtype = CONNMAN_ELEMENT_SUBTYPE_BLUETOOTH;
@@ -265,9 +271,6 @@ struct connman_network *connman_network_create(const char *identifier,
        case CONNMAN_NETWORK_TYPE_HSO:
                network->element.subtype = CONNMAN_ELEMENT_SUBTYPE_CELLULAR;
                break;
-       default:
-               network->element.subtype = CONNMAN_ELEMENT_SUBTYPE_UNKNOWN;
-               break;
        }
 
        network->element.network = network;