Skip to content

Commit 1195070

Browse files
Geliang Tangintel-lab-lkp
authored andcommitted
selftests: mptcp: sockopt: add inq argument
Introduce -i option to enable TCP_INQ testing. This prepares for consolidating TCP_INQ tests into a single binary by adding the necessary command-line interface. Signed-off-by: Geliang Tang <[email protected]>
1 parent 3de673c commit 1195070

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/testing/selftests/net/mptcp/mptcp_sockopt.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
static int pf = AF_INET;
3131
static int proto_tx = IPPROTO_MPTCP;
3232
static int proto_rx = IPPROTO_MPTCP;
33+
static bool inq;
3334

3435
#ifndef IPPROTO_MPTCP
3536
#define IPPROTO_MPTCP 262
@@ -138,7 +139,7 @@ static void die_perror(const char *msg)
138139

139140
static void die_usage(int r)
140141
{
141-
fprintf(stderr, "Usage: mptcp_sockopt [-6] [ -t tcp|mptcp ] [ -r tcp|mptcp]\n");
142+
fprintf(stderr, "Usage: mptcp_sockopt [-6] [ -t tcp|mptcp ] [ -r tcp|mptcp] [ -i]\n");
142143
exit(r);
143144
}
144145

@@ -277,7 +278,7 @@ static void parse_opts(int argc, char **argv)
277278
{
278279
int c;
279280

280-
while ((c = getopt(argc, argv, "h6t:r:")) != -1) {
281+
while ((c = getopt(argc, argv, "h6t:r:i")) != -1) {
281282
switch (c) {
282283
case 'h':
283284
die_usage(0);
@@ -291,6 +292,9 @@ static void parse_opts(int argc, char **argv)
291292
case 'r':
292293
proto_rx = protostr_to_num(optarg);
293294
break;
295+
case 'i':
296+
inq = true;
297+
break;
294298
default:
295299
die_usage(1);
296300
break;

0 commit comments

Comments
 (0)