]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
meta: fix endianness in UID/GID
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 29 Nov 2013 10:28:07 +0000 (11:28 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 29 Nov 2013 10:29:41 +0000 (11:29 +0100)
 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@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/meta.c

index 9606a44ba4bd689a23c3524ad92b2f0e15e5ede7..80c2638f08ed1ea6b898404fddfb697e273bdea2 100644 (file)
@@ -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,