getsockopt TCP_NODELAY: Socket operation on non-socket

David Woodhouse dwmw2 at
Sun Oct 26 21:50:27 EST 2003

We get the warning above whenever we use a ProxyCommand. We _know_ it's
a pipe, so we can't use sockopts on it. So we shouldn't bitch about it. 

This breaks all kinds of things which use SSH transparently; including
pine, which really wants the first thing it receives from an IMAP server
to be a valid imap greeting... which $subject is not.

$ ssh -o "proxycommand sh -c '( echo CONNECT %h:%p HTTP/1.0; echo; cat ) | nc 3128'" exec bin/
getsockopt TCP_NODELAY: Socket operation on non-socket
* PREAUTH Ready.

In fact, it's probably never necessary to bitch about it, so let's make
it a debug message only...

Index: misc.c
RCS file: /cvs/openssh/misc.c,v
retrieving revision 1.37
diff -u -p -r1.37 misc.c
--- misc.c	22 Sep 2003 11:04:23 -0000	1.37
+++ misc.c	26 Oct 2003 10:48:35 -0000
@@ -97,7 +97,7 @@ set_nodelay(int fd)
 	optlen = sizeof opt;
 	if (getsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, &optlen) == -1) {
-		error("getsockopt TCP_NODELAY: %.100s", strerror(errno));
+		debug("getsockopt TCP_NODELAY: %.100s", strerror(errno));
 	if (opt == 1) {


More information about the openssh-unix-dev mailing list