]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
iptuntap: fix multi-queue flag display
authorDavid Marchand <david.marchand@redhat.com>
Wed, 1 Sep 2021 15:48:26 +0000 (17:48 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 2 Sep 2021 15:41:17 +0000 (08:41 -0700)
When creating a tap with multi_queue flag, this flag is not displayed
when dumping:

$ ip tuntap add tap23 mode tap multi_queue
$ ip tuntap
tap23: tap persist0x100

While at it, add a space between known flags and hexdump of unknown
ones.

Fixes: c41e038f48a3 ("iptuntap: allow creation of multi-queue tun/tap device")
Signed-off-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/iptuntap.c

index 9cdb4a806c5a33f388f5182340c79c84862c0792..96ca1ae72d331bc0fbdcde60fdbb8946af9234e6 100644 (file)
@@ -243,6 +243,9 @@ static void print_flags(long flags)
        if (flags & IFF_ONE_QUEUE)
                print_string(PRINT_ANY, NULL, " %s", "one_queue");
 
+       if (flags & IFF_MULTI_QUEUE)
+               print_string(PRINT_ANY, NULL, " %s", "multi_queue");
+
        if (flags & IFF_VNET_HDR)
                print_string(PRINT_ANY, NULL, " %s", "vnet_hdr");
 
@@ -253,9 +256,10 @@ static void print_flags(long flags)
                print_string(PRINT_ANY, NULL, " %s", "filter");
 
        flags &= ~(IFF_TUN | IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE |
-                  IFF_VNET_HDR | IFF_PERSIST | IFF_NOFILTER);
+                  IFF_MULTI_QUEUE | IFF_VNET_HDR | IFF_PERSIST |
+                  IFF_NOFILTER);
        if (flags)
-               print_0xhex(PRINT_ANY, NULL, "%#llx", flags);
+               print_0xhex(PRINT_ANY, NULL, " %#llx", flags);
 
        close_json_array(PRINT_JSON, NULL);
 }