All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xufeng Zhang <xufeng.zhang@windriver.com>
To: Julian Anastasov <ja@ssi.bg>
Cc: vyasevich@gmail.com, nhorman@tuxdriver.com, davem@davemloft.net,
	linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] sctp: reset flowi4_oif parameter on route lookup
Date: Fri, 25 Apr 2014 08:49:20 +0000	[thread overview]
Message-ID: <535A2190.6020801@windriver.com> (raw)
In-Reply-To: <alpine.LFD.2.11.1404251050490.1969@ja.home.ssi.bg>

On 04/25/2014 03:57 PM, Julian Anastasov wrote:
> 	Hello,
>
> On Fri, 25 Apr 2014, Xufeng Zhang wrote:
>
>    
>>
>> diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
>> index c09757f..f8a5968 100644
>> --- a/net/sctp/protocol.c
>> +++ b/net/sctp/protocol.c
>> @@ -493,6 +493,10 @@ static void sctp_v4_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
>>   		    (AF_INET = laddr->a.sa.sa_family)) {
>>   			fl4->saddr = laddr->a.v4.sin_addr.s_addr;
>>   			fl4->fl4_sport = laddr->a.v4.sin_port;
>> +			/* Reset flowi4_oif so that it won't be incorrectly used
>> +			 * as input parameter to routing lookups.
>> +			 */
>> +			fl4->flowi4_oif = 0;
>>      
> 	May be something like this is more correct:
>
> 			flowi4_update_output(fl4,
> 					     asoc->base.sk->sk_bound_dev_if,
> 					     RT_CONN_FLAGS(asoc->base.sk),
> 					     daddr->v4.sin_addr.s_addr,
> 					     laddr->a.v4.sin_addr.s_addr);
>    

Thanks! you are right, I should use the available API.
I'll send V2 later.


Thanks,
Xufeng


>    
>>   			rt = ip_route_output_key(sock_net(sk), fl4);
>>   			if (!IS_ERR(rt)) {
>>   				dst =&rt->dst;
>>      
> Regards
>
> --
> Julian Anastasov<ja@ssi.bg>
>
>    


WARNING: multiple messages have this Message-ID (diff)
From: Xufeng Zhang <xufeng.zhang@windriver.com>
To: Julian Anastasov <ja@ssi.bg>
Cc: <vyasevich@gmail.com>, <nhorman@tuxdriver.com>,
	<davem@davemloft.net>, <linux-sctp@vger.kernel.org>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<stable@vger.kernel.org>
Subject: Re: [PATCH] sctp: reset flowi4_oif parameter on route lookup
Date: Fri, 25 Apr 2014 16:49:20 +0800	[thread overview]
Message-ID: <535A2190.6020801@windriver.com> (raw)
In-Reply-To: <alpine.LFD.2.11.1404251050490.1969@ja.home.ssi.bg>

On 04/25/2014 03:57 PM, Julian Anastasov wrote:
> 	Hello,
>
> On Fri, 25 Apr 2014, Xufeng Zhang wrote:
>
>    
>>
>> diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
>> index c09757f..f8a5968 100644
>> --- a/net/sctp/protocol.c
>> +++ b/net/sctp/protocol.c
>> @@ -493,6 +493,10 @@ static void sctp_v4_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
>>   		    (AF_INET == laddr->a.sa.sa_family)) {
>>   			fl4->saddr = laddr->a.v4.sin_addr.s_addr;
>>   			fl4->fl4_sport = laddr->a.v4.sin_port;
>> +			/* Reset flowi4_oif so that it won't be incorrectly used
>> +			 * as input parameter to routing lookups.
>> +			 */
>> +			fl4->flowi4_oif = 0;
>>      
> 	May be something like this is more correct:
>
> 			flowi4_update_output(fl4,
> 					     asoc->base.sk->sk_bound_dev_if,
> 					     RT_CONN_FLAGS(asoc->base.sk),
> 					     daddr->v4.sin_addr.s_addr,
> 					     laddr->a.v4.sin_addr.s_addr);
>    

Thanks! you are right, I should use the available API.
I'll send V2 later.


Thanks,
Xufeng


>    
>>   			rt = ip_route_output_key(sock_net(sk), fl4);
>>   			if (!IS_ERR(rt)) {
>>   				dst =&rt->dst;
>>      
> Regards
>
> --
> Julian Anastasov<ja@ssi.bg>
>
>    


  reply	other threads:[~2014-04-25  8:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-25  7:29 [PATCH] sctp: reset flowi4_oif parameter on route lookup Xufeng Zhang
2014-04-25  7:29 ` Xufeng Zhang
2014-04-25  7:57 ` Julian Anastasov
2014-04-25  7:57   ` Julian Anastasov
2014-04-25  8:49   ` Xufeng Zhang [this message]
2014-04-25  8:49     ` Xufeng Zhang

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=535A2190.6020801@windriver.com \
    --to=xufeng.zhang@windriver.com \
    --cc=davem@davemloft.net \
    --cc=ja@ssi.bg \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=stable@vger.kernel.org \
    --cc=vyasevich@gmail.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.