Netdev List
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Andy Lutomirski <luto@amacapital.net>,
	Network Development <netdev@vger.kernel.org>
Subject: Re: Why ECONNREFUSED from unix_dgram_sendmsg?
Date: Thu, 11 Sep 2014 17:58:59 +0200	[thread overview]
Message-ID: <1410451139.2693347.166368361.32138EFC@webmail.messagingengine.com> (raw)
In-Reply-To: <CALCETrUM1P0Sydps_4-5yPBOBD35zOcpACv-OX8b==xT0BC1xw@mail.gmail.com>



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

  reply	other threads:[~2014-09-11 15:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11 15:11 Why ECONNREFUSED from unix_dgram_sendmsg? Andy Lutomirski
2014-09-11 15:58 ` Hannes Frederic Sowa [this message]
2014-09-11 17:52   ` Andy Lutomirski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410451139.2693347.166368361.32138EFC@webmail.messagingengine.com \
    --to=hannes@stressinduktion.org \
    --cc=luto@amacapital.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox