[PATCH nft 1/2] meta: fix endianness in UID/GID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 add rule filter output meta skuid vmap { 1000 => accept }
 list table filter
 meta skuid map { 3892510720 => accept}
                  ^--------^
        this is 1000 in network byte order

Reported-by: Bjørnar Ness <bjornar.ness@xxxxxxxxx>
Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
---
 src/meta.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/meta.c b/src/meta.c
index 9606a44..80c2638 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -230,7 +230,7 @@ static const struct datatype uid_type = {
 	.type		= TYPE_UID,
 	.name		= "uid",
 	.desc		= "user ID",
-	.byteorder	= BYTEORDER_BIG_ENDIAN,
+	.byteorder	= BYTEORDER_HOST_ENDIAN,
 	.size		= sizeof(uid_t) * BITS_PER_BYTE,
 	.basetype	= &integer_type,
 	.print		= uid_type_print,
@@ -275,7 +275,7 @@ static const struct datatype gid_type = {
 	.type		= TYPE_GID,
 	.name		= "gid",
 	.desc		= "group ID",
-	.byteorder	= BYTEORDER_BIG_ENDIAN,
+	.byteorder	= BYTEORDER_HOST_ENDIAN,
 	.size		= sizeof(gid_t) * BITS_PER_BYTE,
 	.basetype	= &integer_type,
 	.print		= gid_type_print,
-- 
1.7.10.4

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




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux