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

[or-cvs] When we"re connecting to an OR and he"s got a different nic...



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

Modified Files:
	connection_or.c 
Log Message:
When we're connecting to an OR and he's got a different nickname/key
than we were expecting, only complain loudly if we're an OP or an
authdirserver. Complaining loudly to OR admins just confuses people.


Index: connection_or.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/connection_or.c,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -d -r1.164 -r1.165
--- connection_or.c	1 Apr 2005 20:15:55 -0000	1.164
+++ connection_or.c	6 Apr 2005 00:50:40 -0000	1.165
@@ -436,6 +436,8 @@
   crypto_pk_env_t *identity_rcvd=NULL;
   char digest_rcvd[DIGEST_LEN];
   or_options_t *options = get_options();
+  int severity = (authdir_mode(options) || !server_mode(options))
+                 ? LOG_WARN : LOG_INFO;
 
   conn->state = OR_CONN_STATE_OPEN;
   connection_watch_events(conn, EV_READ);
@@ -479,7 +481,9 @@
   if (router && /* we know this nickname */
       router->is_verified && /* make sure it's the right guy */
       memcmp(digest_rcvd, router->identity_digest, DIGEST_LEN) != 0) {
-    log_fn(LOG_WARN, "Identity key not as expected for router claiming to be '%s' (%s:%d) ", nickname, conn->address, conn->port);
+    log_fn(severity,
+           "Identity key not as expected for router claiming to be '%s' (%s:%d)",
+           nickname, conn->address, conn->port);
     return -1;
   }
 #if 0
@@ -507,7 +511,7 @@
       }
     } else if (strcasecmp(conn->nickname, nickname)) {
       /* I was aiming for a nickname.  Did I get it? */
-      log_fn(authdir_mode(options) ? LOG_WARN : LOG_INFO,
+      log_fn(severity,
              "Other side (%s:%d) is '%s', but we tried to connect to '%s'",
              conn->address, conn->port, nickname, conn->nickname);
       control_event_or_conn_status(conn, OR_CONN_EVENT_FAILED);