* Why ECONNREFUSED from unix_dgram_sendmsg?
@ 2014-09-11 15:11 Andy Lutomirski
2014-09-11 15:58 ` Hannes Frederic Sowa
0 siblings, 1 reply; 3+ messages in thread
From: Andy Lutomirski @ 2014-09-11 15:11 UTC (permalink / raw)
To: Network Development
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.
--Andy
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Why ECONNREFUSED from unix_dgram_sendmsg?
2014-09-11 15:11 Why ECONNREFUSED from unix_dgram_sendmsg? Andy Lutomirski
@ 2014-09-11 15:58 ` Hannes Frederic Sowa
2014-09-11 17:52 ` Andy Lutomirski
0 siblings, 1 reply; 3+ messages in thread
From: Hannes Frederic Sowa @ 2014-09-11 15:58 UTC (permalink / raw)
To: Andy Lutomirski, Network Development
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.
Bye,
Hannes
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Why ECONNREFUSED from unix_dgram_sendmsg?
2014-09-11 15:58 ` Hannes Frederic Sowa
@ 2014-09-11 17:52 ` Andy Lutomirski
0 siblings, 0 replies; 3+ messages in thread
From: Andy Lutomirski @ 2014-09-11 17:52 UTC (permalink / raw)
To: Hannes Frederic Sowa; +Cc: Network Development
On Sep 11, 2014 8:59 AM, "Hannes Frederic Sowa"
<hannes@stressinduktion.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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-11 17:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-11 15:11 Why ECONNREFUSED from unix_dgram_sendmsg? Andy Lutomirski
2014-09-11 15:58 ` Hannes Frederic Sowa
2014-09-11 17:52 ` Andy Lutomirski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox