@@ -1367,6 +1367,8 @@ static int mptcp_getsockopt_v4(struct mptcp_sock *msk, int optname,
char __user *optval, int __user *optlen)
{
switch (optname) {
+ case IP_FREEBIND:
+ case IP_TRANSPARENT:
case IP_TOS:
return mptcp_getsockopt_msk(msk, SOL_IP, optname, optval, optlen);
}
@@ -1374,6 +1376,19 @@ static int mptcp_getsockopt_v4(struct mptcp_sock *msk, int optname,
return -EOPNOTSUPP;
}
+static int mptcp_getsockopt_v6(struct mptcp_sock *msk, int optname,
+ char __user *optval, int __user *optlen)
+{
+ switch (optname) {
+ case IPV6_V6ONLY:
+ case IPV6_TRANSPARENT:
+ case IPV6_FREEBIND:
+ return mptcp_getsockopt_msk(msk, SOL_IPV6, optname, optval, optlen);
+ }
+
+ return -EOPNOTSUPP;
+}
+
static int mptcp_getsockopt_sol_mptcp(struct mptcp_sock *msk, int optname,
char __user *optval, int __user *optlen)
{
@@ -1413,6 +1428,8 @@ int mptcp_getsockopt(struct sock *sk, int level, int optname,
if (level == SOL_IP)
return mptcp_getsockopt_v4(msk, optname, optval, option);
+ if (level == SOL_IPV6)
+ return mptcp_getsockopt_v6(msk, optname, optval, option);
if (level == SOL_TCP)
return mptcp_getsockopt_sol_tcp(msk, optname, optval, option);
if (level == SOL_MPTCP)
Some socket options had a support for the "set" part but not the "get" one: - IP_FREEBIND - IP_TRANSPARENT - IPV6_V6ONLY - IPV6_TRANSPARENT - IPV6_FREEBIND Thanks to the previous commit, we can easily support them. Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> --- net/mptcp/sockopt.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)