diff mbox series

[mptcp-next,6/6] mptcp: sockopt: support IP_TTL & IPV6_UNICAST_HOPS

Message ID 20230707-mptcp-unify-sockopt-issue-353-v1-6-693e15c06646@tessares.net (mailing list archive)
State Changes Requested
Delegated to: Paolo Abeni
Headers show
Series mptcp: sockopt: uniform code to get/set values | expand

Checks

Context Check Description
matttbe/checkpatch success total: 0 errors, 0 warnings, 0 checks, 66 lines checked
matttbe/build fail Build error with: -Werror
matttbe/KVM_Validation__normal__except_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__debug__only_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__debug__except_selftest_mptcp_join_ success Success! ✅
matttbe/KVM_Validation__normal__only_selftest_mptcp_join_ success Success! ✅

Commit Message

Matthieu Baerts July 7, 2023, 4 p.m. UTC
This adds support for IP_TTL and IPv6_UNICAST_HOPS, the IPv6 equivalent.

The socket option is propagated to all subflows by default.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/296
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
 net/mptcp/sockopt.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

MPTCP CI July 7, 2023, 4:25 p.m. UTC | #1
Hi Matthieu,

Thank you for your modifications, that's great!

But sadly, our CI spotted some issues with it when trying to build it.

You can find more details there:

  https://patchwork.kernel.org/project/mptcp/patch/20230707-mptcp-unify-sockopt-issue-353-v1-6-693e15c06646@tessares.net/
  https://github.com/multipath-tcp/mptcp_net-next/actions/runs/5488425457

Status: failure
Initiator: MPTCPimporter
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/25067ce9c170

Feel free to reply to this email if you cannot access logs, if you need
some support to fix the error, if this doesn't seem to be caused by your
modifications or if the error is a false positive one.

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)
MPTCP CI July 7, 2023, 6:16 p.m. UTC | #2
Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/6207458729787392
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6207458729787392/summary/summary.txt

- KVM Validation: debug (only selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/5363033799655424
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5363033799655424/summary/summary.txt

- {"code":404,"message":
  - "Can't find artifacts containing file conclusion.txt"}:
  - Task: https://cirrus-ci.com/task/5925983753076736
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5925983753076736/summary/summary.txt

- KVM Validation: normal (only selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/4800083846234112
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/4800083846234112/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/25067ce9c170


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-debug

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)
MPTCP CI July 11, 2023, 9:20 a.m. UTC | #3
Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal (except selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/6207458729787392
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6207458729787392/summary/summary.txt

- KVM Validation: debug (only selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/5363033799655424
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5363033799655424/summary/summary.txt

- KVM Validation: debug (except selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/5364691875135488
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5364691875135488/summary/summary.txt

- KVM Validation: normal (only selftest_mptcp_join):
  - Success! ✅:
  - Task: https://cirrus-ci.com/task/4800083846234112
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/4800083846234112/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/25067ce9c170


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-debug

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)
diff mbox series

Patch

diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
index a17739683fdb..cf35775179ab 100644
--- a/net/mptcp/sockopt.c
+++ b/net/mptcp/sockopt.c
@@ -393,6 +393,7 @@  static bool mptcp_supported_sockopt(int level, int optname)
 		case IP_FREEBIND:
 		case IP_TRANSPARENT:
 		case IP_TOS:
+		case IP_TTL:
 
 		/* the following are control cmsg related */
 		case IP_PKTINFO:
@@ -406,7 +407,6 @@  static bool mptcp_supported_sockopt(int level, int optname)
 		case IP_RECVFRAGSIZE:
 
 		/* common stuff that need some love */
-		case IP_TTL:
 		case IP_BIND_ADDRESS_NO_PORT:
 		case IP_MTU_DISCOVER:
 		case IP_RECVERR:
@@ -438,6 +438,7 @@  static bool mptcp_supported_sockopt(int level, int optname)
 		case IPV6_V6ONLY:
 		case IPV6_TRANSPARENT:
 		case IPV6_FREEBIND:
+		case IPV6_UNICAST_HOPS:
 
 		/* the following are control cmsg related */
 		case IPV6_RECVPKTINFO:
@@ -460,7 +461,6 @@  static bool mptcp_supported_sockopt(int level, int optname)
 		case IPV6_TCLASS:
 		case IPV6_PKTINFO:
 		case IPV6_2292PKTOPTIONS:
-		case IPV6_UNICAST_HOPS:
 		case IPV6_MTU_DISCOVER:
 		case IPV6_MTU:
 		case IPV6_RECVERR:
@@ -734,6 +734,7 @@  static int mptcp_setsockopt_v4(struct mptcp_sock *msk, int optname,
 	case IP_FREEBIND:
 	case IP_TRANSPARENT:
 	case IP_TOS:
+	case IP_TTL:
 		return mptcp_setsockopt_all_sf(msk, SOL_IP, optname, optval, optlen);
 	}
 
@@ -747,6 +748,7 @@  static int mptcp_setsockopt_v6(struct mptcp_sock *msk, int optname,
 	case IPV6_V6ONLY:
 	case IPV6_TRANSPARENT:
 	case IPV6_FREEBIND:
+	case IPV6_UNICAST_HOPS:
 		return mptcp_setsockopt_all_sf(msk, SOL_IPV6, optname, optval, optlen);
 	}
 
@@ -1322,6 +1324,7 @@  static int mptcp_getsockopt_v4(struct mptcp_sock *msk, int optname,
 	case IP_FREEBIND:
 	case IP_TRANSPARENT:
 	case IP_TOS:
+	case IP_TTL:
 		return mptcp_getsockopt_msk(msk, SOL_IP, optname, optval, optlen);
 	}
 
@@ -1335,6 +1338,7 @@  static int mptcp_getsockopt_v6(struct mptcp_sock *msk, int optname,
 	case IPV6_V6ONLY:
 	case IPV6_TRANSPARENT:
 	case IPV6_FREEBIND:
+	case IPV6_UNICAST_HOPS:
 		return mptcp_getsockopt_msk(msk, SOL_IPV6, optname, optval, optlen);
 	}
 
@@ -1436,6 +1440,10 @@  static void sync_socket_options(struct mptcp_sock *msk, struct sock *ssk)
 
 	inet_sk(ssk)->transparent = inet_sk(sk)->transparent;
 	inet_sk(ssk)->freebind = inet_sk(sk)->freebind;
+	inet_sk(ssk)->uc_ttl = inet_sk(sk)->uc_ttl;
+
+	if (ssk->sk_family == AF_INET6)
+		inet6_sk(ssk)->hop_limit = inet6_sk(sk)->hop_limit;
 }
 
 static void __mptcp_sockopt_sync(struct mptcp_sock *msk, struct sock *ssk)