Skip to content

Commit

Permalink
net: sctp: fix initialization of local source address on accepted ipv…
Browse files Browse the repository at this point in the history
…6 sockets

commit 	efe4208:
'ipv6: make lookups simpler and faster' broke initialization of local source
address on accepted ipv6 sockets. Before the mentioned commit receive address
was copied along with the contents of ipv6_pinfo in sctp_v6_create_accept_sk.
Now when it is moved, it has to be copied separately.

This also fixes lksctp's ipv6 regression in a sense that test_getname_v6, TC5 -
'getsockname on a connected server socket' now passes.

Signed-off-by: Matija Glavinic Pecotic <matija.glavinic-pecotic.ext@nsn.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Matija Glavinic Pecotic authored and David S. Miller committed Feb 7, 2014
1 parent 3d55f44 commit 661dbf3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sctp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,8 @@ static struct sock *sctp_v6_create_accept_sk(struct sock *sk,
*/
sctp_v6_to_sk_daddr(&asoc->peer.primary_addr, newsk);

newsk->sk_v6_rcv_saddr = sk->sk_v6_rcv_saddr;

sk_refcnt_debug_inc(newsk);

if (newsk->sk_prot->init(newsk)) {
Expand Down

0 comments on commit 661dbf3

Please sign in to comment.