aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/outqueue.c2
-rw-r--r--net/sctp/sm_make_chunk.c4
-rw-r--r--net/sctp/sm_statefuns.c9
3 files changed, 8 insertions, 7 deletions
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index c9148484b2ff..fba567a7cb64 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -1065,7 +1065,7 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_sackhdr *sack)
1065 * A) Initialize the cacc_saw_newack to 0 for all destination 1065 * A) Initialize the cacc_saw_newack to 0 for all destination
1066 * addresses. 1066 * addresses.
1067 */ 1067 */
1068 if (sack->num_gap_ack_blocks > 0 && 1068 if (sack->num_gap_ack_blocks &&
1069 primary->cacc.changeover_active) { 1069 primary->cacc.changeover_active) {
1070 list_for_each(pos, transport_list) { 1070 list_for_each(pos, transport_list) {
1071 transport = list_entry(pos, struct sctp_transport, 1071 transport = list_entry(pos, struct sctp_transport,
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 51cab806abd8..988745272458 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1472,10 +1472,10 @@ no_hmac:
1472 suseconds_t usecs = (tv.tv_sec - 1472 suseconds_t usecs = (tv.tv_sec -
1473 bear_cookie->expiration.tv_sec) * 1000000L + 1473 bear_cookie->expiration.tv_sec) * 1000000L +
1474 tv.tv_usec - bear_cookie->expiration.tv_usec; 1474 tv.tv_usec - bear_cookie->expiration.tv_usec;
1475 __be32 n = htonl(usecs);
1475 1476
1476 usecs = htonl(usecs);
1477 sctp_init_cause(*errp, SCTP_ERROR_STALE_COOKIE, 1477 sctp_init_cause(*errp, SCTP_ERROR_STALE_COOKIE,
1478 &usecs, sizeof(usecs)); 1478 &n, sizeof(n));
1479 *error = -SCTP_IERROR_STALE_COOKIE; 1479 *error = -SCTP_IERROR_STALE_COOKIE;
1480 } else 1480 } else
1481 *error = -SCTP_IERROR_NOMEM; 1481 *error = -SCTP_IERROR_NOMEM;
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index c136d991da6d..27cc444aaf11 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -2158,7 +2158,7 @@ static sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep,
2158 * to give ample time to retransmit the new cookie and thus 2158 * to give ample time to retransmit the new cookie and thus
2159 * yield a higher probability of success on the reattempt. 2159 * yield a higher probability of success on the reattempt.
2160 */ 2160 */
2161 stale = ntohl(*(suseconds_t *)((u8 *)err + sizeof(sctp_errhdr_t))); 2161 stale = ntohl(*(__be32 *)((u8 *)err + sizeof(sctp_errhdr_t)));
2162 stale = (stale * 2) / 1000; 2162 stale = (stale * 2) / 1000;
2163 2163
2164 bht.param_hdr.type = SCTP_PARAM_COOKIE_PRESERVATIVE; 2164 bht.param_hdr.type = SCTP_PARAM_COOKIE_PRESERVATIVE;
@@ -2545,6 +2545,7 @@ sctp_disposition_t sctp_sf_do_ecn_cwr(const struct sctp_endpoint *ep,
2545{ 2545{
2546 sctp_cwrhdr_t *cwr; 2546 sctp_cwrhdr_t *cwr;
2547 struct sctp_chunk *chunk = arg; 2547 struct sctp_chunk *chunk = arg;
2548 u32 lowest_tsn;
2548 2549
2549 if (!sctp_vtag_verify(chunk, asoc)) 2550 if (!sctp_vtag_verify(chunk, asoc))
2550 return sctp_sf_pdiscard(ep, asoc, type, arg, commands); 2551 return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
@@ -2556,14 +2557,14 @@ sctp_disposition_t sctp_sf_do_ecn_cwr(const struct sctp_endpoint *ep,
2556 cwr = (sctp_cwrhdr_t *) chunk->skb->data; 2557 cwr = (sctp_cwrhdr_t *) chunk->skb->data;
2557 skb_pull(chunk->skb, sizeof(sctp_cwrhdr_t)); 2558 skb_pull(chunk->skb, sizeof(sctp_cwrhdr_t));
2558 2559
2559 cwr->lowest_tsn = ntohl(cwr->lowest_tsn); 2560 lowest_tsn = ntohl(cwr->lowest_tsn);
2560 2561
2561 /* Does this CWR ack the last sent congestion notification? */ 2562 /* Does this CWR ack the last sent congestion notification? */
2562 if (TSN_lte(asoc->last_ecne_tsn, cwr->lowest_tsn)) { 2563 if (TSN_lte(asoc->last_ecne_tsn, lowest_tsn)) {
2563 /* Stop sending ECNE. */ 2564 /* Stop sending ECNE. */
2564 sctp_add_cmd_sf(commands, 2565 sctp_add_cmd_sf(commands,
2565 SCTP_CMD_ECN_CWR, 2566 SCTP_CMD_ECN_CWR,
2566 SCTP_U32(cwr->lowest_tsn)); 2567 SCTP_U32(lowest_tsn));
2567 } 2568 }
2568 return SCTP_DISPOSITION_CONSUME; 2569 return SCTP_DISPOSITION_CONSUME;
2569} 2570}