Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73591
b: refs/heads/master
c: 123ed97
h: refs/heads/master
i:
  73589: ad2dde6
  73587: 15333da
  73583: 06415b9
v: v3
  • Loading branch information
Vlad Yasevich committed Nov 9, 2007
1 parent 2453618 commit d16b1e8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 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: 027f6e1ad32de32f9fe1c61d0f744e329e8acfd9
refs/heads/master: 123ed979eaa8de0dd2422862d247469eda0bd645
34 changes: 22 additions & 12 deletions trunk/net/sctp/endpointola.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,24 +328,34 @@ static struct sctp_association *__sctp_endpoint_lookup_assoc(
const union sctp_addr *paddr,
struct sctp_transport **transport)
{
struct sctp_association *asoc = NULL;
struct sctp_transport *t = NULL;
struct sctp_hashbucket *head;
struct sctp_ep_common *epb;
int hash;
int rport;
struct sctp_association *asoc;
struct list_head *pos;

*transport = NULL;
rport = ntohs(paddr->v4.sin_port);

list_for_each(pos, &ep->asocs) {
asoc = list_entry(pos, struct sctp_association, asocs);
if (rport == asoc->peer.port) {
*transport = sctp_assoc_lookup_paddr(asoc, paddr);

if (*transport)
return asoc;
hash = sctp_assoc_hashfn(ep->base.bind_addr.port, rport);
head = &sctp_assoc_hashtable[hash];
read_lock(&head->lock);
for (epb = head->chain; epb; epb = epb->next) {
asoc = sctp_assoc(epb);
if (asoc->ep != ep || rport != asoc->peer.port)
goto next;

t = sctp_assoc_lookup_paddr(asoc, paddr);
if (t) {
*transport = t;
break;
}
next:
asoc = NULL;
}

*transport = NULL;
return NULL;
read_unlock(&head->lock);
return asoc;
}

/* Lookup association on an endpoint based on a peer address. BH-safe. */
Expand Down

0 comments on commit d16b1e8

Please sign in to comment.