[PATCH 4/6] wpa_supplicant: remove not needed casts in ctrl UDP

Janusz Dziedzic janusz.dziedzic
Fri Sep 25 04:31:22 PDT 2015


Signed-off-by: Janusz Dziedzic <janusz.dziedzic at tieto.com>
---
 wpa_supplicant/ctrl_iface_udp.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/wpa_supplicant/ctrl_iface_udp.c b/wpa_supplicant/ctrl_iface_udp.c
index ce6874c..217a1c4 100644
--- a/wpa_supplicant/ctrl_iface_udp.c
+++ b/wpa_supplicant/ctrl_iface_udp.c
@@ -267,19 +267,19 @@ static void wpa_supplicant_ctrl_iface_receive(int sock, void *eloop_ctx,
 		pos++;
 
 	if (os_strcmp(pos, "ATTACH") == 0) {
-		if (wpa_supplicant_ctrl_iface_attach(&priv->ctrl_dst, (struct sockaddr_storage *) &from, fromlen))
+		if (wpa_supplicant_ctrl_iface_attach(&priv->ctrl_dst, &from, fromlen))
 			reply_len = 1;
 		else {
 			new_attached = 1;
 			reply_len = 2;
 		}
 	} else if (os_strcmp(pos, "DETACH") == 0) {
-		if (wpa_supplicant_ctrl_iface_detach(&priv->ctrl_dst, (struct sockaddr_storage *)&from, fromlen))
+		if (wpa_supplicant_ctrl_iface_detach(&priv->ctrl_dst, &from, fromlen))
 			reply_len = 1;
 		else
 			reply_len = 2;
 	} else if (os_strncmp(pos, "LEVEL ", 6) == 0) {
-		if (wpa_supplicant_ctrl_iface_level(&priv->ctrl_dst, (struct sockaddr_storage *)&from, fromlen,
+		if (wpa_supplicant_ctrl_iface_level(&priv->ctrl_dst, &from, fromlen,
 						    pos + 6))
 			reply_len = 1;
 		else
@@ -529,7 +529,7 @@ static void wpa_supplicant_global_ctrl_iface_receive(int sock, void *eloop_ctx,
 	struct ctrl_iface_global_priv *priv = sock_ctx;
 	char buf[256], *pos;
 	int res;
-	struct sockaddr_in from;
+	struct sockaddr_storage from;
 	socklen_t fromlen = sizeof(from);
 	char *reply = NULL;
 	size_t reply_len;
@@ -573,12 +573,12 @@ static void wpa_supplicant_global_ctrl_iface_receive(int sock, void *eloop_ctx,
 		pos++;
 
 	if (os_strcmp(pos, "ATTACH") == 0) {
-		if (wpa_supplicant_ctrl_iface_attach(&priv->ctrl_dst, (struct sockaddr_storage *) &from, fromlen))
+		if (wpa_supplicant_ctrl_iface_attach(&priv->ctrl_dst, &from, fromlen))
 			reply_len = 1;
 		else
 			reply_len = 2;
 	} else if (os_strcmp(pos, "DETACH") == 0) {
-		if (wpa_supplicant_ctrl_iface_detach(&priv->ctrl_dst, (struct sockaddr_storage *)&from, fromlen))
+		if (wpa_supplicant_ctrl_iface_detach(&priv->ctrl_dst, &from, fromlen))
 			reply_len = 1;
 		else
 			reply_len = 2;
-- 
1.9.1




More information about the Hostap mailing list