]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
meta: fix a format error display when we set priority to root or none
authorLiping Zhang <liping.zhang@spreadtrum.com>
Sun, 29 May 2016 10:08:09 +0000 (18:08 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 30 May 2016 09:55:47 +0000 (11:55 +0200)
Also delete the redundant '\n'.
This fixes:

  # nft add rule filter test meta priority set root
  # nft list chain filter test
  table ip filter {
      chain test {
          meta priority set root
  none
  ffff:ffff
      }
  }

Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/meta.c

index 74d2b4cc8f24aa356a436f5ab7080fd3b64cfcf4..75431a2f3865bdbb6cee3adb495899e014fb824a 100644 (file)
@@ -74,9 +74,11 @@ static void tchandle_type_print(const struct expr *expr)
 
        switch(handle) {
        case TC_H_ROOT:
-               printf("root\n");
+               printf("root");
+               break;
        case TC_H_UNSPEC:
-               printf("none\n");
+               printf("none");
+               break;
        default:
                if (TC_H_MAJ(handle) == 0)
                        printf(":%04x", TC_H_MIN(handle));