diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6d733b2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/mptcpd-0.7.tar.gz diff --git a/.mptcpd.metadata b/.mptcpd.metadata new file mode 100644 index 0000000..372681f --- /dev/null +++ b/.mptcpd.metadata @@ -0,0 +1 @@ +a5307a3515e2fa7fd8c3be26a160ce5bed56878d SOURCES/mptcpd-0.7.tar.gz diff --git a/SOURCES/0001-issue125.patch b/SOURCES/0001-issue125.patch new file mode 100644 index 0000000..a6d4a19 --- /dev/null +++ b/SOURCES/0001-issue125.patch @@ -0,0 +1,70 @@ +From a908793d8c816ba8e08950f7407de2ea9d144800 Mon Sep 17 00:00:00 2001 +Message-Id: +From: dddaniel +Date: Fri, 23 Apr 2021 23:19:23 +0200 +Subject: [PATCH] configure: add --disable-stack-protection option (#125) + +Enabling -DFORTIFY_SOURCE=* and -fstack-protector-* by default may +overwrite global (build) system settings, causing redefinition errors at +compile time. +--- + configure.ac | 37 +++++++++++++++++++++++++------------ + 1 file changed, 25 insertions(+), 12 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 3d6a2f0..4be1b81 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -255,24 +255,37 @@ AX_APPEND_COMPILE_FLAGS([-Wextra -Werror -pedantic]) + # --------------------------------------------------------------- + # Enable compile-time defense + # --------------------------------------------------------------- +-# Fortify source +-# Enabling optimization implies _FORTIFY_SOURCE on some platforms. +-# Explicitly redefine to _FORTIFY_SOURCE=2 to make sure we have the +-# desired fortification level. +-AX_APPEND_FLAG([-U_FORTIFY_SOURCE], [CPPFLAGS]) +-AX_APPEND_FLAG([-D_FORTIFY_SOURCE=2], [CPPFLAGS]) ++ ++AC_ARG_ENABLE(stack-protection, ++ [AS_HELP_STRING([--disable-stack-protection], ++ [Disable compiler stack protection. ++ FORTIFY_SOURCE=2 and -fstack-protector-strong] ++ )], ++ [], ++ [enable_stack_protection=yes]) ++ ++AS_IF([test "x$enable_stack_protection" = "xyes"], ++ [ ++ # Fortify source ++ # Enabling optimization implies _FORTIFY_SOURCE on some platforms. ++ # Explicitly redefine to _FORTIFY_SOURCE=2 to make sure we have the ++ # desired fortification level. ++ AX_APPEND_FLAG([-U_FORTIFY_SOURCE], [CPPFLAGS]) ++ AX_APPEND_FLAG([-D_FORTIFY_SOURCE=2], [CPPFLAGS]) ++ ++ # Stack-based buffer overrun detection ++ MPTCPD_ADD_COMPILE_FLAG([-fstack-protector-strong], ++ [# GCC < 4.9 ++ MPTCPD_ADD_COMPILE_FLAG([-fstack-protector]) ++ ]) ++ ],[] ++ ) + + # Format string vulnerabilities + # -Wformat=2 implies: + # -Wformat -Wformat-nonliteral -Wformat-security -Wformat-y2k + AX_APPEND_COMPILE_FLAGS([-Wformat=2]) + +-# Stack-based buffer overrun detection +-MPTCPD_ADD_COMPILE_FLAG([-fstack-protector-strong], +- [# GCC < 4.9 +- MPTCPD_ADD_COMPILE_FLAG([-fstack-protector]) +- ]) +- + # Position Independent Execution (PIE) + AX_APPEND_COMPILE_FLAGS([-fPIE], [EXECUTABLE_CFLAGS]) + AC_SUBST([EXECUTABLE_CFLAGS]) +-- +2.31.1 + diff --git a/SOURCES/0002-issue144.patch b/SOURCES/0002-issue144.patch new file mode 100644 index 0000000..310e6df --- /dev/null +++ b/SOURCES/0002-issue144.patch @@ -0,0 +1,85 @@ +From f1207f311ec04aeda07759e04538d65d41d4ea4a Mon Sep 17 00:00:00 2001 +Message-Id: +From: dcaratti +Date: Wed, 23 Jun 2021 18:12:41 +0200 +Subject: [PATCH] Allow empty values of "plugin_dir" in mptcpd.conf. (#145) + +The plugin dirname is $(libdir)/mptcpd/ on standard configurations: +use this value in case the value of plugin_dir is empty in +/etc/mptcpd/mptcpd.conf. +--- + src/Makefile.am | 3 ++- + src/configuration.c | 27 ++++++++++----------------- + 2 files changed, 12 insertions(+), 18 deletions(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index 09ca74c..4aa5037 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -31,7 +31,8 @@ libpath_manager_la_LIBADD = \ + + libpath_manager_la_CPPFLAGS = \ + $(AM_CPPFLAGS) \ +- -DMPTCPD_CONFIG_FILE='"$(sysconfdir)/@PACKAGE@/@PACKAGE@.conf"' ++ -DMPTCPD_CONFIG_FILE='"$(sysconfdir)/@PACKAGE@/@PACKAGE@.conf"' \ ++ -DMPTCPD_DEFAULT_PLUGINDIR='"$(libdir)/@PACKAGE@"' + + EXTRA_DIST = mptcp.service.in + +diff --git a/src/configuration.c b/src/configuration.c +index 2a48405..70a8e19 100644 +--- a/src/configuration.c ++++ b/src/configuration.c +@@ -304,8 +304,6 @@ static bool check_file_perms(char const *f) + static bool parse_config_file(struct mptcpd_config *config, + char const *filename) + { +- bool parsed = true; +- + assert(filename != NULL); + + if (!check_file_perms(filename)) +@@ -337,22 +335,17 @@ static bool parse_config_file(struct mptcpd_config *config, + group, + "plugin-dir"); + +- if (plugin_dir == NULL) { +- l_error("No plugin directory set in mptcpd " +- "configuration."); ++ set_plugin_dir(config, ++ plugin_dir ? plugin_dir : ++ l_strdup(MPTCPD_DEFAULT_PLUGINDIR)); + +- parsed = false; +- } else { +- set_plugin_dir(config, plugin_dir); +- +- // Default plugin name. Can be NULL. +- char *const default_plugin = +- l_settings_get_string(settings, +- group, +- "path-manager"); ++ // Default plugin name. Can be NULL. ++ char *const default_plugin = ++ l_settings_get_string(settings, ++ group, ++ "path-manager"); + +- set_default_plugin(config, default_plugin); +- } ++ set_default_plugin(config, default_plugin); + } else { + l_debug("Unable to mptcpd load settings from file '%s'", + filename); +@@ -360,7 +353,7 @@ static bool parse_config_file(struct mptcpd_config *config, + + l_settings_free(settings); + +- return parsed; ++ return true; + } + + /** +-- +2.31.1 + diff --git a/SOURCES/0003-fix-multilib-install.patch b/SOURCES/0003-fix-multilib-install.patch new file mode 100644 index 0000000..6915d9a --- /dev/null +++ b/SOURCES/0003-fix-multilib-install.patch @@ -0,0 +1,24 @@ +diff --git a/etc/mptcpd.conf.in b/etc/mptcpd.conf.in +index 615c63b..c6b31ac 100644 +--- a/etc/mptcpd.conf.in ++++ b/etc/mptcpd.conf.in +@@ -19,7 +19,6 @@ log=@mptcpd_logger@ + # ---------------- + # Plugin directory + # ---------------- +-plugin-dir=@pkglibdir@ + + # ------------------- + # Path manager plugin +diff --git a/src/mptcp.service.in b/src/mptcp.service.in +index 89dfe04..738f59f 100644 +--- a/src/mptcp.service.in ++++ b/src/mptcp.service.in +@@ -9,7 +9,6 @@ Documentation=man:mptcpd(8) + [Service] + Type=simple + DynamicUser=yes +-Environment=LD_LIBRARY_PATH=@libdir@ + ExecStart=@libexecdir@/mptcpd --log=journal + CapabilityBoundingSet=CAP_NET_ADMIN + AmbientCapabilities=CAP_NET_ADMIN diff --git a/SPECS/mptcpd.spec b/SPECS/mptcpd.spec new file mode 100644 index 0000000..45f9e05 --- /dev/null +++ b/SPECS/mptcpd.spec @@ -0,0 +1,108 @@ +Summary: Multipath TCP daemon +Name: mptcpd +Version: 0.7 +Release: 3%{?dist} +License: BSD +URL: https://multipath-tcp.org +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd +BuildRequires: make +BuildRequires: gcc +BuildRequires: libtool +BuildRequires: automake +BuildRequires: autoconf +BuildRequires: autoconf-archive +BuildRequires: libell-devel +BuildRequires: systemd-units +BuildRequires: systemd-rpm-macros + +Source0: https://github.com/intel/mptcpd/archive/v%{version}/%{name}-%{version}.tar.gz + +Patch1: 0001-issue125.patch +Patch2: 0002-issue144.patch +Patch3: 0003-fix-multilib-install.patch + +%description +The Multipath TCP Daemon is a daemon for Linux based operating systems that +performs multipath TCP path management related operations in user space. It +interacts with the Linux kernel through a generic netlink connection to track +per-connection information (e.g. available remote addresses), available network +interfaces, request new MPTCP subflows, handle requests for subflows, etc. + +%package devel +Summary: MPTCP path manager header files +Group: Development/Libraries +Requires: pkgconfig +Requires: %{name}%{?_isa} = %{version}-%{release} +License: BSD + +%description devel +Header files for adding MPTCP path manager support to applications + +%prep +%autosetup -p1 + +%build +autoreconf --install --symlink --force +%configure --enable-debug=info +%make_build V=1 + +%install +install -d %{buildroot}/%{_libexecdir} +install -d %{buildroot}/%{_mandir}/man8 +install -d %{buildroot}/%{_sysconfdir}/%{name} +install -d %{buildroot}/%{_unitdir} +install -d %{buildroot}/%{_libdir}/%{name} +install -d %{buildroot}/%{_includedir}/%{name} +%make_install +find %{buildroot} -name '*.la' -exec rm -f {} ';' + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig +%systemd_postun mptcp.service + +%files +%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf +%dir %{_sysconfdir}/%{name} +%dir %{_libdir}/%{name} +%{_libdir}/libmptcpd.so.* +%{_libdir}/%{name}/*.so +%{_libexecdir}/%{name} +%{_unitdir}/mptcp.service +%{_mandir}/man8/%{name}.8.gz +# todo add %doc +%license COPYING + +%files devel +%doc COPYING +%dir %{_includedir}/%{name} +%{_libdir}/*.so +%{_includedir}/mptcpd/*.h +%{_libdir}/pkgconfig/mptcpd.pc + +%changelog +* Mon Aug 09 2021 Mohan Boddu - 0.7-3 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Wed Jun 23 2021 Davide Caratti - 0.7-2 +- add a simple sanity test and enable gating. Related: rhbz#1962741 +- don't overwrite global build options. Related: rhbz#1967697 +- fix 'check_conflicts' on multilib. Related: rhbz#1967697 + +* Wed Apr 28 2021 Davide Caratti - 0.7-1 +- update to version 0.7 + +* Fri Apr 16 2021 Mohan Boddu - 0.6-2 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Wed Mar 17 2021 Davide Caratti - 0.6-1 +- update to version 0.6 + +* Tue Jan 26 2021 Fedora Release Engineering - 0.5.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jan 20 2021 Davide Caratti - 0.5.1-1 +- initial build