[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Change interface of parse_addr_port() to return address in ...



Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/tmp/cvs-serv24505/src/common

Modified Files:
	util.c 
Log Message:
Change interface of parse_addr_port() to return address in host order, since most users seem to want that.

Index: util.c
===================================================================
RCS file: /home/or/cvsroot/src/common/util.c,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -d -r1.148 -r1.149
--- util.c	16 Oct 2004 21:41:12 -0000	1.148
+++ util.c	16 Oct 2004 21:53:29 -0000	1.149
@@ -2066,7 +2066,7 @@
  * <b>address</b> is provided, set *<b>address</b> to a copy of the
  * host portion of the string.  If <b>addr</b> is provided, try to
  * resolve the host portion of the string and store it into
- * *<b>addr</b> (in network byte order).  If <b>port</b> is provided,
+ * *<b>addr</b> (in host byte order).  If <b>port</b> is provided,
  * store the port number into *<b>port</b>, or 0 if no port is given.
  * Return 0 on success, -1 on failure.
  */
@@ -2102,6 +2102,7 @@
       ok = 0;
       *addr = 0;
     }
+    *addr = ntohl(*addr);
   }
 
   if (address && ok) {