David Woodhouse
2003-Oct-26 10:50 UTC
getsockopt TCP_NODELAY: Socket operation on non-socket
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 192.168.0.1 3128'" pentafluge.infradead.org exec bin/courier-imap.sh 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)); return; } if (opt == 1) { -- dwmw2
David Woodhouse
2003-Oct-27 20:57 UTC
[PATCH] Resend: getsockopt TCP_NODELAY: Socket operation on non-socket
On Sun, 2003-10-26 at 10:50 +0000, David Woodhouse wrote:> 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 192.168.0.1 3128'" pentafluge.infradead.org exec bin/courier-imap.sh > 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)); return; } if (opt == 1) { -- dwmw2