]> git.baikalelectronics.ru Git - kernel.git/commitdiff
selftests: mptcp: set fullmesh flag in pm_nl_ctl
authorGeliang Tang <geliang.tang@suse.com>
Thu, 3 Feb 2022 01:03:42 +0000 (17:03 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Feb 2022 11:44:08 +0000 (11:44 +0000)
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>
tools/testing/selftests/net/mptcp/pm_nl_ctl.c

index 354784512748a40002287abf66f86724bbcbbe24..152b84e44d69d79d1c7cea5eabc03b4915a3c692 100644 (file)
@@ -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]);
                        }