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

« back to all changes in this revision

Viewing changes to net/sctp/associola.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:
64
64
/* Forward declarations for internal functions. */
65
65
static void sctp_assoc_bh_rcv(struct work_struct *work);
66
66
static void sctp_assoc_free_asconf_acks(struct sctp_association *asoc);
 
67
static void sctp_assoc_free_asconf_queue(struct sctp_association *asoc);
67
68
 
68
69
/* Keep track of the new idr low so that we don't re-use association id
69
70
 * numbers too fast.  It is protected by they idr spin lock is in the
443
444
 
444
445
        asoc->peer.transport_count = 0;
445
446
 
446
 
        /* Free any cached ASCONF_ACK chunk. */
447
 
        sctp_assoc_free_asconf_acks(asoc);
448
 
 
449
 
        /* Free any cached ASCONF chunk. */
450
 
        if (asoc->addip_last_asconf)
451
 
                sctp_chunk_free(asoc->addip_last_asconf);
 
447
        sctp_asconf_queue_teardown(asoc);
452
448
 
453
449
        /* AUTH - Free the endpoint shared keys */
454
450
        sctp_auth_destroy_keys(&asoc->endpoint_shared_keys);
569
565
                sctp_assoc_set_primary(asoc, transport);
570
566
        if (asoc->peer.active_path == peer)
571
567
                asoc->peer.active_path = transport;
 
568
        if (asoc->peer.retran_path == peer)
 
569
                asoc->peer.retran_path = transport;
572
570
        if (asoc->peer.last_data_from == peer)
573
571
                asoc->peer.last_data_from = transport;
574
572
 
1089
1087
                             base.inqueue.immediate);
1090
1088
        struct sctp_endpoint *ep;
1091
1089
        struct sctp_chunk *chunk;
1092
 
        struct sock *sk;
1093
1090
        struct sctp_inq *inqueue;
1094
1091
        int state;
1095
1092
        sctp_subtype_t subtype;
1097
1094
 
1098
1095
        /* The association should be held so we should be safe. */
1099
1096
        ep = asoc->ep;
1100
 
        sk = asoc->base.sk;
1101
1097
 
1102
1098
        inqueue = &asoc->base.inqueue;
1103
1099
        sctp_association_hold(asoc);
1325
1321
 
1326
1322
        if (t)
1327
1323
                asoc->peer.retran_path = t;
 
1324
        else
 
1325
                t = asoc->peer.retran_path;
1328
1326
 
1329
1327
        SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_update_retran_path:association"
1330
1328
                                 " %p addr: ",
1576
1574
        return error;
1577
1575
}
1578
1576
 
 
1577
/* Free the ASCONF queue */
 
1578
static void sctp_assoc_free_asconf_queue(struct sctp_association *asoc)
 
1579
{
 
1580
        struct sctp_chunk *asconf;
 
1581
        struct sctp_chunk *tmp;
 
1582
 
 
1583
        list_for_each_entry_safe(asconf, tmp, &asoc->addip_chunk_list, list) {
 
1584
                list_del_init(&asconf->list);
 
1585
                sctp_chunk_free(asconf);
 
1586
        }
 
1587
}
 
1588
 
1579
1589
/* Free asconf_ack cache */
1580
1590
static void sctp_assoc_free_asconf_acks(struct sctp_association *asoc)
1581
1591
{
1595
1605
        struct sctp_chunk *ack;
1596
1606
        struct sctp_chunk *tmp;
1597
1607
 
1598
 
        /* We can remove all the entries from the queue upto
 
1608
        /* We can remove all the entries from the queue up to
1599
1609
         * the "Peer-Sequence-Number".
1600
1610
         */
1601
1611
        list_for_each_entry_safe(ack, tmp, &asoc->asconf_ack_list,
1628
1638
 
1629
1639
        return NULL;
1630
1640
}
 
1641
 
 
1642
void sctp_asconf_queue_teardown(struct sctp_association *asoc)
 
1643
{
 
1644
        /* Free any cached ASCONF_ACK chunk. */
 
1645
        sctp_assoc_free_asconf_acks(asoc);
 
1646
 
 
1647
        /* Free the ASCONF queue. */
 
1648
        sctp_assoc_free_asconf_queue(asoc);
 
1649
 
 
1650
        /* Free any cached ASCONF chunk. */
 
1651
        if (asoc->addip_last_asconf)
 
1652
                sctp_chunk_free(asoc->addip_last_asconf);
 
1653
}