[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00809f4a-e7ca-bf53-7824-e22791ee6738@linux.dev>
Date: Mon, 14 Aug 2023 23:23:49 -0700
From: Martin KaFai Lau <martin.lau@...ux.dev>
To: Geliang Tang <geliang.tang@...e.com>
Cc: bpf@...r.kernel.org, netdev@...r.kernel.org, mptcp@...ts.linux.dev,
linux-security-module@...r.kernel.org, selinux@...r.kernel.org,
linux-kselftest@...r.kernel.org, Yonghong Song <yonghong.song@...ux.dev>,
Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>, Song Liu <song@...nel.org>,
Yonghong Song <yhs@...com>, John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>, Stanislav Fomichev <sdf@...gle.com>,
Hao Luo <haoluo@...gle.com>, Jiri Olsa <jolsa@...nel.org>,
Florent Revest <revest@...omium.org>, Brendan Jackman
<jackmanb@...omium.org>, Matthieu Baerts <matthieu.baerts@...sares.net>,
Mat Martineau <martineau@...nel.org>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
John Johansen <john.johansen@...onical.com>, Paul Moore
<paul@...l-moore.com>, James Morris <jmorris@...ei.org>,
"Serge E. Hallyn" <serge@...lyn.com>,
Stephen Smalley <stephen.smalley.work@...il.com>,
Eric Paris <eparis@...isplace.org>, Mykola Lysenko <mykolal@...com>,
Shuah Khan <shuah@...nel.org>, Simon Horman <horms@...nel.org>
Subject: Re: [PATCH mptcp-next v13 4/4] selftests/bpf: Add mptcpify test
On 8/11/23 7:54 PM, Geliang Tang wrote:
> +static int verify_mptcpify(int server_fd)
> +{
> + socklen_t optlen;
> + char cmd[256];
> + int protocol;
> + int err = 0;
> +
> + optlen = sizeof(protocol);
> + if (!ASSERT_OK(getsockopt(server_fd, SOL_SOCKET, SO_PROTOCOL, &protocol, &optlen),
> + "getsockopt(SOL_PROTOCOL)"))
> + return -1;
> +
> + if (!ASSERT_EQ(protocol, IPPROTO_MPTCP, "protocol isn't MPTCP"))
> + err++;
> +
> + /* Output of nstat:
> + *
> + * #kernel
> + * MPTcpExtMPCapableSYNACKRX 1 0.0
> + */
> + snprintf(cmd, sizeof(cmd),
> + "ip netns exec %s nstat -asz %s | awk '%s' | grep -q '%s'",
> + NS_TEST, "MPTcpExtMPCapableSYNACKRX",
> + "NR==1 {next} {print $2}", "1");
Is the mp-capable something that the regular mptcp user want to learn from a fd
also? Does it have a simpler way like to learn this, eg. getsockopt(fd,
SOL_MPTCP, MPTCP_xxx), instead of parsing text output?
> + if (!ASSERT_OK(system(cmd), "No MPTcpExtMPCapableSYNACKRX found!"))
Powered by blists - more mailing lists