apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r653244 - in /apr/apr/branches/1.3.x: CHANGES network_io/unix/sockaddr.c
Date Sun, 04 May 2008 16:25:19 GMT
Author: trawick
Date: Sun May  4 09:25:19 2008
New Revision: 653244

URL: http://svn.apache.org/viewvc?rev=653244&view=rev
Log:
backport trunk rev 652951

apr_getservbyname(): Use proper method for converting port
to host byte order.

PR 44903.
Submitted by:  Chris Taylor <ctaylor wadeford.plus.com>
Reviewed by: trawick


Modified:
    apr/apr/branches/1.3.x/CHANGES
    apr/apr/branches/1.3.x/network_io/unix/sockaddr.c

Modified: apr/apr/branches/1.3.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/CHANGES?rev=653244&r1=653243&r2=653244&view=diff
==============================================================================
--- apr/apr/branches/1.3.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.3.x/CHANGES [utf-8] Sun May  4 09:25:19 2008
@@ -1,6 +1,10 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 1.3.0
 
+  *) apr_getservbyname(): Use proper method for converting port
+     to host byte order.  PR 44903.
+     [Chris Taylor <ctaylor wadeford.plus.com>]
+
   *) Use /dev/urandom in preference to /dev/random as entropy source
      for apr_generate_random_bytes.  PR 44881.  [Bojan Smojver]
 

Modified: apr/apr/branches/1.3.x/network_io/unix/sockaddr.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/network_io/unix/sockaddr.c?rev=653244&r1=653243&r2=653244&view=diff
==============================================================================
--- apr/apr/branches/1.3.x/network_io/unix/sockaddr.c (original)
+++ apr/apr/branches/1.3.x/network_io/unix/sockaddr.c Sun May  4 09:25:19 2008
@@ -711,7 +711,7 @@
         return APR_EINVAL;
 
     if ((se = getservbyname(servname, NULL)) != NULL){
-        sockaddr->port = htons(se->s_port);
+        sockaddr->port = ntohs(se->s_port);
         sockaddr->servname = apr_pstrdup(sockaddr->pool, servname);
         sockaddr->sa.sin.sin_port = se->s_port;
         return APR_SUCCESS;



Mime
View raw message