ioctl(DIOCNATLOOK) failed: Inappropriate ioctl for device

Fabian Keil freebsd-listen at
Sat Dec 2 16:03:37 UTC 2006

The current version of get_pf_socket only returns
a proper PF socket if the socket was already open.

From the comments I assume it was meant to be
called once on start-up where the return value
doesn't matter, but at the moment that's not the
case and the first intercepted request leads to
an error message because an invalid socket is used:

Dec 02 16:39:59.334 [notice] Tor opening log file.
Dec 02 16:39:59.334 [warn] Can't log to stdout with RunAsDaemon set; skipping stdout
Dec 02 16:40:02.306 [notice] We now have enough directory information to build circuits.
Dec 02 16:40:04.093 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.
Dec 02 16:41:15.674 [warn] ioctl(DIOCNATLOOK) failed: Inappropriate ioctl for device
Dec 02 16:41:15.676 [warn] Fetching original destination failed. Closing.
Dec 02 16:41:15.677 [warn] connection_about_to_close_connection(): Bug: Closing stream (marked at connection_edge.c:1483) without having set end_reason. Please tell Nick.

This would be one way to fix it:

--- connection_edge.c.orig      Fri Oct 20 21:11:15 2006
+++ connection_edge.c   Sat Dec  2 16:51:52 2006
@@ -1309,6 +1309,7 @@
   pf_socket = pf;
+  return pf_socket;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <>

More information about the tor-dev mailing list