diff options
author | Daniel Golle <daniel@makrotopia.org> | 2020-04-06 23:58:40 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2020-04-14 00:22:21 +0100 |
commit | f37d6342367b4f8393f9693edd96b12dfa016399 (patch) | |
tree | 39814f5b920a29263d3d25bd9991a4e906297b8b /package/network/services/hostapd/src | |
parent | 35f208da3c13cc16227f229f8aea14c4f0a06928 (diff) | |
download | upstream-f37d6342367b4f8393f9693edd96b12dfa016399.tar.gz upstream-f37d6342367b4f8393f9693edd96b12dfa016399.tar.bz2 upstream-f37d6342367b4f8393f9693edd96b12dfa016399.zip |
hostapd: reduce to a single instance per service
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/network/services/hostapd/src')
-rw-r--r-- | package/network/services/hostapd/src/src/ap/ubus.c | 14 | ||||
-rw-r--r-- | package/network/services/hostapd/src/wpa_supplicant/ubus.c | 17 |
2 files changed, 2 insertions, 29 deletions
diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index 011c32a8b1..aeea310594 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -1115,24 +1115,12 @@ static struct ubus_object_type daemon_object_type = void hostapd_ubus_add(struct hapd_interfaces *interfaces) { struct ubus_object *obj = &interfaces->ubus; - char *name; - int name_len; int ret; if (!hostapd_ubus_init()) return; - name_len = strlen("hostapd") + 1; - if (interfaces->name) - name_len += strlen(interfaces->name) + 1; - - name = malloc(name_len); - strcpy(name, "hostapd"); - if (interfaces->name) { - strcat(name, "."); - strcat(name, interfaces->name); - } - obj->name = name; + obj->name = strdup("hostapd"); obj->type = &daemon_object_type; obj->methods = daemon_object_type.methods; diff --git a/package/network/services/hostapd/src/wpa_supplicant/ubus.c b/package/network/services/hostapd/src/wpa_supplicant/ubus.c index 5450b24476..4bb92a7b66 100644 --- a/package/network/services/hostapd/src/wpa_supplicant/ubus.c +++ b/package/network/services/hostapd/src/wpa_supplicant/ubus.c @@ -322,27 +322,12 @@ static struct ubus_object_type wpas_daemon_object_type = void wpas_ubus_add(struct wpa_global *global) { struct ubus_object *obj = &global->ubus_global; - char *name; - int name_len; int ret; if (!wpas_ubus_init()) return; - name_len = strlen("wpa_supplicant") + 1; - if (global->params.name) - name_len += strlen(global->params.name) + 1; - - name = malloc(name_len); - strcpy(name, "wpa_supplicant"); - - if (global->params.name) - { - strcat(name, "."); - strcat(name, global->params.name); - } - - obj->name = name; + obj->name = strdup("wpa_supplicant"); obj->type = &wpas_daemon_object_type; obj->methods = wpas_daemon_object_type.methods; |