remapped_to_exit || options->AllowDotExit);
if (addresstype == BAD_HOSTNAME) {
- log_warn(LD_APP, "Invalid onion hostname %s; rejecting",
- safe_str_client(socks->address));
control_event_client_status(LOG_WARN, "SOCKS_BAD_HOSTNAME HOSTNAME=%s",
escaped(socks->address));
connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL);
/** If address is of the form "y.onion" with a well-formed handle y:
* Put a NUL after y, lower-case it, and return ONION_HOSTNAME.
*
+ * If address is of the form "y.onion" with a badly-formed handle y:
+ * Return BAD_HOSTNAME and log a message.
+ *
* If address is of the form "y.exit" and <b>allowdotexit</b> is true:
* Put a NUL after y and return EXIT_HOSTNAME.
*
+ * If address is of the form "y.exit" and <b>allowdotexit</b> is false:
+ * Return BAD_HOSTNAME and log a message.
+ *
* Otherwise:
* Return NORMAL_HOSTNAME and change nothing.
*/
failed:
/* otherwise, return to previous state and return 0 */
*s = '.';
+ log_warn(LD_APP, "Invalid onion hostname %s; rejecting",
+ safe_str_client(address));
return BAD_HOSTNAME;
}