device-mapper-multipath/0024-multipathd-listen-on-pathname-and-abstract-socket-by.patch
Benjamin Marzinski 5b86fc9dcf device-mapper-multipath-0.9.9-7
Add 0018-multipath-tools-move-DEFAULT_SOCKET-definition-into-.patch
Add 0019-multipath-tools-add-helper-mpath_fill_sockaddr__.patch
Add 0020-libmpathutil-add-support-for-Unix-pathname-sockets.patch
Add 0021-libmpathutil-move-systemd_listen_fds-support-into-mu.patch
Add 0022-multipathd-make-uxsock_listen-take-a-pointer-to-fd.patch
Add 0023-multipathd-allow-receiving-two-socket-fds-from-syste.patch
Add 0024-multipathd-listen-on-pathname-and-abstract-socket-by.patch
Add 0025-libmpathcmd-try-both-abstract-and-pathname-sockets.patch
Add 0026-libmpathcmd-honor-MULTIPATH_SOCKET_NAME-environment-.patch
Add 0027-multipathd-honor-MULTIPATH_SOCKET_NAME-environment-v.patch
Add 0028-multipath-clean-up-find_multipaths-documentation.patch
Add 0029-multipathd-Add-multipathd-man-page-section-about-soc.patch
  * Fixes RHEL-82180 ("RFE: Enable multipathd to communicate with a
    process in another network namespace")
Resolves: RHEL-82180
2025-03-11 16:40:30 -04:00

68 lines
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Wed, 12 Feb 2025 20:35:36 +0100
Subject: [PATCH] multipathd: listen on pathname and abstract socket by default
Pass both ABSTRACT_SOCKET and PATHNAME_SOCKET to the compiler at
build time, and listen on both sockets by default.
Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
Makefile.inc | 2 +-
libmpathcmd/mpath_cmd.c | 2 +-
multipathd/main.c | 11 ++++++-----
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/Makefile.inc b/Makefile.inc
index 07c0ae80..69a0d64c 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -120,7 +120,7 @@ CPPFLAGS := $(CPPFLAGS) $(D_URCU_VERSION) \
-DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(TGTDIR)$(configdir)\" \
-DDEFAULT_CONFIGFILE=\"$(TGTDIR)$(configfile)\" -DSTATE_DIR=\"$(TGTDIR)$(statedir)\" \
-DEXTRAVERSION=\"$(EXTRAVERSION)\" \
- -DDEFAULT_SOCKET=\"$(abstract_socket)\" \
+ -DABSTRACT_SOCKET=\"$(abstract_socket)\" -DPATHNAME_SOCKET=\"$(pathname_socket)\" \
-DWSTRINGOP_TRUNCATION=$(if $(WSTRINGOP_TRUNCATION),1,0) \
-MMD -MP
CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe
diff --git a/libmpathcmd/mpath_cmd.c b/libmpathcmd/mpath_cmd.c
index 146e790d..54143fb1 100644
--- a/libmpathcmd/mpath_cmd.c
+++ b/libmpathcmd/mpath_cmd.c
@@ -113,7 +113,7 @@ int __mpath_connect(int nonblocking)
(void)fcntl(fd, F_SETFL, flags|O_NONBLOCK);
}
- len = mpath_fill_sockaddr__(&addr, DEFAULT_SOCKET);
+ len = mpath_fill_sockaddr__(&addr, ABSTRACT_SOCKET);
if (connect(fd, (struct sockaddr *)&addr, len) == -1) {
int err = errno;
diff --git a/multipathd/main.c b/multipathd/main.c
index 2fef0c64..bdbcea49 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1895,13 +1895,14 @@ uxlsnrloop (void * ap)
pthread_cleanup_push(rcu_unregister, NULL);
rcu_register_thread();
- num = get_systemd_sockets(&ux_sock);
+ num = get_systemd_sockets(ux_sock);
if (num < 1) {
- ux_sock[0] = ux_socket_listen(DEFAULT_SOCKET);
- num = 1;
+ ux_sock[0] = ux_socket_listen(ABSTRACT_SOCKET);
+ ux_sock[1] = ux_socket_listen(PATHNAME_SOCKET);
+ num = 2;
}
- if (ux_sock[0] == -1) {
- condlog(1, "could not create uxsock: %d", errno);
+ if (ux_sock[0] == -1 && ux_sock[1] == -1) {
+ condlog(1, "could not create sockets: %d", errno);
exit_daemon();
goto out;
}