All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlad Yasevich <vladislav.yasevich@hp.com>
To: linux-sctp@vger.kernel.org
Subject: Re: [PATCH for net-next-2.6] sctp: fix oops when update assoc retran
Date: Tue, 11 May 2010 13:23:54 +0000	[thread overview]
Message-ID: <4BE95A6A.8060605@hp.com> (raw)
In-Reply-To: <4BE8FC76.40000@cn.fujitsu.com>



Shan Wei wrote:
> Wei Yongjun wrote, at 05/11/2010 02:43 PM:
>> commit fbdf501c9374966a56829ecca3a7f25d2b49a305
>>   sctp: Do no select unconfirmed transports for retransmissions
>>
>> added code to make sure that we do not select unconfirmed paths
>> for data transmission.  This caused a problem when there are only
>> 2 paths, 1 unconfirmed and 1 unreachable.  In that case, the next
>> retransmit path returned is NULL and that causes a kernel crash.
>>
>> commit d598b166ced20d9b9281ea3527c0e18405ddb803
>>   sctp: Make sure we always return valid retransmit path
>> try to fix it, but if DEBUG is configured, the oops is still
>> exists.
>>
>> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
>> ---
>>  net/sctp/associola.c |   15 ++++++++-------
>>  1 files changed, 8 insertions(+), 7 deletions(-)
>>
>> diff --git a/net/sctp/associola.c b/net/sctp/associola.c
>> index 3912420..1f49af5 100644
>> --- a/net/sctp/associola.c
>> +++ b/net/sctp/associola.c
>> @@ -1323,15 +1323,16 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc)
>>  		}
>>  	}
>>  
>> -	if (t)
>> +	if (t) {
>>  		asoc->peer.retran_path = t;
>>  
>> -	SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_update_retran_path:association"
>> -				 " %p addr: ",
>> -				 " port: %d\n",
>> -				 asoc,
>> -				 (&t->ipaddr),
>> -				 ntohs(t->ipaddr.v4.sin_port));
>> +		SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_update_retran_path:"
> 
> Try __func__ to simplify code.
> 
>> +					 "association %p addr: ",
>> +					 " port: %d\n",
>> +					 asoc,
>> +					 (&t->ipaddr),
>> +					 ntohs(t->ipaddr.v4.sin_port));
>> +	}
> 
> How about providing debug infos if t is NULL?
> something like "failed to  update retran path", or "no change to retran path".
> 
> Tested-by: Shan Wei <shanwei@cn.fujitsu.com>
> 

Sorry, I didn't run with debug enabled.... Actually, we should probably just
refer back to retran_path so that DEBUG output still shows which path we are
retransmitting on.

-vlad

  parent reply	other threads:[~2010-05-11 13:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-11  6:43 [PATCH for net-next-2.6] sctp: fix oops when update assoc retran Wei Yongjun
2010-05-11  9:55 ` Shan Wei
2010-05-11 13:23 ` Vlad Yasevich [this message]
2010-05-11 15:45 ` [PATCH for net-next-2.6] sctp: fix oops when update assoc retran path Vlad Yasevich

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=4BE95A6A.8060605@hp.com \
    --to=vladislav.yasevich@hp.com \
    --cc=linux-sctp@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 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.