From a9b47eea59cd6769ba396bc08725d0d9ffd54027 Mon Sep 17 00:00:00 2001 From: Vlad Yasevich Date: Mon, 30 Oct 2006 18:55:11 -0800 Subject: [PATCH] --- yaml --- r: 40541 b: refs/heads/master c: de76e695a5ce19c121ba7e246b45f258be678a75 h: refs/heads/master i: 40539: 7ecb1446d53d0ac54bc43557d48f7ea6d255ba2e v: v3 --- [refs] | 2 +- trunk/net/sctp/associola.c | 15 +++++++++++---- trunk/net/sctp/endpointola.c | 7 +++++++ trunk/net/sctp/input.c | 6 ++++++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 2c416b97c733..c63d606009f7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4f4443088b763ca4ac7521e9b4a881b52c294dec +refs/heads/master: de76e695a5ce19c121ba7e246b45f258be678a75 diff --git a/trunk/net/sctp/associola.c b/trunk/net/sctp/associola.c index 27329ce9c311..ed0445fe85e7 100644 --- a/trunk/net/sctp/associola.c +++ b/trunk/net/sctp/associola.c @@ -346,11 +346,18 @@ void sctp_association_free(struct sctp_association *asoc) struct list_head *pos, *temp; int i; - list_del(&asoc->asocs); + /* Only real associations count against the endpoint, so + * don't bother for if this is a temporary association. + */ + if (!asoc->temp) { + list_del(&asoc->asocs); - /* Decrement the backlog value for a TCP-style listening socket. */ - if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING)) - sk->sk_ack_backlog--; + /* Decrement the backlog value for a TCP-style listening + * socket. + */ + if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING)) + sk->sk_ack_backlog--; + } /* Mark as dead, so other users can know this structure is * going away. diff --git a/trunk/net/sctp/endpointola.c b/trunk/net/sctp/endpointola.c index 35c49ff2d062..9b6b394b66f6 100644 --- a/trunk/net/sctp/endpointola.c +++ b/trunk/net/sctp/endpointola.c @@ -144,6 +144,13 @@ void sctp_endpoint_add_asoc(struct sctp_endpoint *ep, { struct sock *sk = ep->base.sk; + /* If this is a temporary association, don't bother + * since we'll be removing it shortly and don't + * want anyone to find it anyway. + */ + if (asoc->temp) + return; + /* Now just add it to our list of asocs */ list_add_tail(&asoc->asocs, &ep->asocs); diff --git a/trunk/net/sctp/input.c b/trunk/net/sctp/input.c index 99c0501ca513..6d82f400d13c 100644 --- a/trunk/net/sctp/input.c +++ b/trunk/net/sctp/input.c @@ -771,6 +771,9 @@ static void __sctp_hash_established(struct sctp_association *asoc) /* Add an association to the hash. Local BH-safe. */ void sctp_hash_established(struct sctp_association *asoc) { + if (asoc->temp) + return; + sctp_local_bh_disable(); __sctp_hash_established(asoc); sctp_local_bh_enable(); @@ -804,6 +807,9 @@ static void __sctp_unhash_established(struct sctp_association *asoc) /* Remove association from the hash table. Local BH-safe. */ void sctp_unhash_established(struct sctp_association *asoc) { + if (asoc->temp) + return; + sctp_local_bh_disable(); __sctp_unhash_established(asoc); sctp_local_bh_enable();