[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
bug in address family checking?
- To: or-dev@xxxxxxxxxxxxx
- Subject: bug in address family checking?
- From: coderman <coderman@xxxxxxxxx>
- Date: Mon, 22 Dec 2008 16:45:34 -0800
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: or-dev-outgoing@xxxxxxxx
- Delivered-to: or-dev@xxxxxxxx
- Delivery-date: Mon, 22 Dec 2008 19:45:37 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=OltuKemwoE1i5HvfJafXCgM7JFLitrTUoS316wZ9LBk=; b=Qljk5YS0Z9iNnYEmUboFC20xU+LwMC16d3NS9XUN6AwcDRaQhjGfo3njph6YGjZxle eJl8KPvseBQ09uQaKu3x8IeuOPSE6qtVEqdGfigB9rw5191j6wG6uzNdSaSEJ8fJC/2d gTDxIy47fplExolysG3OXSiHAFG/BrYvnSKYQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=FLgzTUnXtrdOpw4suKfRdNoa37QQPt41QVmau66OZPyvdivQh5L1O9oGI7vGZc1ZA0 ni85o8kkMgMOKGDQLXoBwrmSlLh2tOQTVzWNrrOUgPjtieN3U8Eb/4LPCh8qsAhwCQy/ bU+3llc4OmurNUdmX2NbqdqKahhL7MhepvfXc=
- Reply-to: or-dev@xxxxxxxxxxxxx
- Sender: owner-or-dev@xxxxxxxxxxxxx
xiando was discussing strange messages in the log of the form:
[warn] tor_addr_is_null(): Bug: Called with unknown address family XXX
where XXX is some unexpected value.
in tracing this down, it always appears after
connection_exit_begin_conn() when the DNS resolve returns immediately
(cached name) and connection_exit_connect() is invoked.
based on the order of calls, it appears that connection_init() is
setting conn->socket_family but is not setting conn->addr.family
(which is what tor_addr_is_null() is looking for).
attached is a very simply patch to set both in connection_init().
however, i do not know enough about Tor internals or the nature of the
IPv6 changes to know if this is the right fix, or if some other cause
is at fault.
best regards,
diff -Naur orig-tor/src/or/connection.c mod-tor/src/or/connection.c
--- orig-tor/src/or/connection.c 2008-12-18 17:19:04.459856000 +0000
+++ mod-tor/src/or/connection.c 2008-12-23 00:32:51.577993904 +0000
@@ -260,6 +260,7 @@
conn->type = type;
conn->socket_family = socket_family;
+ conn->addr.family = socket_family;
if (!connection_is_listener(conn)) { /* listeners never use their buf */
conn->inbuf = buf_new();
conn->outbuf = buf_new();