]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
datatype: fix wrong endianess in numeric ports
authorPablo Neira Ayuso <pablo@netfilter.org>
Sat, 24 Aug 2013 10:27:57 +0000 (12:27 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 24 Aug 2013 10:27:57 +0000 (12:27 +0200)
In (5075879 datatype: validate port number in inet_service_type_parse),
conversion to network byte order was missing.

Reported-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/datatype.c

index 3eec931be38227e4bfe4d388de9731c421502f1b..12e876cf3cbe8d605b9c8db67d14ab22f34fcbf2 100644 (file)
@@ -525,7 +525,7 @@ static struct error_record *inet_service_type_parse(const struct expr *sym,
                if (errno == ERANGE || i > UINT16_MAX)
                        return error(&sym->location, "Service out of range");
 
-               port = i;
+               port = htons(i);
        } else {
                err = getaddrinfo(NULL, sym->identifier, NULL, &ai);
                if (err != 0)