[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALCETrWZQjcWawO2brnpfmzHFrmYekwaic9a6m_mKcWvB2dovg@mail.gmail.com>
Date: Thu, 11 Sep 2014 10:52:04 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Hannes Frederic Sowa <hannes@...essinduktion.org>
Cc: Network Development <netdev@...r.kernel.org>
Subject: Re: Why ECONNREFUSED from unix_dgram_sendmsg?
On Sep 11, 2014 8:59 AM, "Hannes Frederic Sowa"
<hannes@...essinduktion.org> wrote:
>
>
>
> On Thu, Sep 11, 2014, at 17:11, Andy Lutomirski wrote:
> > What is unix_dgram_sendmsg trying to tell me here?
> >
> > if (sock_flag(other, SOCK_DEAD)) {
> > /*
> > * Check with 1003.1g - what should
> > * datagram error
> > */
> > unix_state_unlock(other);
> > sock_put(other);
> >
> > err = 0;
> > unix_state_lock(sk);
> > if (unix_peer(sk) == other) {
> > unix_peer(sk) = NULL;
> > unix_state_unlock(sk);
> >
> > unix_dgram_disconnected(sk, other);
> > sock_put(other);
> > err = -ECONNREFUSED;
> >
> > I'm getting this intermittently on a seqpacket socket when the other
> > end dies. Shouldn't this be -ECONNRESET?
> >
> > git blame doesn't tell me anything here -- this code predates git.
>
> Changelogs were not that descriptive as they were today: :)
>
> commit 283fd6cf0be690a83b5dbb34e79130f8592c0765
> Author: davem <davem>
> Date: Fri Aug 20 10:59:51 1999 +0000
>
> Merge in ANK networking jumbo patch,
> which includes ATM from Werner Almesberger, Netfilter
> from Paul Russell, and massive SMP networking enhancements
> by Alexey.
>
> (in
> https://git.kernel.org/cgit/linux/kernel/git/davem/netdev-vger-cvs.git/)
>
> I agree, -ECONNRESET would be a better errno value, but this is hard to
> change because of backwards compatibility.
Might it be safe to change it for just seqpacket sockets? -ECONRESET
actually makes some sense for dgram sockets, assuming this code is
even reachable for dgram sockets.
Anyway, I'll have to fix my code regardless.
--Andy
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists