selftests: mptcp: set fullmesh flag in pm_nl_ctl
This patch added the fullmesh flag setting and clearing support in pm_nl_ctl: # pm_nl_ctl set ip flags fullmesh # pm_nl_ctl set ip flags nofullmesh Acked-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Geliang Tang <geliang.tang@suse.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
73c762c1f0
commit
c25d29be00
@ -28,7 +28,7 @@ static void syntax(char *argv[])
|
||||
fprintf(stderr, "\tadd [flags signal|subflow|backup|fullmesh] [id <nr>] [dev <name>] <ip>\n");
|
||||
fprintf(stderr, "\tdel <id> [<ip>]\n");
|
||||
fprintf(stderr, "\tget <id>\n");
|
||||
fprintf(stderr, "\tset <ip> [flags backup|nobackup]\n");
|
||||
fprintf(stderr, "\tset <ip> [flags backup|nobackup|fullmesh|nofullmesh]\n");
|
||||
fprintf(stderr, "\tflush\n");
|
||||
fprintf(stderr, "\tdump\n");
|
||||
fprintf(stderr, "\tlimits [<rcv addr max> <subflow max>]\n");
|
||||
@ -704,12 +704,14 @@ int set_flags(int fd, int pm_family, int argc, char *argv[])
|
||||
if (++arg >= argc)
|
||||
error(1, 0, " missing flags value");
|
||||
|
||||
/* do not support flag list yet */
|
||||
for (str = argv[arg]; (tok = strtok(str, ","));
|
||||
str = NULL) {
|
||||
if (!strcmp(tok, "backup"))
|
||||
flags |= MPTCP_PM_ADDR_FLAG_BACKUP;
|
||||
else if (strcmp(tok, "nobackup"))
|
||||
else if (!strcmp(tok, "fullmesh"))
|
||||
flags |= MPTCP_PM_ADDR_FLAG_FULLMESH;
|
||||
else if (strcmp(tok, "nobackup") &&
|
||||
strcmp(tok, "nofullmesh"))
|
||||
error(1, errno,
|
||||
"unknown flag %s", argv[arg]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user