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

[or-cvs] Note to self: htonl(htonl(X)) is *not* "twice as good as ht...



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv23901/src/or

Modified Files:
	connection_edge.c 
Log Message:
Note to self: htonl(htonl(X)) is *not* "twice as good as htonl(X)".  Spotted by arma.

Index: connection_edge.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/connection_edge.c,v
retrieving revision 1.343
retrieving revision 1.344
diff -u -d -r1.343 -r1.344
--- connection_edge.c	2 Sep 2005 18:53:31 -0000	1.343
+++ connection_edge.c	3 Sep 2005 01:47:39 -0000	1.344
@@ -290,7 +290,7 @@
       return 0; /* circuit is closed, don't continue */
   } else {
     char connected_payload[8];
-    set_uint32(connected_payload, htonl(htonl(conn->addr)));
+    set_uint32(connected_payload, htonl(conn->addr));
     set_uint32(connected_payload+4,
                htonl(MAX_DNS_ENTRY_AGE)); /* XXXX fill with a real TTL */
     if (connection_edge_send_command(conn, circuit_get_by_edge_conn(conn),
@@ -1659,7 +1659,7 @@
   } else { /* normal stream */
     /* This must be the original address, not the redirected address. */
     char connected_payload[8];
-    set_uint32(connected_payload, htonl(htonl(conn->addr)));
+    set_uint32(connected_payload, htonl(conn->addr));
     set_uint32(connected_payload+4,
                htonl(MAX_DNS_ENTRY_AGE)); /* XXXX fill with a real TTL */
     connection_edge_send_command(conn, circuit_get_by_edge_conn(conn),