[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OpenSSH: cause of random kex_exchange_identification errors?



On 2022-06-15 03:48:38 +0200, Vincent Lefevre wrote:
> The source from misc.c is
> 
> int
> unset_nonblock(int fd)
> {
>         int val;
> 
>         val = fcntl(fd, F_GETFL);
>         if (val < 0) {
>                 error("fcntl(%d, F_GETFL): %s", fd, strerror(errno));
>                 return (-1);
>         }
>         if (!(val & O_NONBLOCK)) {
>                 debug3("fd %d is not O_NONBLOCK", fd);
>                 return (0);
>         }
>         debug("fd %d clearing O_NONBLOCK", fd);
>         val &= ~O_NONBLOCK;
>         if (fcntl(fd, F_SETFL, val) == -1) {
>                 debug("fcntl(%d, F_SETFL, ~O_NONBLOCK): %s",
>                     fd, strerror(errno));
>                 return (-1);
>         }
>         return (0);
> }
> 
> Well, one should get at least a debug message. I had already told
> that to the admins last week. But no such debug message appears,
> even when the connection succeeds! I'll try to have more information
> from the admins, in particular which debug lines they claim to see.

They set LogLevel to DEBUG, which explains that the debug3() message
doesn't appear. They can see debug lines when my connection succeeds,
but nothing in case of immediate failure. So this would mean that it
is the pipe() from server_accept_loop() in sshd.c that fails, as
nothing is logged in that case.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


Reply to: