Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312024
b: refs/heads/master
c: 2eebc1e
h: refs/heads/master
v: v3
  • Loading branch information
Neil Horman authored and David S. Miller committed Jul 17, 2012
1 parent 6e2ae87 commit 5d2ce5b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 310e158cc3b7a6adf41e778d52be746c4dc88561
refs/heads/master: 2eebc1e188e9e45886ee00662519849339884d6d
7 changes: 2 additions & 5 deletions trunk/net/sctp/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,15 +736,12 @@ static void __sctp_unhash_endpoint(struct sctp_endpoint *ep)

epb = &ep->base;

if (hlist_unhashed(&epb->node))
return;

epb->hashent = sctp_ep_hashfn(epb->bind_addr.port);

head = &sctp_ep_hashtable[epb->hashent];

sctp_write_lock(&head->lock);
__hlist_del(&epb->node);
hlist_del_init(&epb->node);
sctp_write_unlock(&head->lock);
}

Expand Down Expand Up @@ -825,7 +822,7 @@ static void __sctp_unhash_established(struct sctp_association *asoc)
head = &sctp_assoc_hashtable[epb->hashent];

sctp_write_lock(&head->lock);
__hlist_del(&epb->node);
hlist_del_init(&epb->node);
sctp_write_unlock(&head->lock);
}

Expand Down
12 changes: 10 additions & 2 deletions trunk/net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1231,8 +1231,14 @@ static int __sctp_connect(struct sock* sk,
SCTP_DEBUG_PRINTK("About to exit __sctp_connect() free asoc: %p"
" kaddrs: %p err: %d\n",
asoc, kaddrs, err);
if (asoc)
if (asoc) {
/* sctp_primitive_ASSOCIATE may have added this association
* To the hash table, try to unhash it, just in case, its a noop
* if it wasn't hashed so we're safe
*/
sctp_unhash_established(asoc);
sctp_association_free(asoc);
}
return err;
}

Expand Down Expand Up @@ -1942,8 +1948,10 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
goto out_unlock;

out_free:
if (new_asoc)
if (new_asoc) {
sctp_unhash_established(asoc);
sctp_association_free(asoc);
}
out_unlock:
sctp_release_sock(sk);

Expand Down

0 comments on commit 5d2ce5b

Please sign in to comment.