Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for new upstream kernel PM commands. #199

Merged
merged 75 commits into from
Aug 9, 2022

Commits on Jul 7, 2022

  1. Configuration menu
    Copy the full SHA
    e8c69d8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a93fd4e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2e3fe86 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7006b41 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2983e45 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    026c1ae View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d7629c7 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    eb9018b View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f86445e View commit details
    Browse the repository at this point in the history
  10. src: Correct comments.

    ossama-othman committed Jul 7, 2022
    Configuration menu
    Copy the full SHA
    9fe1a35 View commit details
    Browse the repository at this point in the history
  11. include: Update to latest <linux/mptcp.h>.

    Update `mptcp_upstream.h' to the latest upstream version of
    <linux/mptcp.h>.
    ossama-othman committed Jul 7, 2022
    Configuration menu
    Copy the full SHA
    2abcd4f View commit details
    Browse the repository at this point in the history
  12. src: Reorder include directives to avoid conflict.

    In `src/netlink_pm_upstream.c', include <mptcpd/addr_info.h> before
    <mptcpd/private/mptcp_upstream.h> to avoid redefinition of the same
    symbols.  The symbols in question, such as struct in_addr, are found
    in both <netinet/in.h> and <linux/in.h>.  The former is included in
    <mptcpd/addr_info.h> and the latter is included in a recent version of
    <linux/mptcp.h>.  Reording the include directives allows the C library
    compatibility logic in <linux/libc-compat.h> included by <linux/in.h>
    to detect a previous include of <netinet/in.h> to avoid redefinition
    of symbols.
    ossama-othman committed Jul 7, 2022
    Configuration menu
    Copy the full SHA
    50543d7 View commit details
    Browse the repository at this point in the history
  13. src: Display support kernel in "--help" output.

    Display the kernel supported by mptcpd in the "--help" command line
    option output, e.g.:
    
    Usage: mptcpd [OPTION...]
    Start the Multipath TCP daemon.
    ...
      -?, --help                 Give this help list
          --usage                Give a short usage message
      -V, --version              Print program version
    ...
    Supported Linux kernel: upstream
    ...
    ossama-othman committed Jul 7, 2022
    Configuration menu
    Copy the full SHA
    1b3f097 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    c139636 View commit details
    Browse the repository at this point in the history
  15. src: Add a MPTCP listener manager.

    The MPTCP listener manager maps MPTCP local address IDs to a file
    descriptor for an open MPTCP listening socket.
    ossama-othman committed Jul 7, 2022
    Configuration menu
    Copy the full SHA
    b47c81f View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    d45500a View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    6273bbc View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    769b0bc View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    14f9e58 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    a7c97de View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2022

  1. m4: Update upstream <linux/mptcp.h> detection.

    Mptcpd now requires the MPTCP_ATTR_SERVER_SIDE enumerator to exist in
    the upstream kernel <linux/mptcp.h> header.  Update the header
    detection logic accordingly.
    ossama-othman committed Jul 8, 2022
    Configuration menu
    Copy the full SHA
    40cb8a5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cfa291f View commit details
    Browse the repository at this point in the history
  3. plugin: Propagate server_side attribute to plugins

    Propagate the MPTCP_ATTR_SERVER_SIDE attribute value to plugin
    new_connection and connection_established operations.
    ossama-othman committed Jul 8, 2022
    Configuration menu
    Copy the full SHA
    81b615d View commit details
    Browse the repository at this point in the history
  4. plugins: Update connection operations signatures.

    Mptcpd plugin new_connection and connection_established operations now
    accept a boolean "server_side" parameter.  Update mptcpd plugin
    implementations accordingly.
    ossama-othman committed Jul 8, 2022
    Configuration menu
    Copy the full SHA
    38dce3a View commit details
    Browse the repository at this point in the history
  5. tests: Update test plugin infrastructure.

    Add the new "server_side" argument to all calls to test plugin
    new_connection and connection_established operations.
    ossama-othman committed Jul 8, 2022
    Configuration menu
    Copy the full SHA
    a878e0b View commit details
    Browse the repository at this point in the history
  6. tests: Clarify plugin call relationship.

    Make the relationship between two duplicate sets of test plugin call
    arguments by initializing the second set in terms of the first rather
    than simple cut-n-paste initialization.  This minimizes potential for
    argument mismatches between the two by only requiring changes to the
    arguments in one place instead of two.  It also improve code
    self-documentation.
    ossama-othman committed Jul 8, 2022
    Configuration menu
    Copy the full SHA
    587581f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2c79001 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4b0af5b View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2022

  1. lib: Refactor sockaddr hash code.

    Move struct sockaddr hash code out of `id_manager.c' and in to a
    separate source and header file so that it may be used by other
    hash maps in libmptcpd.
    ossama-othman committed Jul 13, 2022
    Configuration menu
    Copy the full SHA
    4e477ae View commit details
    Browse the repository at this point in the history
  2. tests: Add invalid MPTCP address ID test case.

    Verify that mptcpd_idm_map_id() correctly rejects an invalid (zero)
    MPTCP address ID.
    ossama-othman committed Jul 13, 2022
    Configuration menu
    Copy the full SHA
    671ad53 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    16e6f1c View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2022

  1. listener_manager: Map sockaddr to file descriptor.

    Map sockaddrs to file descriptors instead of MPTCP address ID to file
    descriptor.  Reference count listeners as well to allow sharing.
    ossama-othman committed Jul 14, 2022
    Configuration menu
    Copy the full SHA
    7154fb8 View commit details
    Browse the repository at this point in the history
  2. Add sockaddr parameter to mptcpd_pm_remove_addr().

    A sockaddr is now needed to close a listener.  Add a sockaddr
    parameter to mptcpd_pm_remove_addr(), accordingly.
    ossama-othman committed Jul 14, 2022
    Configuration menu
    Copy the full SHA
    6f2121f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    af5eee0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8e8fcca View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f62e212 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    72a25af View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2022

  1. hash_sockaddr: Include IP port as part of the key.

    Hash the IP port as part of the key to ensure the resulting key hash
    is different between sockaddrs with the same IP address but different
    ports.
    
    This is necessary because the mptcpd listener manager would otherwise
    only create listeners for a given IP address once even if the port
    differs in subsequent mptcpd_lm_listen() calls.
    ossama-othman committed Jul 17, 2022
    Configuration menu
    Copy the full SHA
    7dbc71c View commit details
    Browse the repository at this point in the history
  2. hash_sockaddr: Simplify padding initialization.

    Add an implicitly initialized dummy padding member to the hash key
    structures, and drop the unions.  This is simpler than the previous
    union based approach.
    ossama-othman committed Jul 17, 2022
    Configuration menu
    Copy the full SHA
    b667955 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2022

  1. Configuration menu
    Copy the full SHA
    4827421 View commit details
    Browse the repository at this point in the history
  2. tests: Expand mptcpd_lm test cases.

    Add test cases for non-zero IP ports to the test-listener-manager
    unit test.
    ossama-othman committed Jul 18, 2022
    Configuration menu
    Copy the full SHA
    7d0d315 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    89ae85c View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2022

  1. test-id-manager: Add different port test case.

    Verify that getting the MPTCP address ID for sockaddrs containing the
    same IP address but different ports results in the same ID.  Only the
    IP address should be considered by the mptcpd ID manager.
    ossama-othman committed Jul 19, 2022
    Configuration menu
    Copy the full SHA
    ba87b88 View commit details
    Browse the repository at this point in the history
  2. lib: Refactor sockaddr hashing to IDM and LM.

    The mptcpd ID manager and listener manager each have specific sockaddr
    hashing requirements, where the former does not need the IP port and
    the latter does.  Attempting to make a single hash implementation
    support both cases was clumsy.  The mptcpd ID manager and listener
    manager will each implement their own hash functions.  Common sockaddr
    hashing related functions still exist in hash_sockaddr.[hc].
    ossama-othman committed Jul 19, 2022
    Configuration menu
    Copy the full SHA
    dbd8dbd View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2022

  1. listener_manager: Make factory functions private.

    Only one instance of a mptcpd listener manager should be created.
    That instance should be managed by the mptcpd core.  Make the
    mptcpd_lm_create() and mptcpd_lm_destroy() part of the private mptcpd
    API.
    ossama-othman committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    9a0cf49 View commit details
    Browse the repository at this point in the history
  2. path_manager: Add mptcpd_pm_get_lm() accessor.

    Allow the user to get access to the global mptcpd listener manager by
    adding a new mptcpd_pm_get_lm() function to the public API.
    ossama-othman committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    2a5ace1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b40f91f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0208b79 View commit details
    Browse the repository at this point in the history
  5. include: Clarify 'server_side' plugin ops param.

    Co-authored-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
    ossama-othman and mjmartineau committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    56d2922 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2022

  1. Configuration menu
    Copy the full SHA
    96712be View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2022

  1. Configuration menu
    Copy the full SHA
    f5eb494 View commit details
    Browse the repository at this point in the history
  2. listener_manager: Track ephemeral ports.

    Track the kernel assigned ephemeral port if the user provided a
    sockaddr with a zero port to mptcpd_lm_listen(), and return that port
    to the user.  The user is expected to pass a sockaddr with the port
    returned from mptcpd_lm_listen() in a subsequent call to
    mptcpd_lm_close().  Passing a sockaddr with a zero port to
    mptcpd_lm_close() will result in failure since the listener manager
    now only tracks listeners with non-zero addresses.
    ossama-othman committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    f915775 View commit details
    Browse the repository at this point in the history
  3. listener_manager: Reject unbound IP addresses.

    Reject unbound IP addresses such as INADDR_ANY, INADDR_BROADCAST, and
    in6addr_any.  The mptcpd listener manager requires addresses to be
    bound to a network interface.
    ossama-othman committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    8022d4c View commit details
    Browse the repository at this point in the history
  4. test-listener-manager: Add bad address test cases.

    Verify that the mptcpd listener manager rejects addresses that are not
    bound to a network interface, i.e. INADDR_ANY, INADDR_BROADCAST, and
    in6addr_any.
    ossama-othman committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    9b82aff View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f2b15a2 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    daa13d4 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2022

  1. Configuration menu
    Copy the full SHA
    47bafca View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    eabb923 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2022

  1. Add mptcpd_sockaddr_copy() utility function.

    In some cases it is useful to copy the contents of a sockaddr based on
    the address family.  Add a new mptcpd_sockaddr_copy() function that
    does so.  Only AF_INET and AF_INET6 address families are supported.
    ossama-othman committed Aug 4, 2022
    Configuration menu
    Copy the full SHA
    ffcb668 View commit details
    Browse the repository at this point in the history
  2. sspi: Pass non-const addr to mptcpd_pm_add_addr().

    The mptcpd_pm_add_addr() function now expects a pointer to a non-const
    struct sockaddr.  Update the sspi plugin accordingly.
    ossama-othman committed Aug 4, 2022
    Configuration menu
    Copy the full SHA
    0d3194e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0690d9f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a99543f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0d4210c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8b9cc84 View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2022

  1. tests: Overhaul test-commands unit test.

    Overhaul the test-commands unit test with the following notable
    changes:
        * Use different addresses for user and kernel space address
          advertising related commands.  This is needed to prevent
          listening on the same TCP address and port.
        * Use the same local and remote addresses for all user space
          subflow related commands.
        * Log addresses obtained from mptcpd_kpm_get_addr().
    ossama-othman committed Aug 5, 2022
    Configuration menu
    Copy the full SHA
    73facae View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cc7021e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    087cb4a View commit details
    Browse the repository at this point in the history
  4. test-commands: Split kernel and user space cases.

    Split kernel and user space test cases to make it easier to determine
    causes of failure.  The code is also cleaner with the split.
    ossama-othman committed Aug 5, 2022
    Configuration menu
    Copy the full SHA
    dc40045 View commit details
    Browse the repository at this point in the history
  5. listener_manager: Return 0 or errno, not bool.

    Propagate errors to callers by returning 0 on success, and -1 or errno
    on error.  This allows for better error handling and diagnostics.
    ossama-othman committed Aug 5, 2022
    Configuration menu
    Copy the full SHA
    e80db71 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3e94d23 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a7a9b90 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3d64db8 View commit details
    Browse the repository at this point in the history
  9. test-commands: Ignore EADDRNOTAVAIL error.

    The EADDRNOTAVAIL error will generally occur during a call to
    mptcpd_pm_add_addr() if the test is run without sufficient
    capabilities (CAP_NET_ADMIN) to set up the test addresses by
    associating them with a network interface.  Ignore the failure for
    now.
    ossama-othman committed Aug 5, 2022
    Configuration menu
    Copy the full SHA
    c1883e4 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    bde4681 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    9fed337 View commit details
    Browse the repository at this point in the history