浏览代码

sctp: Set socket source address when additing first transport

Recent commits
	sctp: Get rid of an extra routing lookup when adding a transport
and
	sctp: Set source addresses on the association before adding transports

changed when routes are added to the sctp transports.  As such,
we didn't set the socket source address correctly when adding the first
transport.  The first transport is always the primary/active one, so
when adding it, set the socket source address.  This was causing
regression failures in SCTP tests.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Vlad Yasevich 16 年之前
父节点
当前提交
a78102e74e
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      net/sctp/transport.c

+ 2 - 1
net/sctp/transport.c

@@ -308,7 +308,8 @@ void sctp_transport_route(struct sctp_transport *transport,
 		/* Initialize sk->sk_rcv_saddr, if the transport is the
 		/* Initialize sk->sk_rcv_saddr, if the transport is the
 		 * association's active path for getsockname().
 		 * association's active path for getsockname().
 		 */
 		 */
-		if (asoc && (transport == asoc->peer.active_path))
+		if (asoc && (!asoc->peer.primary_path ||
+				(transport == asoc->peer.active_path)))
 			opt->pf->af->to_sk_saddr(&transport->saddr,
 			opt->pf->af->to_sk_saddr(&transport->saddr,
 						 asoc->base.sk);
 						 asoc->base.sk);
 	} else
 	} else