~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to net/sctp/endpointola.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
325
325
        struct sctp_transport **transport)
326
326
{
327
327
        struct sctp_association *asoc = NULL;
 
328
        struct sctp_association *tmp;
328
329
        struct sctp_transport *t = NULL;
329
330
        struct sctp_hashbucket *head;
330
331
        struct sctp_ep_common *epb;
333
334
        int rport;
334
335
 
335
336
        *transport = NULL;
 
337
 
 
338
        /* If the local port is not set, there can't be any associations
 
339
         * on this endpoint.
 
340
         */
 
341
        if (!ep->base.bind_addr.port)
 
342
                goto out;
 
343
 
336
344
        rport = ntohs(paddr->v4.sin_port);
337
345
 
338
346
        hash = sctp_assoc_hashfn(ep->base.bind_addr.port, rport);
339
347
        head = &sctp_assoc_hashtable[hash];
340
348
        read_lock(&head->lock);
341
349
        sctp_for_each_hentry(epb, node, &head->chain) {
342
 
                asoc = sctp_assoc(epb);
343
 
                if (asoc->ep != ep || rport != asoc->peer.port)
344
 
                        goto next;
 
350
                tmp = sctp_assoc(epb);
 
351
                if (tmp->ep != ep || rport != tmp->peer.port)
 
352
                        continue;
345
353
 
346
 
                t = sctp_assoc_lookup_paddr(asoc, paddr);
 
354
                t = sctp_assoc_lookup_paddr(tmp, paddr);
347
355
                if (t) {
 
356
                        asoc = tmp;
348
357
                        *transport = t;
349
358
                        break;
350
359
                }
351
 
next:
352
 
                asoc = NULL;
353
360
        }
354
361
        read_unlock(&head->lock);
 
362
out:
355
363
        return asoc;
356
364
}
357
365