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

[or-cvs] we used to kill the circuit when we receive a relay command...



Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	relay.c 
Log Message:
we used to kill the circuit when we receive a relay command we
don't recognize. now we just drop it. perhaps this will make us
more forward-compatible? or perhaps it will bite us? one day we
will find out.


Index: relay.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/relay.c,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- relay.c	15 Nov 2005 20:40:32 -0000	1.88
+++ relay.c	17 Nov 2005 03:40:20 -0000	1.89
@@ -798,11 +798,12 @@
   }
 
   log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
-       "Got an unexpected relay command %d, in state %d (%s). Closing.",
+       "Got an unexpected relay command %d, in state %d (%s). Dropping.",
        rh->command, conn->state, conn_state_to_string(conn->type, conn->state));
-  connection_edge_end(conn, END_STREAM_REASON_TORPROTOCOL, conn->cpath_layer);
-  connection_mark_for_close(conn);
-  return -1;
+  return 0; /* for forward compatibility, don't kill the circuit */
+//  connection_edge_end(conn, END_STREAM_REASON_TORPROTOCOL, conn->cpath_layer);
+//  connection_mark_for_close(conn);
+//  return -1;
 }
 
 /** An incoming relay cell has arrived on circuit <b>circ</b>. If
@@ -1035,8 +1036,10 @@
                               cell->payload+RELAY_HEADER_SIZE);
       return 0;
   }
-  warn(LD_PROTOCOL,"unknown relay command %d.",rh.command);
-  return -1;
+  log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
+         "Received unknown relay command %d. Perhaps the other side is using a newer version of Tor? Dropping.",
+         rh.command);
+  return 0; /* for forward compatibility, don't kill the circuit */
 }
 
 uint64_t stats_n_data_cells_packaged = 0;