diff options
author | Roger Dingledine <arma@torproject.org> | 2005-05-02 21:48:54 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-05-02 21:48:54 +0000 |
commit | c9e83eb1b406ec268ebebc761e7db20665bcf455 (patch) | |
tree | 98d1bdade965e24db85a635d81432efc3bd19d05 | |
parent | 57b7427c2d9b333462e3e396fcd5d6063d7f189e (diff) | |
download | tor-c9e83eb1b406ec268ebebc761e7db20665bcf455.tar.gz tor-c9e83eb1b406ec268ebebc761e7db20665bcf455.zip |
when we refuse a router descriptor, log contactinfo and source address.
svn:r4156
-rw-r--r-- | src/or/directory.c | 1 | ||||
-rw-r--r-- | src/or/dirserv.c | 18 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 36ffeb5841..8e2e44b8f1 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1035,6 +1035,7 @@ directory_handle_command_post(connection_t *conn, char *headers, case -1: /* malformed descriptor, or something wrong */ write_http_status_line(conn, 400, msg?msg:"Malformed or unacceptable server descriptor"); + log_fn(LOG_NOTICE,"Rejected descriptor published by '%s'.", conn->address); break; case 0: /* descriptor was well-formed but server has not been approved */ diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 994a4e6749..f91bd8c70a 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -293,9 +293,9 @@ dirserv_router_has_valid_address(routerinfo_t *ri) * to NULL. * * Return 1 if descriptor is well-formed and accepted; - * 0 if well-formed and server is unapproved but accepted; - * -1 if well-formed but rejected; - * -2 if not well-formed. + * 0 if well-formed and server is unapproved but accepted; + * -1 if it looks vaguely like a router descriptor but rejected; + * -2 if we can't find a router descriptor in *desc. */ int dirserv_add_descriptor(const char **desc, const char **msg) @@ -338,7 +338,7 @@ dirserv_add_descriptor(const char **desc, const char **msg) /* Okay. Now check whether the fingerprint is recognized. */ r = dirserv_router_fingerprint_is_known(ri); if (r==-1) { - log_fn(LOG_WARN, "Known nickname '%s', wrong fingerprint. Not adding.", ri->nickname); + log_fn(LOG_WARN, "Known nickname '%s', wrong fingerprint. Not adding (ContactInfo '%s').", ri->nickname, ri->contact_info); *msg = "Rejected: There is already a verified server with this nickname and a different fingerprint."; routerinfo_free(ri); *desc = end; @@ -357,23 +357,23 @@ dirserv_add_descriptor(const char **desc, const char **msg) /* Is there too much clock skew? */ now = time(NULL); if (ri->published_on > now+ROUTER_ALLOW_SKEW) { - log_fn(LOG_NOTICE, "Publication time for nickname '%s' is too far (%d minutes) in the future; possible clock skew. Not adding.", - ri->nickname, (int)((ri->published_on-now)/60)); + log_fn(LOG_NOTICE, "Publication time for nickname '%s' is too far (%d minutes) in the future; possible clock skew. Not adding (ContactInfo '%s').", + ri->nickname, (int)((ri->published_on-now)/60), ri->contact_info); *msg = "Rejected: Your clock is set too far in the future, or your timezone is not correct."; routerinfo_free(ri); *desc = end; return -1; } if (ri->published_on < now-ROUTER_MAX_AGE) { - log_fn(LOG_NOTICE, "Publication time for router with nickname '%s' is too far (%d minutes) in the past. Not adding.", - ri->nickname, (int)((now-ri->published_on)/60)); + log_fn(LOG_NOTICE, "Publication time for router with nickname '%s' is too far (%d minutes) in the past. Not adding (ContactInfo '%s').", + ri->nickname, (int)((now-ri->published_on)/60), ri->contact_info); *msg = "Rejected: Server is expired, or your clock is too far in the past, or your timezone is not correct."; routerinfo_free(ri); *desc = end; return -1; } if (dirserv_router_has_valid_address(ri) < 0) { - log_fn(LOG_NOTICE, "Router with nickname '%s' has invalid address '%s'. Not adding.", ri->nickname, ri->address); + log_fn(LOG_NOTICE, "Router with nickname '%s' has invalid address '%s'. Not adding (ContactInfo '%s').", ri->nickname, ri->address, ri->contact_info); *msg = "Rejected: Address is not an IP, or IP is a private address."; routerinfo_free(ri); *desc = end; |