summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net/nettest.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2021-01-13 20:09:46 -0700
committerJakub Kicinski <kuba@kernel.org>2021-01-14 16:26:49 -0800
commitd3857b8f0d192e0313990481d223e554db7d878e (patch)
tree3c5710bb733c995b4420063f0f0c421670dd7100 /tools/testing/selftests/net/nettest.c
parenta824e261d7cd95b0f04a3feff51f8e0fe2881b44 (diff)
selftests: Add new option for client-side passwords
Add new option to nettest to specify MD5 password to use for client side. Update fcnal-test script. This is needed for a single instance running both server and client modes to test password mismatches. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/net/nettest.c')
-rw-r--r--tools/testing/selftests/net/nettest.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/nettest.c b/tools/testing/selftests/net/nettest.c
index 4c8d4570872d..e20e74e001a2 100644
--- a/tools/testing/selftests/net/nettest.c
+++ b/tools/testing/selftests/net/nettest.c
@@ -85,6 +85,7 @@ struct sock_args {
const char *serverns;
const char *password;
+ const char *client_pw;
/* prefix for MD5 password */
const char *md5_prefix_str;
union {
@@ -1655,6 +1656,8 @@ static int do_client(struct sock_args *args)
break;
}
+ args->password = args->client_pw;
+
if (args->has_grp)
sd = msock_client(args);
else
@@ -1764,7 +1767,7 @@ static int ipc_parent(int cpid, int fd, struct sock_args *args)
return client_status;
}
-#define GETOPT_STR "sr:l:p:t:g:P:DRn:M:m:d:BN:O:SCi6L:0:1:2:Fbq"
+#define GETOPT_STR "sr:l:p:t:g:P:DRn:M:X:m:d:BN:O:SCi6L:0:1:2:Fbq"
static void print_usage(char *prog)
{
@@ -1796,6 +1799,7 @@ static void print_usage(char *prog)
" -n num number of times to send message\n"
"\n"
" -M password use MD5 sum protection\n"
+ " -X password MD5 password for client mode\n"
" -m prefix/len prefix and length to use for MD5 key\n"
" -g grp multicast group (e.g., 239.1.1.1)\n"
" -i interactive mode (default is echo and terminate)\n"
@@ -1900,6 +1904,9 @@ int main(int argc, char *argv[])
case 'M':
args.password = optarg;
break;
+ case 'X':
+ args.client_pw = optarg;
+ break;
case 'm':
args.md5_prefix_str = optarg;
break;