From: Pablo Neira Ayuso Date: Sat, 24 Aug 2013 10:27:57 +0000 (+0200) Subject: datatype: fix wrong endianess in numeric ports X-Git-Tag: v0.099~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=facb3d65ae911418ee10ca2fd1c1ed9a9749cf3b;p=thirdparty%2Fnftables.git datatype: fix wrong endianess in numeric ports In (5075879 datatype: validate port number in inet_service_type_parse), conversion to network byte order was missing. Reported-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- diff --git a/src/datatype.c b/src/datatype.c index 3eec931b..12e876cf 100644 --- a/src/datatype.c +++ b/src/datatype.c @@ -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)