X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fsctp%2Fassociola.c;h=16b718fa5172ec5d1cbf2fceae0abe6c8b8b265c;hb=6f71f83334a552167ccbbd42fe5dd979428c89e4;hp=498a71367cebbc09a0ed46ff66c143cb3fc95130;hpb=8d40237c730b8be87c1b80a5d96b9c603fefa829;p=linux-2.6.git diff --git a/net/sctp/associola.c b/net/sctp/associola.c index 498a71367..16b718fa5 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c @@ -125,7 +125,7 @@ struct sctp_association *sctp_association_init(struct sctp_association *asoc, /* Initialize the bind addr area. */ sctp_bind_addr_init(&asoc->base.bind_addr, ep->base.bind_addr.port); - rwlock_init(&asoc->base.addr_lock); + asoc->base.addr_lock = RW_LOCK_UNLOCKED; asoc->state = SCTP_STATE_CLOSED; @@ -271,7 +271,7 @@ struct sctp_association *sctp_association_init(struct sctp_association *asoc, asoc->need_ecne = 0; - asoc->assoc_id = 0; + asoc->assoc_id = (sctp_assoc_t)-1L; /* Assume that peer would support both address types unless we are * told otherwise. @@ -374,9 +374,9 @@ static void sctp_association_destroy(struct sctp_association *asoc) sctp_endpoint_put(asoc->ep); sock_put(asoc->base.sk); - if (asoc->assoc_id != 0) { + if ((long)asoc->assoc_id != -1L) { spin_lock_bh(&sctp_assocs_id_lock); - idr_remove(&sctp_assocs_id, asoc->assoc_id); + idr_remove(&sctp_assocs_id, (long)asoc->assoc_id); spin_unlock_bh(&sctp_assocs_id_lock); } @@ -482,15 +482,14 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, /* 7.2.1 Slow-Start * - * o The initial cwnd before DATA transmission or after a sufficiently - * long idle period MUST be set to - * min(4*MTU, max(2*MTU, 4380 bytes)) + * o The initial cwnd before data transmission or after a + * sufficiently long idle period MUST be <= 2*MTU. * * o The initial value of ssthresh MAY be arbitrarily high * (for example, implementations MAY use the size of the * receiver advertised window). */ - peer->cwnd = min(4*asoc->pmtu, max_t(__u32, 2*asoc->pmtu, 4380)); + peer->cwnd = asoc->pmtu * 2; /* At this point, we may not have the receiver's advertised window, * so initialize ssthresh to the default value and it will be set