diff mbox

[nft,2/3] meta: fix endianness in priority

Message ID 1464516489-21616-2-git-send-email-zlpnobody@163.com
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Liping Zhang May 29, 2016, 10:08 a.m. UTC
From: Liping Zhang <liping.zhang@spreadtrum.com>

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>
---
 src/meta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pablo Neira Ayuso May 30, 2016, 9:58 a.m. UTC | #1
On Sun, May 29, 2016 at 06:08:08PM +0800, Liping Zhang wrote:
> From: Liping Zhang <liping.zhang@spreadtrum.com>
> 
> 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
>       }
>   }

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/meta.c b/src/meta.c
index b8db0f8..74d2b4c 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -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,