From: Erik Hugne <erik.hugne@ericsson.com>
To: <richard.alpe@ericsson.com>, <jon.maloy@ericsson.com>,
<ying.xue@windriver.com>, <netdev@vger.kernel.org>
Cc: <tipc-discussion@lists.sourceforge.net>
Subject: Re: [PATCH v2] tipc: don't reject messages if reversal fails
Date: Fri, 10 Apr 2015 14:15:59 +0200 [thread overview]
Message-ID: <20150410121559.GA28575@haze> (raw)
In-Reply-To: <1428667098-9504-1-git-send-email-erik.hugne@ericsson.com>
Please ignore this, i meant to send it only to tipc-discussion for review first..
//E
On Fri, Apr 10, 2015 at 01:58:18PM +0200, erik.hugne@ericsson.com wrote:
> From: Erik Hugne <erik.hugne@ericsson.com>
>
> When we fail to deliver a message to a socket, it is subject to
> message reversal. If the call to tipc_msg_reverse fails, we are
> passing dnode uninitialized to tipc_link_xmit_skb which causes the
> packet to either be dropped, or sent out to a random link. In the
> worst case this leads to a link reset.
> We fix this by only transmitting the message if reversal succeded.
> Also, the redundant check for 'err' is removed, because if the message
> was not consumed, it will always be set.
>
> Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
> ---
> v2: err check fix according to comments from Billie Alsup
>
> net/tipc/socket.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/tipc/socket.c b/net/tipc/socket.c
> index ee90d74..d215f73 100644
> --- a/net/tipc/socket.c
> +++ b/net/tipc/socket.c
> @@ -1701,7 +1701,7 @@ static int tipc_backlog_rcv(struct sock *sk, struct sk_buff *skb)
> atomic_add(truesize, dcnt);
> return 0;
> }
> - if (!err || tipc_msg_reverse(tsk_own_node(tsk), skb, &dnode, -err))
> + if (tipc_msg_reverse(tsk_own_node(tsk), skb, &dnode, -err))
> tipc_link_xmit_skb(net, skb, dnode, tsk->portid);
> return 0;
> }
> --
> 2.1.4
>
prev parent reply other threads:[~2015-04-10 12:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-10 11:58 [PATCH v2] tipc: don't reject messages if reversal fails erik.hugne
2015-04-10 12:15 ` Erik Hugne [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=20150410121559.GA28575@haze \
--to=erik.hugne@ericsson.com \
--cc=jon.maloy@ericsson.com \
--cc=netdev@vger.kernel.org \
--cc=richard.alpe@ericsson.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 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.