Thread (3 messages) flat view 3 messages, 2 authors, 2014-04-25

Re: [PATCH] sctp: reset flowi4_oif parameter on route lookup

From: Xufeng Zhang <hidden>
Date: 2014-04-25 08:40:07
Also in: linux-sctp, lkml, stable

On 04/25/2014 03:57 PM, Julian Anastasov wrote:
	Hello,

On Fri, 25 Apr 2014, Xufeng Zhang wrote:

   
quoted
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

   
quoted
  			rt = ip_route_output_key(sock_net(sk), fl4);
  			if (!IS_ERR(rt)) {
  				dst =&rt->dst;
     
Regards

--
Julian Anastasov[off-list ref]

   
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help