From: Ying Xue <ying.xue@windriver.com>
To: <erik.hugne@ericsson.com>
Cc: <netdev@vger.kernel.org>, <jon.maloy@ericsson.com>,
<paul.gortmaker@windriver.com>,
<tipc-discussion@lists.sourceforge.net>,
<nhan.tt.vo@dektech.com.au>
Subject: Re: [PATCH] tipc: set sk_err correctly when connection fails
Date: Tue, 27 Aug 2013 08:45:26 +0800 [thread overview]
Message-ID: <521BF6A6.1020309@windriver.com> (raw)
In-Reply-To: <1377266200-26691-1-git-send-email-erik.hugne@ericsson.com>
On 08/23/2013 09:56 PM, erik.hugne@ericsson.com wrote:
> From: Erik Hugne <erik.hugne@ericsson.com>
>
> This fixes a problem when connect() fails and returns the error
> code as a positive value, whereas errno itself is never set. The
> reason is that error codes set in sk_err should never be inverted.
>
> Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
> ---
> net/tipc/socket.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/tipc/socket.c b/net/tipc/socket.c
> index ce8249c..6cc7ddd 100644
> --- a/net/tipc/socket.c
> +++ b/net/tipc/socket.c
> @@ -1257,7 +1257,7 @@ static u32 filter_connect(struct tipc_sock *tsock, struct sk_buff **buf)
> /* Accept only ACK or NACK message */
> if (unlikely(msg_errcode(msg))) {
> sock->state = SS_DISCONNECTING;
> - sk->sk_err = -ECONNREFUSED;
> + sk->sk_err = ECONNREFUSED;
> retval = TIPC_OK;
> break;
> }
> @@ -1268,7 +1268,7 @@ static u32 filter_connect(struct tipc_sock *tsock, struct sk_buff **buf)
> res = auto_connect(sock, msg);
> if (res) {
> sock->state = SS_DISCONNECTING;
> - sk->sk_err = res;
> + sk->sk_err = -res;
> retval = TIPC_OK;
> break;
> }
>
next prev parent reply other threads:[~2013-08-27 0:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-23 13:56 [PATCH] tipc: set sk_err correctly when connection fails erik.hugne
2013-08-27 0:45 ` Ying Xue [this message]
2013-08-27 13:20 ` Paul Gortmaker
2013-08-27 15:18 ` Erik Hugne
2013-08-27 18:12 ` Paul Gortmaker
2013-08-28 1:32 ` Ying Xue
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=521BF6A6.1020309@windriver.com \
--to=ying.xue@windriver.com \
--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 \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.