From: Kim Gibyoung Date: Fri, 1 Feb 2013 13:06:06 +0000 (+0900) Subject: Fix bug and Smack applyed X-Git-Tag: 2.1b_release~5^2~21^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af39c1429836e788a0aedc2bbb4a3e1c8aed9f9c;p=platform%2Fcore%2Fconnectivity%2Fwifi-direct-manager.git Fix bug and Smack applyed Change-Id: I837fc8272feb72ea7fbf8588cd2fe422c5567dd7 --- diff --git a/debian/changelog b/debian/changelog index 51e4109..40b2fc1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +wfi-direct-manager (0.6.2) precise; urgency=low + + * Fix bug(N_SE-23902) + * Fix Group Created event issue + * SMACK is applyed + * Git : framework/connectivity/wifi-direct-manager + * Tag : wifi-direct-manager_0.6.2 + + -- Gibyoung Kim Fri, 1 Feb 2013 22:3:8 +0900 + wfi-direct-manager (0.6.1) precise; urgency=low * Fix bug(N_SE-23716) diff --git a/files/p2p_supplicant b/files/p2p_supplicant index 3b801f8..d705287 100755 Binary files a/files/p2p_supplicant and b/files/p2p_supplicant differ diff --git a/oem/include/wifi-direct-oem.h b/oem/include/wifi-direct-oem.h index 4270598..430e51f 100755 --- a/oem/include/wifi-direct-oem.h +++ b/oem/include/wifi-direct-oem.h @@ -30,7 +30,7 @@ int wfd_oem_destroy(void); int wfd_oem_activate(void); int wfd_oem_deactivate(void); int wfd_oem_connect(unsigned char mac_addr[6], wifi_direct_wps_type_e wps_config); -int wfd_oem_wps_pbc_start(void); +int wfd_oem_wps_pbc_start(unsigned char mac_addr[6]); int wfd_oem_wps_pin_start(unsigned char mac_addr[6]); int wfd_oem_disconnect(void); int wfd_oem_disconnect_sta(unsigned char mac_addr[6]); @@ -79,7 +79,7 @@ struct wfd_oem_operations { int (*wfd_oem_activate)(void); int (*wfd_oem_deactivate)(void); int (*wfd_oem_connect)(unsigned char mac_addr[6], wifi_direct_wps_type_e wps_config); - int (*wfd_oem_wps_pbc_start)(void); + int (*wfd_oem_wps_pbc_start)(unsigned char mac_addr[6]); int (*wfd_oem_wps_pin_start)(unsigned char mac_addr[6]); int (*wfd_oem_disconnect)(void); int (*wfd_oem_disconnect_sta)(unsigned char mac_addr[6]); diff --git a/oem/wifi-direct-oem.c b/oem/wifi-direct-oem.c index 1d0270b..0951827 100644 --- a/oem/wifi-direct-oem.c +++ b/oem/wifi-direct-oem.c @@ -83,7 +83,7 @@ int wfd_oem_connect(unsigned char mac_addr[6], wifi_direct_wps_type_e wps_config return (g_ops->wfd_oem_connect(mac_addr, wps_config)); } -int wfd_oem_wps_pbc_start() +int wfd_oem_wps_pbc_start(unsigned char mac_addr[6]) { if (NULL == g_ops->wfd_oem_wps_pbc_start) { @@ -91,7 +91,7 @@ int wfd_oem_wps_pbc_start() return false; } - return (g_ops->wfd_oem_wps_pbc_start()); + return (g_ops->wfd_oem_wps_pbc_start(mac_addr)); } int wfd_oem_wps_pin_start(unsigned char mac_addr[6]) diff --git a/packaging/wifi-direct-manager.spec b/packaging/wifi-direct-manager.spec index ad9aa58..2045290 100755 --- a/packaging/wifi-direct-manager.spec +++ b/packaging/wifi-direct-manager.spec @@ -1,6 +1,6 @@ Name: wifi-direct-manager Summary: Wi-Fi Direct manger -Version: 0.6.1 +Version: 0.6.2 Release: 1 Group: TO_BE_FILLED License: Apache License Version 2.0 @@ -14,7 +14,6 @@ BuildRequires: pkgconfig(capi-appfw-application) BuildRequires: cmake - %description Wi-Fi Direct manager @@ -62,9 +61,9 @@ chmod 755 /usr/bin/wifi-direct-server.sh chmod 755 /usr/bin/wifi-direct-dhcp.sh chmod 755 /usr/sbin/p2p_supp.sh -vconftool set -t int memory/wifi_direct/state 0 -u 5000 -i -vconftool set -t int memory/private/wifi_direct_manager/dhcp_ip_lease 0 -i -vconftool set -t string memory/private/wifi_direct_manager/dhcpc_server_ip 0.0.0.0 -i +vconftool set -t int memory/wifi_direct/state 0 -u 5000 -i -f +vconftool set -t int memory/private/wifi_direct_manager/dhcp_ip_lease 0 -i -f +vconftool set -t string memory/private/wifi_direct_manager/dhcpc_server_ip 0.0.0.0 -i -f %postun diff --git a/plugin/wpasupplicant/include/wifi-direct-wpasupplicant.h b/plugin/wpasupplicant/include/wifi-direct-wpasupplicant.h index 05d62ab..e365cc5 100644 --- a/plugin/wpasupplicant/include/wifi-direct-wpasupplicant.h +++ b/plugin/wpasupplicant/include/wifi-direct-wpasupplicant.h @@ -410,8 +410,8 @@ int wfd_ws_deactivate(); int wfd_ws_connect(unsigned char mac_addr[6], wifi_direct_wps_type_e wps_config); int wfd_ws_disconnect(); int wfd_ws_disconnect_sta(unsigned char mac_addr[6]); -int wfd_ws_wps_pbc_start(); -int wfd_ws_wps_pin_start(unsigned char peer_addr[6]); +int wfd_ws_wps_pbc_start(unsigned char mac_addr[6]); +int wfd_ws_wps_pin_start(unsigned char mac_addr[6]); bool wfd_ws_is_discovery_enabled(); int wfd_ws_start_discovery(bool listen_only, int timeout); int wfd_ws_cancel_discovery(); diff --git a/plugin/wpasupplicant/src/wifi-direct-plugin.c b/plugin/wpasupplicant/src/wifi-direct-plugin.c index 0c636a4..f6cfeab 100644 --- a/plugin/wpasupplicant/src/wifi-direct-plugin.c +++ b/plugin/wpasupplicant/src/wifi-direct-plugin.c @@ -51,7 +51,7 @@ GList *g_conn_peer_addr; static unsigned char g_assoc_sta_mac[6]; static unsigned char g_disassoc_sta_mac[6]; char g_wps_pin[9]; -static int g_pin_event_block; +static int g_wps_event_block; enum current_conn_direction { @@ -967,12 +967,10 @@ void __parsing_ws_event(char* buf, ws_event_s *event) case WS_EVENT_GROUP_FORMATION_SUCCESS: case WS_EVENT_GROUP_FORMATION_FAILURE: - g_pin_event_block = 0; + event->id = event_id; break; case WS_EVENT_GROUP_STARTED: - if (g_pin_event_block) - g_pin_event_block = 0; event->id = WS_EVENT_GROUP_STARTED; WDP_LOGD( "WS EVENT : [WS_EVENT_GROUP_STARTED]\n"); { @@ -1504,10 +1502,10 @@ static gboolean __ws_event_callback(GIOChannel * source, case WS_EVENT_PROVISION_DISCOVERY_RESPONSE_DISPLAY: { - if (g_pin_event_block) + if (g_wps_event_block) break; - g_pin_event_block = 1; + g_wps_event_block = 1; unsigned char la_mac_addr[6]; wfd_macaddr_atoe(event.peer_mac_address, la_mac_addr); memset(g_incomming_peer_mac_address, 0, sizeof(g_incomming_peer_mac_address)); @@ -1521,10 +1519,10 @@ static gboolean __ws_event_callback(GIOChannel * source, case WS_EVENT_PROVISION_DISCOVERY_RESPONSE_KEYPAD: { - if (g_pin_event_block) + if (g_wps_event_block) break; - g_pin_event_block = 1; + g_wps_event_block = 1; unsigned char la_mac_addr[6]; wfd_macaddr_atoe(event.peer_mac_address, la_mac_addr); memset(g_incomming_peer_mac_address, 0, sizeof(g_incomming_peer_mac_address)); @@ -1538,10 +1536,10 @@ static gboolean __ws_event_callback(GIOChannel * source, case WS_EVENT_PROVISION_DISCOVERY_DISPLAY: case WS_EVENT_PROVISION_DISCOVERY_KEYPAD: { - if (g_pin_event_block) + if (g_wps_event_block) break; - g_pin_event_block = 1; + g_wps_event_block = 1; WDP_LOGD("Incomming PROV_DISC [%d]", event.id); unsigned char la_mac_addr[6]; wfd_macaddr_atoe(event.peer_mac_address, la_mac_addr); @@ -1566,8 +1564,15 @@ static gboolean __ws_event_callback(GIOChannel * source, } break; + case WS_EVENT_GROUP_FORMATION_SUCCESS: + case WS_EVENT_GROUP_FORMATION_FAILURE: + g_wps_event_block = 0; + break; + case WS_EVENT_GROUP_STARTED: { + g_wps_event_block = 0; + if(wfd_ws_is_groupowner()) { WDP_LOGD(" CHECK : It's AP... \n"); @@ -1660,8 +1665,7 @@ static gboolean __ws_event_callback(GIOChannel * source, case WS_EVENT_STA_CONNECTED: { - if (g_pin_event_block) - g_pin_event_block = 0; + g_wps_event_block = 0; GList *element = NULL; element = g_list_find_custom(g_conn_peer_addr, event.peer_mac_address, glist_compare_peer_mac_cb); if(element == NULL) @@ -2163,7 +2167,7 @@ int wfd_ws_deactivate() int res_buffer_len=sizeof(res_buffer); int result = 0; - g_pin_event_block = 0; + g_wps_event_block = 0; // stop p2p_find wfd_ws_cancel_discovery(); @@ -2225,11 +2229,11 @@ int wfd_ws_deactivate() return true; } -int wfd_ws_wps_pbc_start(void) +int wfd_ws_wps_pbc_start(unsigned char peer_addr[6]) { __WDP_LOG_FUNC_ENTER__; - char cmd[8] = {0, }; + char cmd[40] = {0, }; char res_buffer[1024]={0,}; int res_buffer_len = sizeof(res_buffer); int result; @@ -2241,7 +2245,20 @@ int wfd_ws_wps_pbc_start(void) return false; } - strncpy(cmd, CMD_WPS_PUSHBUTTON_START, sizeof(cmd)); + char tmp_mac[6] = {0,}; + + if (peer_addr == NULL) { + if (memcmp(g_incomming_peer_mac_address, tmp_mac, 6) == 0) + snprintf(cmd, sizeof(cmd), "%s", CMD_WPS_PUSHBUTTON_START); + else + snprintf(cmd, sizeof(cmd), "%s p2p_dev_addr=" MACSTR "", CMD_WPS_PUSHBUTTON_START, MAC2STR(g_incomming_peer_mac_address)); + } else if (memcmp(peer_addr, tmp_mac, 6) != 0){ + snprintf(cmd, sizeof(cmd), "%s p2p_dev_addr=" MACSTR "", CMD_WPS_PUSHBUTTON_START, MAC2STR(peer_addr)); + } else { + WDP_LOGE("Peer address is incorrent"); + return false; + } + result = __send_wpa_request(g_control_sockfd, cmd, (char*)res_buffer, res_buffer_len); WDP_LOGD( "__send_wpa_request(WPS_PBC) result=[%d]\n", result); if (result < 0) @@ -2550,7 +2567,7 @@ int wfd_ws_disconnect() int res_buffer_len = sizeof(res_buffer); int result; - g_pin_event_block = 0; + g_wps_event_block = 0; snprintf(cmd, sizeof(cmd), "%s %s", CMD_GROUP_REMOVE, DEFAULT_IF_NAME); result = __send_wpa_request(g_control_sockfd, cmd, (char*)res_buffer, res_buffer_len); @@ -2606,7 +2623,7 @@ bool wfd_ws_flush() int res_buffer_len=sizeof(res_buffer); int result = 0; - g_pin_event_block = 0; + g_wps_event_block = 0; // Skip checking result.. strncpy(cmd, CMD_FLUSH, sizeof(cmd)); diff --git a/src/wifi-direct-client-handler.c b/src/wifi-direct-client-handler.c index 82cee2b..664b08d 100644 --- a/src/wifi-direct-client-handler.c +++ b/src/wifi-direct-client-handler.c @@ -646,7 +646,7 @@ void wfd_server_process_client_request(wifi_direct_client_request_s * client_req if (ret == true) { if (wfd_server->config_data.want_persistent_group == false) - wfd_oem_wps_pbc_start(); + wfd_oem_wps_pbc_start(client_req->data.mac_addr); snprintf(noti.param1, sizeof(noti.param1), MACSTR, MAC2STR(client_req->data.mac_addr)); @@ -834,7 +834,7 @@ void wfd_server_process_client_request(wifi_direct_client_request_s * client_req wps_config == WIFI_DIRECT_WPS_TYPE_PIN_KEYPAD) wfd_oem_wps_pin_start(client_req->data.mac_addr); else - wfd_oem_wps_pbc_start(); + wfd_oem_wps_pbc_start(client_req->data.mac_addr); break; } diff --git a/src/wifi-direct-event-handler.c b/src/wifi-direct-event-handler.c index 4f3f2a4..648dbfa 100644 --- a/src/wifi-direct-event-handler.c +++ b/src/wifi-direct-event-handler.c @@ -776,7 +776,7 @@ void wfd_server_process_event(wfd_event_t event) if (wfd_oem_is_groupowner()) { // provision request comes, when we sent 'invite'... - wfd_oem_wps_pbc_start(); + wfd_oem_wps_pbc_start(NULL); } else { diff --git a/wifi-direct-manager.manifest b/wifi-direct-manager.manifest index f855288..1e00651 100644 --- a/wifi-direct-manager.manifest +++ b/wifi-direct-manager.manifest @@ -1,8 +1,8 @@ - - - + + +