diff options
author | Mohammed Javid <mjavid@codeaurora.org> | 2017-05-26 12:26:02 +0530 |
---|---|---|
committer | Skylar Chang <chiaweic@codeaurora.org> | 2017-10-20 22:23:43 -0700 |
commit | 0e48e5e79c16f0d0fee2efd729eb5e3eba6be917 (patch) | |
tree | 169cb8cf614205d36cb5e6d0c1f5bf38f94cf30b /ipacm/src/IPACM_Wlan.cpp | |
parent | 5b801e1edf7e8788d788f7edf0d2656403b9ea44 (diff) | |
download | ipacfg-mgr-0e48e5e79c16f0d0fee2efd729eb5e3eba6be917.tar.gz |
ipacm: Add flag -Wall -Werror and fix warnings
Add flag -Wall -Werror in Android.mk and fix all the warnings and
errors.
Change-Id: I86de057f5cc38ec9944f4988ac87724ba00b2e52
Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com>
Diffstat (limited to 'ipacm/src/IPACM_Wlan.cpp')
-rw-r--r-- | ipacm/src/IPACM_Wlan.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/ipacm/src/IPACM_Wlan.cpp b/ipacm/src/IPACM_Wlan.cpp index a36f0f9..a594fe5 100644 --- a/ipacm/src/IPACM_Wlan.cpp +++ b/ipacm/src/IPACM_Wlan.cpp @@ -147,7 +147,6 @@ void IPACM_Wlan::event_callback(ipa_cm_event_id event, void *param) int ipa_interface_index; int wlan_index; ipacm_ext_prop* ext_prop; - ipacm_event_iface_up* data_wan; ipacm_event_iface_up_tehter* data_wan_tether; switch (event) @@ -605,7 +604,7 @@ void IPACM_Wlan::event_callback(ipa_cm_event_id event, void *param) case IPA_HANDLE_WAN_UP: IPACMDBG_H("Received IPA_HANDLE_WAN_UP event\n"); - data_wan = (ipacm_event_iface_up*)param; + ipacm_event_iface_up* data_wan = (ipacm_event_iface_up*)param; if(data_wan == NULL) { IPACMERR("No event data is found.\n"); @@ -1036,14 +1035,14 @@ int IPACM_Wlan::handle_wlan_client_init_ex(ipacm_event_data_wlan_ex *data) if (strlcat(pHeaderDescriptor->hdr[0].name, IPA_WLAN_PARTIAL_HDR_NAME_v4, sizeof(pHeaderDescriptor->hdr[0].name)) > IPA_RESOURCE_NAME_MAX) { - IPACMERR(" header name construction failed exceed length (%d)\n", strlen(pHeaderDescriptor->hdr[0].name)); + IPACMERR(" header name construction failed exceed length (%zu)\n", strlen(pHeaderDescriptor->hdr[0].name)); res = IPACM_FAILURE; goto fail; } snprintf(index,sizeof(index), "%d", header_name_count); if (strlcat(pHeaderDescriptor->hdr[0].name, index, sizeof(pHeaderDescriptor->hdr[0].name)) > IPA_RESOURCE_NAME_MAX) { - IPACMERR(" header name construction failed exceed length (%d)\n", strlen(pHeaderDescriptor->hdr[0].name)); + IPACMERR(" header name construction failed exceed length (%zu)\n", strlen(pHeaderDescriptor->hdr[0].name)); res = IPACM_FAILURE; goto fail; } @@ -1150,7 +1149,7 @@ int IPACM_Wlan::handle_wlan_client_init_ex(ipacm_event_data_wlan_ex *data) pHeaderDescriptor->hdr[0].name[IPA_RESOURCE_NAME_MAX-1] = '\0'; if (strlcat(pHeaderDescriptor->hdr[0].name, IPA_WLAN_PARTIAL_HDR_NAME_v6, sizeof(pHeaderDescriptor->hdr[0].name)) > IPA_RESOURCE_NAME_MAX) { - IPACMERR(" header name construction failed exceed length (%d)\n", strlen(pHeaderDescriptor->hdr[0].name)); + IPACMERR(" header name construction failed exceed length (%zu)\n", strlen(pHeaderDescriptor->hdr[0].name)); res = IPACM_FAILURE; goto fail; } @@ -1158,7 +1157,7 @@ int IPACM_Wlan::handle_wlan_client_init_ex(ipacm_event_data_wlan_ex *data) snprintf(index,sizeof(index), "%d", header_name_count); if (strlcat(pHeaderDescriptor->hdr[0].name, index, sizeof(pHeaderDescriptor->hdr[0].name)) > IPA_RESOURCE_NAME_MAX) { - IPACMERR(" header name construction failed exceed length (%d)\n", strlen(pHeaderDescriptor->hdr[0].name)); + IPACMERR(" header name construction failed exceed length (%zu)\n", strlen(pHeaderDescriptor->hdr[0].name)); res = IPACM_FAILURE; goto fail; } @@ -1273,7 +1272,7 @@ int IPACM_Wlan::handle_wlan_client_ipaddr(ipacm_event_data_all *data) else { if ((data->ipv6_addr[0] != 0) || (data->ipv6_addr[1] != 0) || - (data->ipv6_addr[2] != 0) || (data->ipv6_addr[3] || 0)) /* check if all 0 not valid ipv6 address */ + (data->ipv6_addr[2] != 0) || (data->ipv6_addr[3] != 0)) /* check if all 0 not valid ipv6 address */ { IPACMDBG_H("ipv6 address: 0x%x:%x:%x:%x\n", data->ipv6_addr[0], data->ipv6_addr[1], data->ipv6_addr[2], data->ipv6_addr[3]); if( (data->ipv6_addr[0] & ipv6_link_local_prefix_mask) != (ipv6_link_local_prefix & ipv6_link_local_prefix_mask) && @@ -1313,6 +1312,11 @@ int IPACM_Wlan::handle_wlan_client_ipaddr(ipacm_event_data_all *data) return IPACM_FAILURE; /* not setup the RT rules*/ } } + else + { + IPACMDBG_H("IPV6 address is invalid\n"); + return IPACM_FAILURE; + } } return IPACM_SUCCESS; @@ -1705,7 +1709,9 @@ int IPACM_Wlan::handle_wlan_client_down_evt(uint8_t *mac_addr) /*handle wlan iface down event*/ int IPACM_Wlan::handle_down_evt() { - int res = IPACM_SUCCESS, i, num_private_subnet_fl_rule; + int res = IPACM_SUCCESS, num_private_subnet_fl_rule; + uint32_t i; + num_private_subnet_fl_rule = 0; IPACMDBG_H("WLAN ip-type: %d \n", ip_type); /* no iface address up, directly close iface*/ @@ -1977,7 +1983,8 @@ fail: /*handle reset wifi-client rt-rules */ int IPACM_Wlan::handle_wlan_client_reset_rt(ipa_ip_type iptype) { - int i, res = IPACM_SUCCESS; + uint32_t i; + int res = IPACM_SUCCESS; /* clean wifi-client routing rules */ IPACMDBG_H("left %d wifi clients to reset ip-type(%d) rules \n ", num_wifi_client, iptype); @@ -2214,7 +2221,7 @@ void IPACM_Wlan::handle_SCC_MCC_switch(ipa_ip_type iptype) void IPACM_Wlan::eth_bridge_handle_wlan_mode_switch() { - int i; + uint32_t i; /* ====== post events to mimic WLAN interface goes down/up when AP mode is changing ====== */ |