Commit d3857b8f authored by David Ahern's avatar David Ahern Committed by Jakub Kicinski

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: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a824e261
This diff is collapsed.
...@@ -85,6 +85,7 @@ struct sock_args { ...@@ -85,6 +85,7 @@ struct sock_args {
const char *serverns; const char *serverns;
const char *password; const char *password;
const char *client_pw;
/* prefix for MD5 password */ /* prefix for MD5 password */
const char *md5_prefix_str; const char *md5_prefix_str;
union { union {
...@@ -1655,6 +1656,8 @@ static int do_client(struct sock_args *args) ...@@ -1655,6 +1656,8 @@ static int do_client(struct sock_args *args)
break; break;
} }
args->password = args->client_pw;
if (args->has_grp) if (args->has_grp)
sd = msock_client(args); sd = msock_client(args);
else else
...@@ -1764,7 +1767,7 @@ static int ipc_parent(int cpid, int fd, struct sock_args *args) ...@@ -1764,7 +1767,7 @@ static int ipc_parent(int cpid, int fd, struct sock_args *args)
return client_status; 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) static void print_usage(char *prog)
{ {
...@@ -1796,6 +1799,7 @@ 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 num number of times to send message\n"
"\n" "\n"
" -M password use MD5 sum protection\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" " -m prefix/len prefix and length to use for MD5 key\n"
" -g grp multicast group (e.g., 239.1.1.1)\n" " -g grp multicast group (e.g., 239.1.1.1)\n"
" -i interactive mode (default is echo and terminate)\n" " -i interactive mode (default is echo and terminate)\n"
...@@ -1900,6 +1904,9 @@ int main(int argc, char *argv[]) ...@@ -1900,6 +1904,9 @@ int main(int argc, char *argv[])
case 'M': case 'M':
args.password = optarg; args.password = optarg;
break; break;
case 'X':
args.client_pw = optarg;
break;
case 'm': case 'm':
args.md5_prefix_str = optarg; args.md5_prefix_str = optarg;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment