netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: sctp: fix copying sk_v6_rcv_saddr in sctp_v6_create_accept_sk
@ 2013-11-19 10:51 Daniel Borkmann
  2013-11-19 11:08 ` wangweidong
  2013-11-19 15:38 ` Vlad Yasevich
  0 siblings, 2 replies; 7+ messages in thread
From: Daniel Borkmann @ 2013-11-19 10:51 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-sctp, Wang Weidong, Eric Dumazet

Wang reported an issue that lksctp's test_getname_v6 seems to fail.

The issue is that we do not copy sk_v6_rcv_saddr over to the new
socket, although the comment above says so regarding rcv_saddr.

Commit 914e1c8b6980 ("sctp: Inherit all socket options from parent
correctly.") originally moved that over to sctp_copy_sock(), but
after commit efe4208f47f9 ("ipv6: make lookups simpler and faster")
this no longer holds and the actual value of sk_v6_rcv_saddr was
no longer being migrated.

With this patch, the lksctp test suite passes again for IPv6.

Fixes: efe4208f47f9 ("ipv6: make lookups simpler and faster")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
---
 net/sctp/ipv6.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 7567e6f..be08592 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -661,6 +661,7 @@ static struct sock *sctp_v6_create_accept_sk(struct sock *sk,
 	 * and getpeername().
 	 */
 	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);
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-11-21  9:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-19 10:51 [PATCH net] net: sctp: fix copying sk_v6_rcv_saddr in sctp_v6_create_accept_sk Daniel Borkmann
2013-11-19 11:08 ` wangweidong
2013-11-19 15:38 ` Vlad Yasevich
2013-11-19 15:46   ` Daniel Borkmann
2013-11-19 21:10   ` David Miller
2013-11-21  6:49   ` wangweidong
2013-11-21  9:08     ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).