From bd3845fe5779b524adb0360b1f8f0b0200b59fc2 Mon Sep 17 00:00:00 2001 From: Ossama Othman Date: Mon, 25 Jan 2021 21:24:29 -0800 Subject: [PATCH] mptcpd 0.6 - Mptcpd now supports versions of the Embedded Linux Library (ELL) greater than 0.33. - Plugins should use the new MPTCPD_PLUGIN_DEFINE() preprocessor macro instead of L_PLUGIN_DEFINE(). - A pointer to the mptcpd path manager object, i.e. struct mptcpd *pm, is now passed to the plugin init and exit functions. This allows plugins to potentially perform mptcpd path manager related operations during initialization and finalization. - Support for the MPTCP netlink path manager in the upstream Linux kernel is now available. A new set of path management command functions corresponding to those available in the kernel netlink path management API has been added to the `' header. The new functions allow plugins to retrieve IP address information, flush addresses, and modify MPTCP resource limits. - The mptcpd_pm_add_addr() (formerly mptcpd_pm_send_addr()) and mptcpd_pm_remove_addr() function parameters have been modified in order to support both the upstream and multipath-tcp.org kernels. - Mptcpd path management command functions declared in `' now return zero on success and -1 or an errno on failure instead of a bool. - A MPTCP address ID manager "mptcpd_idm" interface was introduced that mptcpd plugins may leverage to map an IP address to a MPTCP address ID, as well as to track used and unused IDs. The interface is defined in the new `' header. - A new address advertising plugin, "addr_adv", has been added. It simply triggers a MPTCP ADD_ADDR when a new IP address is detected by the mptcpd network monitor. Similarly, a MPTCP REMOVE_ADDR is triggered when an IP address is no longer available. - MPTCP netlink command error message logging was improved to be more descriptive when possible. --- NEWS | 2 ++ configure.ac | 11 ++++++++--- src/path_manager.c | 10 ---------- tests/Makefile.am | 13 +++++-------- tests/test-bad-log-empty | 10 +++++++--- tests/test-bad-log-long | 10 +++++++--- tests/test-bad-log-short | 10 +++++++--- tests/test-bad-option | 10 +++++++--- tests/test-bad-path-manager | 10 +++++++--- tests/test-bad-plugin-dir | 10 +++++++--- 10 files changed, 57 insertions(+), 39 deletions(-) diff --git a/NEWS b/NEWS index 1402bccf..98aeb851 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +25 January 2021 - mptcpd 0.6 + - Mptcpd now supports versions of the Embedded Linux Library (ELL) greater than 0.33. diff --git a/configure.ac b/configure.ac index 2fec946c..102162de 100644 --- a/configure.ac +++ b/configure.ac @@ -2,11 +2,11 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # -# Copyright (c) 2017-2020, Intel Corporation +# Copyright (c) 2017-2021, Intel Corporation AC_PREREQ([2.69]) AC_INIT([mptcpd], - [0.5], + [0.6], [mptcp@lists.01.org], [], [https://01.org/multipath-tcp-linux]) @@ -147,7 +147,12 @@ AS_IF([test "x$ax_enable_debug" != "xyes"], dnl AX_ENABLE_DEBUG macro disables the autoconf default of dnl implicitly adding it. AS_IF([test "x$enable_code_coverage" != "xyes"], - [AX_APPEND_COMPILE_FLAGS([-O2])]) + [AX_APPEND_COMPILE_FLAGS([-O2]) + + AC_LANG_PUSH([C++]) + AX_APPEND_COMPILE_FLAGS([-O2]) + AC_LANG_POP([C++]) + ]) dnl AX_CODE_COVERAGE will define NDEBUG on the command line, dnl equivalent to #define NDEBUG 1, if code coverage is diff --git a/src/path_manager.c b/src/path_manager.c index 5fa652b9..e1f3057d 100644 --- a/src/path_manager.c +++ b/src/path_manager.c @@ -920,16 +920,6 @@ static void complete_mptcp_org_kernel_pm_init(struct mptcpd_pm *pm) static void dump_addrs_callback(struct mptcpd_addr_info const *info, void *callback_data) { - /** - * @todo The kernel's pm_netlink path manager doesn't generate - * dump reply containing an array. Rather a separate - * dump is sent for each set of address/ID information. - * In particular, this callback will be called once per - * address/ID. There is no need for the @a len - * parameter and should be entirely removed from the - * API. - */ - char addrstr[INET6_ADDRSTRLEN]; // Long enough for both IPv4 // and IPv6 addresses. diff --git a/tests/Makefile.am b/tests/Makefile.am index 419d4fc2..80171675 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,6 @@ ## SPDX-License-Identifier: BSD-3-Clause ## -## Copyright (c) 2017-2020, Intel Corporation +## Copyright (c) 2017-2021, Intel Corporation include $(top_srcdir)/aminclude_static.am @@ -28,17 +28,14 @@ check_PROGRAMS = \ test-configuration \ test-id-manager -## Test scripts expected to fail due to intentionally bad mptcpd -## command line options. Successful exit will be treated as failure. -xfail_test_scripts = \ +dist_check_SCRIPTS = \ test-bad-log-empty \ test-bad-log-long \ test-bad-log-short \ test-bad-option \ test-bad-path-manager \ - test-bad-plugin-dir - -dist_check_SCRIPTS = test-start-stop $(xfail_test_scripts) + test-bad-plugin-dir \ + test-start-stop test_plugin_SOURCES = test-plugin.c test_plugin_CPPFLAGS = \ @@ -113,7 +110,7 @@ endif AM_TESTS_ENVIRONMENT = TEST_PLUGIN_DIR=$(TEST_PLUGIN_DIR_NOOP) TESTS = $(check_PROGRAMS) $(dist_check_SCRIPTS) -XFAIL_TESTS = $(xfail_test_scripts) +XFAIL_TESTS = test-commands # Clean up code coverage related generated files. clean-local: code-coverage-clean diff --git a/tests/test-bad-log-empty b/tests/test-bad-log-empty index d410abc5..abe94a99 100755 --- a/tests/test-bad-log-empty +++ b/tests/test-bad-log-empty @@ -3,9 +3,13 @@ # Test empty mptcpd "--log" command line option. # -# Copyright (c) 2019, Intel Corporation +# Copyright (c) 2019, 2021, Intel Corporation -set -e - ../src/mptcpd --log= + +# Command line usage error exit code. See +EX_USAGE=64 + +# mptcpd should have exited with an EX_USAGE exit code. +test $? != $EX_USAGE diff --git a/tests/test-bad-log-long b/tests/test-bad-log-long index 9effd7e4..cd536a37 100755 --- a/tests/test-bad-log-long +++ b/tests/test-bad-log-long @@ -3,9 +3,13 @@ # Test bad mptcpd "--log" long command line option. # -# Copyright (c) 2019, Intel Corporation +# Copyright (c) 2019, 2021, Intel Corporation -set -e - ../src/mptcpd --log=foo + +# Command line usage error exit code. See +EX_USAGE=64 + +# mptcpd should have exited with an EX_USAGE exit code. +test $? != $EX_USAGE diff --git a/tests/test-bad-log-short b/tests/test-bad-log-short index 25ba3fc7..bc2025e2 100755 --- a/tests/test-bad-log-short +++ b/tests/test-bad-log-short @@ -3,9 +3,13 @@ # Test bad mptcpd "-l" short command line option. # -# Copyright (c) 2019, Intel Corporation +# Copyright (c) 2019, 2021, Intel Corporation -set -e - ../src/mptcpd -l foo + +# Command line usage error exit code. See +EX_USAGE=64 + +# mptcpd should have exited with an EX_USAGE exit code. +test $? != $EX_USAGE diff --git a/tests/test-bad-option b/tests/test-bad-option index 3d365208..b53c0744 100755 --- a/tests/test-bad-option +++ b/tests/test-bad-option @@ -3,9 +3,13 @@ # Test unknown command line option. # -# Copyright (c) 2018, 2019, Intel Corporation +# Copyright (c) 2018-2019, 2021, Intel Corporation -set -e - ../src/mptcpd --foo + +# Command line usage error exit code. See +EX_USAGE=64 + +# mptcpd should have exited with an EX_USAGE exit code. +test $? != $EX_USAGE diff --git a/tests/test-bad-path-manager b/tests/test-bad-path-manager index 1cc64513..4503db1e 100755 --- a/tests/test-bad-path-manager +++ b/tests/test-bad-path-manager @@ -3,9 +3,13 @@ # Test bad mptcpd "--path-manager" command line option. # -# Copyright (c) 2019, Intel Corporation +# Copyright (c) 2019, 2021, Intel Corporation -set -e - ../src/mptcpd --path-manager= + +# Command line usage error exit code. See +EX_USAGE=64 + +# mptcpd should have exited with an EX_USAGE exit code. +test $? != $EX_USAGE diff --git a/tests/test-bad-plugin-dir b/tests/test-bad-plugin-dir index b2e2a2e8..20a34d2c 100755 --- a/tests/test-bad-plugin-dir +++ b/tests/test-bad-plugin-dir @@ -3,9 +3,13 @@ # Test bad mptcpd "--plugin-dir" command line option. # -# Copyright (c) 2019, Intel Corporation +# Copyright (c) 2019, 2021, Intel Corporation -set -e - ../src/mptcpd --plugin-dir= + +# Command line usage error exit code. See . +EX_USAGE=64 + +# mptcpd should have exited with an EX_USAGE exit code. +test $? != $EX_USAGE