From: Wouter Wijngaards Date: Mon, 11 Dec 2006 12:52:45 +0000 (+0000) Subject: Byteswap for getservbyport, function needs network format, so is htons. X-Git-Tag: release-1.2.0~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eae0b8f5b529d4a8aacf57ab170b9bc1ab2ed76b;p=thirdparty%2Fldns.git Byteswap for getservbyport, function needs network format, so is htons. --- diff --git a/host2str.c b/host2str.c index c44b44f6..872534d2 100644 --- a/host2str.c +++ b/host2str.c @@ -437,7 +437,7 @@ ldns_rdf2buffer_str_wks(ldns_buffer *output, const ldns_rdf *rdf) for (current_service = 0; current_service < ldns_rdf_size(rdf) * 7; current_service++) { if (ldns_get_bit(&(ldns_rdf_data(rdf)[1]), current_service)) { - service = getservbyport((int) ntohs(current_service), + service = getservbyport((int) htons(current_service), proto_name); if (service && service->s_name) { ldns_buffer_printf(output, "%s ", service->s_name);