diff --git a/files/dawn.config b/files/dawn.config index d539585..104c130 100644 --- a/files/dawn.config +++ b/files/dawn.config @@ -1,5 +1,5 @@ config 'settings' 'dawn' - option broadcast_ip '192.186.1.255' + option broadcast_ip '10.0.0.255' option broadcast_port '1025' option sort_order 'cfsb' option hostapd_dir '/var/run/hostapd' diff --git a/src/main.c b/src/main.c index 855a622..574c798 100644 --- a/src/main.c +++ b/src/main.c @@ -56,12 +56,11 @@ int main(int argc, char **argv) pthread_t tid; pthread_create(&tid, NULL, &remove_thread, NULL); - free_list(probe_list_head); - - pthread_mutex_destroy(&list_mutex); - - dawn_init_ubus(ubus_socket, opt_hostapd_dir); + // free ressources + pthread_mutex_destroy(&list_mutex); + free_list(probe_list_head); + return 0; } \ No newline at end of file diff --git a/src/ubus.c b/src/ubus.c index 094765e..bb42be7 100644 --- a/src/ubus.c +++ b/src/ubus.c @@ -38,7 +38,7 @@ static int hostapd_notify(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg); static int add_subscriber(char* name); -//int parse_to_probe_req(struct blob_attr *msg, probe_entry* prob_req); +int parse_to_probe_req(struct blob_attr *msg, probe_entry* prob_req); static int subscribe_to_hostapd_interfaces(char* hostapd_dir); static int decide_function(probe_entry* prob_req) @@ -90,7 +90,6 @@ static int hostapd_notify(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - // write probe to table probe_entry prob_req; parse_to_probe_req(msg, &prob_req); insert_to_list(prob_req); @@ -101,6 +100,7 @@ static int hostapd_notify(struct ubus_context *ctx, struct ubus_object *obj, send_string(str); printf("[WC] Hostapd-Probe: %s : %s\n", method, str); + print_list(); // deny access @@ -154,7 +154,7 @@ static int subscribe_to_hostapd_interfaces(char* hostapd_dir) add_subscriber(subscribe_name); } } - free(hostapd_dir); // free string + //free(hostapd_dir); // free string return 0; }