[PATCH 1/6] wpa_supplicant: add AF_UNIX to sockaddr_compare

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


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

diff --git a/wpa_supplicant/ctrl_iface_udp.c b/wpa_supplicant/ctrl_iface_udp.c
index b83d359..f8826de 100644
--- a/wpa_supplicant/ctrl_iface_udp.c
+++ b/wpa_supplicant/ctrl_iface_udp.c
@@ -7,6 +7,7 @@
  */
 
 #include "includes.h"
+#include <sys/un.h>
 
 #include "common.h"
 #include "eloop.h"
@@ -62,6 +63,7 @@ static int sockaddr_compare(struct sockaddr *a, struct sockaddr *b)
 {
 	struct sockaddr_in *in_a, *in_b;
 	struct sockaddr_in6 *in6_a, *in6_b;
+	struct sockaddr_un *u_a, *u_b;
 
 	if (a->sa_family != b->sa_family)
 		return 1;
@@ -85,6 +87,13 @@ static int sockaddr_compare(struct sockaddr *a, struct sockaddr *b)
 		if (os_memcmp(&in6_a->sin6_addr, &in6_b->sin6_addr, sizeof(in6_a->sin6_addr)))
 			return 1;
 		break;
+	case AF_UNIX:
+		u_a = (struct sockaddr_un *) a;
+		u_b = (struct sockaddr_un *) b;
+
+		if (os_strncmp(u_a->sun_path, u_b->sun_path, sizeof(u_a->sun_path)))
+			return 1;
+		break;
 	default:
 		return 1;
 	}
-- 
1.9.1




More information about the Hostap mailing list