projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
[powerpc.git]
/
net
/
sctp
/
transport.c
diff --git
a/net/sctp/transport.c
b/net/sctp/transport.c
index
68d73e2
..
a596f53
100644
(file)
--- a/
net/sctp/transport.c
+++ b/
net/sctp/transport.c
@@
-49,6
+49,7
@@
*/
#include <linux/types.h>
*/
#include <linux/types.h>
+#include <linux/random.h>
#include <net/sctp/sctp.h>
#include <net/sctp/sm.h>
#include <net/sctp/sctp.h>
#include <net/sctp/sm.h>
@@
-74,7
+75,7
@@
static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
* parameter 'RTO.Initial'.
*/
peer->rtt = 0;
* parameter 'RTO.Initial'.
*/
peer->rtt = 0;
- peer->rto =
sctp_rto_initial
;
+ peer->rto =
msecs_to_jiffies(sctp_rto_initial)
;
peer->rttvar = 0;
peer->srtt = 0;
peer->rto_pending = 0;
peer->rttvar = 0;
peer->srtt = 0;
peer->rto_pending = 0;
@@
-85,7
+86,6
@@
static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
peer->init_sent_count = 0;
peer->init_sent_count = 0;
- peer->state = SCTP_ACTIVE;
peer->param_flags = SPP_HB_DISABLE |
SPP_PMTUD_ENABLE |
SPP_SACKDELAY_ENABLE;
peer->param_flags = SPP_HB_DISABLE |
SPP_PMTUD_ENABLE |
SPP_SACKDELAY_ENABLE;
@@
-109,6
+109,9
@@
static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
peer->hb_timer.function = sctp_generate_heartbeat_event;
peer->hb_timer.data = (unsigned long)peer;
peer->hb_timer.function = sctp_generate_heartbeat_event;
peer->hb_timer.data = (unsigned long)peer;
+ /* Initialize the 64-bit random nonce sent with heartbeat. */
+ get_random_bytes(&peer->hb_nonce, sizeof(peer->hb_nonce));
+
atomic_set(&peer->refcnt, 1);
peer->dead = 0;
atomic_set(&peer->refcnt, 1);
peer->dead = 0;
@@
-127,9
+130,9
@@
static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
struct sctp_transport *sctp_transport_new(const union sctp_addr *addr,
gfp_t gfp)
{
struct sctp_transport *sctp_transport_new(const union sctp_addr *addr,
gfp_t gfp)
{
-
struct sctp_transport *transport;
+ struct sctp_transport *transport;
-
transport = t_new(struct sctp_transport, gfp);
+ transport = t_new(struct sctp_transport, gfp);
if (!transport)
goto fail;
if (!transport)
goto fail;
@@
-182,7
+185,7
@@
static void sctp_transport_destroy(struct sctp_transport *transport)
if (transport->asoc)
sctp_association_put(transport->asoc);
if (transport->asoc)
sctp_association_put(transport->asoc);
-
sctp_packet_free(&transport->packet);
+ sctp_packet_free(&transport->packet);
dst_release(transport->dst);
kfree(transport);
dst_release(transport->dst);
kfree(transport);
@@
-265,7
+268,7
@@
void sctp_transport_route(struct sctp_transport *transport,
/* Initialize sk->sk_rcv_saddr, if the transport is the
* association's active path for getsockname().
/* Initialize sk->sk_rcv_saddr, if the transport is the
* association's active path for getsockname().
- */
+ */
if (asoc && (transport == asoc->peer.active_path))
opt->pf->af->to_sk_saddr(&transport->saddr,
asoc->base.sk);
if (asoc && (transport == asoc->peer.active_path))
opt->pf->af->to_sk_saddr(&transport->saddr,
asoc->base.sk);
@@
-350,7
+353,7
@@
void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt)
tp->rto_pending = 0;
SCTP_DEBUG_PRINTK("%s: transport: %p, rtt: %d, srtt: %d "
tp->rto_pending = 0;
SCTP_DEBUG_PRINTK("%s: transport: %p, rtt: %d, srtt: %d "
- "rttvar: %d, rto: %d\n", __FUNCTION__,
+ "rttvar: %d, rto: %
l
d\n", __FUNCTION__,
tp, rtt, tp->srtt, tp->rttvar, tp->rto);
}
tp, rtt, tp->srtt, tp->rttvar, tp->rto);
}
@@
-456,8
+459,8
@@
void sctp_transport_lower_cwnd(struct sctp_transport *transport,
* destination address(es) to which the missing DATA chunks
* were last sent, according to the formula described in
* Section 7.2.3.
* destination address(es) to which the missing DATA chunks
* were last sent, according to the formula described in
* Section 7.2.3.
- *
- * RFC 2960 7.2.3, sctpimpguide Upon detection of packet
+ *
+ * RFC 2960 7.2.3, sctpimpguide Upon detection of packet
* losses from SACK (see Section 7.2.4), An endpoint
* should do the following:
* ssthresh = max(cwnd/2, 4*MTU)
* losses from SACK (see Section 7.2.4), An endpoint
* should do the following:
* ssthresh = max(cwnd/2, 4*MTU)
@@
-485,7
+488,7
@@
void sctp_transport_lower_cwnd(struct sctp_transport *transport,
if ((jiffies - transport->last_time_ecne_reduced) >
transport->rtt) {
transport->ssthresh = max(transport->cwnd/2,
if ((jiffies - transport->last_time_ecne_reduced) >
transport->rtt) {
transport->ssthresh = max(transport->cwnd/2,
- 4*transport->asoc->pathmtu);
+ 4*transport->asoc->pathmtu);
transport->cwnd = transport->ssthresh;
transport->last_time_ecne_reduced = jiffies;
}
transport->cwnd = transport->ssthresh;
transport->last_time_ecne_reduced = jiffies;
}
@@
-517,7
+520,9
@@
void sctp_transport_lower_cwnd(struct sctp_transport *transport,
unsigned long sctp_transport_timeout(struct sctp_transport *t)
{
unsigned long timeout;
unsigned long sctp_transport_timeout(struct sctp_transport *t)
{
unsigned long timeout;
- timeout = t->hbinterval + t->rto + sctp_jitter(t->rto);
+ timeout = t->rto + sctp_jitter(t->rto);
+ if (t->state != SCTP_UNCONFIRMED)
+ timeout += t->hbinterval;
timeout += jiffies;
return timeout;
}
timeout += jiffies;
return timeout;
}