aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/input.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-01-26 17:43:16 -0800
committerDavid S. Miller <davem@davemloft.net>2009-01-26 17:43:16 -0800
commit3eacdf58c2c0b9507afedfc19108e98b992c31e4 (patch)
treed95e7e022ff6e6181edce43fe97cf2883b5a91ed /net/sctp/input.c
parentdd0a251c8e087bca05e8f9a3657078591ae6e12b (diff)
parent5376071069ec8a7e6a8112beab16fc24f5139475 (diff)
downloadkernel_samsung_smdk4412-3eacdf58c2c0b9507afedfc19108e98b992c31e4.zip
kernel_samsung_smdk4412-3eacdf58c2c0b9507afedfc19108e98b992c31e4.tar.gz
kernel_samsung_smdk4412-3eacdf58c2c0b9507afedfc19108e98b992c31e4.tar.bz2
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'net/sctp/input.c')
-rw-r--r--net/sctp/input.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c
index bf612d9..2e4a864 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -249,6 +249,19 @@ int sctp_rcv(struct sk_buff *skb)
*/
sctp_bh_lock_sock(sk);
+ if (sk != rcvr->sk) {
+ /* Our cached sk is different from the rcvr->sk. This is
+ * because migrate()/accept() may have moved the association
+ * to a new socket and released all the sockets. So now we
+ * are holding a lock on the old socket while the user may
+ * be doing something with the new socket. Switch our veiw
+ * of the current sk.
+ */
+ sctp_bh_unlock_sock(sk);
+ sk = rcvr->sk;
+ sctp_bh_lock_sock(sk);
+ }
+
if (sock_owned_by_user(sk)) {
SCTP_INC_STATS_BH(SCTP_MIB_IN_PKT_BACKLOG);
sctp_add_backlog(sk, skb);