]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
meta: fix endianness in priority
authorLiping Zhang <liping.zhang@spreadtrum.com>
Sun, 29 May 2016 10:08:08 +0000 (18:08 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 30 May 2016 09:55:46 +0000 (11:55 +0200)
For example, after we add rule to set priority 1:2, it will be displayed in network
byte order as 0200:0100, this is wrong:

  # nft add rule filter test meta priority set 1:2
  # nft list chain filter test
  table ip filter {
      chain test {
          meta priority set 0200:0100
      }
  }

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

index b8db0f89fe7c8ed3661f05259a0f37ac30c30d00..74d2b4cc8f24aa356a436f5ab7080fd3b64cfcf4 100644 (file)
@@ -128,7 +128,7 @@ static const struct datatype tchandle_type = {
        .type           = TYPE_TC_HANDLE,
        .name           = "tc_handle",
        .desc           = "TC handle",
-       .byteorder      = BYTEORDER_BIG_ENDIAN,
+       .byteorder      = BYTEORDER_HOST_ENDIAN,
        .size           = 4 * BITS_PER_BYTE,
        .basetype       = &integer_type,
        .print          = tchandle_type_print,