Blame SOURCES/0019-RH-fix-sockets.patch

38852f
---
38852f
 libmpathpersist/mpath_updatepr.c |    3 ++-
38852f
 libmultipath/uxsock.c            |    4 ++--
38852f
 2 files changed, 4 insertions(+), 3 deletions(-)
38852f
38852f
Index: multipath-tools-130222/libmpathpersist/mpath_updatepr.c
38852f
===================================================================
38852f
--- multipath-tools-130222.orig/libmpathpersist/mpath_updatepr.c
38852f
+++ multipath-tools-130222/libmpathpersist/mpath_updatepr.c
38852f
@@ -14,6 +14,7 @@
38852f
 #include <debug.h>
38852f
 #include "memory.h"
38852f
 #include "../libmultipath/uxsock.h"
38852f
+#include "../libmultipath/defaults.h"
38852f
 
38852f
 unsigned long mem_allocated;    /* Total memory used in Bytes */
38852f
 
38852f
@@ -25,7 +26,7 @@ int update_prflag(char * arg1, char * ar
38852f
 	size_t len;
38852f
 	int ret = 0;
38852f
 
38852f
-	fd = ux_socket_connect("/var/run/multipathd.sock");
38852f
+	fd = ux_socket_connect(DEFAULT_SOCKET);
38852f
 	if (fd == -1) {
38852f
 		condlog (0, "ux socket connect error");
38852f
 		return 1 ;
38852f
Index: multipath-tools-130222/libmultipath/uxsock.c
38852f
===================================================================
38852f
--- multipath-tools-130222.orig/libmultipath/uxsock.c
38852f
+++ multipath-tools-130222/libmultipath/uxsock.c
38852f
@@ -31,7 +31,7 @@ int ux_socket_connect(const char *name)
38852f
 	memset(&addr, 0, sizeof(addr));
38852f
 	addr.sun_family = AF_LOCAL;
38852f
 	addr.sun_path[0] = '\0';
38852f
-	len = strlen(name) + 1;
38852f
+	len = strlen(name) + 1 + sizeof(sa_family_t);
38852f
 	strncpy(&addr.sun_path[1], name, len);
38852f
 
38852f
 	fd = socket(AF_LOCAL, SOCK_STREAM, 0);
38852f
@@ -62,7 +62,7 @@ int ux_socket_listen(const char *name)
38852f
 	memset(&addr, 0, sizeof(addr));
38852f
 	addr.sun_family = AF_LOCAL;
38852f
 	addr.sun_path[0] = '\0';
38852f
-	len = strlen(name) + 1;
38852f
+	len = strlen(name) + 1 + sizeof(sa_family_t);
38852f
 	strncpy(&addr.sun_path[1], name, len);
38852f
 
38852f
 	if (bind(fd, (struct sockaddr *)&addr, len) == -1) {