netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: paul.gortmaker@windriver.com
Cc: erik.hugne@ericsson.com, netdev@vger.kernel.org,
	ying.xue@windriver.com, jon.maloy@ericsson.com,
	tipc-discussion@lists.sourceforge.net, nhan.tt.vo@dektech.com.au
Subject: Re: [PATCH v2] tipc: set sk_err correctly when connection fails
Date: Fri, 30 Aug 2013 16:07:30 -0400 (EDT)	[thread overview]
Message-ID: <20130830.160730.2177121530101785269.davem@davemloft.net> (raw)
In-Reply-To: <521F62AE.40101@windriver.com>

From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Thu, 29 Aug 2013 11:03:10 -0400

> On 13-08-28 03:29 AM, erik.hugne@ericsson.com wrote:
>> From: Erik Hugne <erik.hugne@ericsson.com>
>> 
>> Should a connect fail, if the publication/server is unavailable or
>> due to some other error, a positive value will be returned and errno
>> is never set. If the application code checks for an explicit zero
>> return from connect (success) or a negative return (failure), it
>> will not catch the error and subsequent send() calls will fail as
>> shown from the strace snippet below.
>> 
>> socket(0x1e /* PF_??? */, SOCK_SEQPACKET, 0) = 3
>> connect(3, {sa_family=0x1e /* AF_??? */, sa_data="\2\1\322\4\0\0\322\4\0\0\0\0\0\0"}, 16) = 111
>> sendto(3, "test", 4, 0, NULL, 0)        = -1 EPIPE (Broken pipe)
>> 
>> The reason for this behaviour is that TIPC wrongly inverts error
>> codes set in sk_err.
>> 
>> Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
>> ---
>> 
>> [v2: add more details to commit message]
> 
> Thanks -- this now conveys the required triplet: 1) user visible symptom,
> 2) underlying technical cause, and 3) the why and how of the fix.

Applied and queued up for -stable, thanks everyone.

      reply	other threads:[~2013-08-30 20:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28  7:29 [PATCH v2] tipc: set sk_err correctly when connection fails erik.hugne
2013-08-29 15:03 ` Paul Gortmaker
2013-08-30 20:07   ` David Miller [this message]

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=20130830.160730.2177121530101785269.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=erik.hugne@ericsson.com \
    --cc=jon.maloy@ericsson.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhan.tt.vo@dektech.com.au \
    --cc=paul.gortmaker@windriver.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=ying.xue@windriver.com \
    /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;
as well as URLs for NNTP newsgroup(s).