summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Grimm <jgrimm@touki.austin.ibm.com>2003-06-18 23:02:34 -0500
committerJon Grimm <jgrimm@touki.austin.ibm.com>2003-06-18 23:02:34 -0500
commitbb520e8476db601fa9b8def155b1daa0fa1adaa6 (patch)
tree3e5c794ecae565023c1c5da0b11d030530e79fed
parentcb2badbda539a8e3653ad80466a36eb0f790849e (diff)
[SCTP] Minor warning cleanups.
-rw-r--r--include/net/sctp/structs.h4
-rw-r--r--net/sctp/associola.c4
-rw-r--r--net/sctp/outqueue.c2
-rw-r--r--net/sctp/sm_make_chunk.c8
-rw-r--r--net/sctp/sm_statefuns.c16
5 files changed, 18 insertions, 16 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 01b8d2b6b636..49d9366cb039 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1706,8 +1706,8 @@ __u32 sctp_association_get_next_tsn(struct sctp_association *);
__u32 sctp_association_get_tsn_block(struct sctp_association *, int);
void sctp_assoc_sync_pmtu(struct sctp_association *);
-void sctp_assoc_rwnd_increase(struct sctp_association *, int);
-void sctp_assoc_rwnd_decrease(struct sctp_association *, int);
+void sctp_assoc_rwnd_increase(struct sctp_association *, unsigned);
+void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned);
void sctp_assoc_set_primary(struct sctp_association *,
struct sctp_transport *);
int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, int);
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 23e5fa7dfb74..1e3ff03199f8 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -1061,7 +1061,7 @@ static inline int sctp_peer_needs_update(struct sctp_association *asoc)
}
/* Increase asoc's rwnd by len and send any window update SACK if needed. */
-void sctp_assoc_rwnd_increase(struct sctp_association *asoc, int len)
+void sctp_assoc_rwnd_increase(struct sctp_association *asoc, unsigned len)
{
struct sctp_chunk *sack;
struct timer_list *timer;
@@ -1107,7 +1107,7 @@ void sctp_assoc_rwnd_increase(struct sctp_association *asoc, int len)
}
/* Decrease asoc's rwnd by len. */
-void sctp_assoc_rwnd_decrease(struct sctp_association *asoc, int len)
+void sctp_assoc_rwnd_decrease(struct sctp_association *asoc, unsigned len)
{
SCTP_ASSERT(asoc->rwnd, "rwnd zero", return);
SCTP_ASSERT(!asoc->rwnd_over, "rwnd_over not zero", return);
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index 1bf3a7509eaa..b7bd2bf6e6a2 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -1012,7 +1012,7 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_sackhdr *sack)
__u32 sack_ctsn, ctsn, tsn;
__u32 highest_tsn, highest_new_tsn;
__u32 sack_a_rwnd;
- int outstanding;
+ unsigned outstanding;
struct sctp_transport *primary = asoc->peer.primary_path;
int count_of_newacks = 0;
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index bdc1fc117e83..a844df109be5 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1356,7 +1356,7 @@ struct sctp_association *sctp_unpack_cookie(
int headersize, bodysize, fixed_size;
__u8 digest[SCTP_SIGNATURE_SIZE];
struct scatterlist sg;
- unsigned int keylen;
+ unsigned int keylen, len;
char *key;
sctp_scope_t scope;
struct sk_buff *skb = chunk->skb;
@@ -1369,8 +1369,8 @@ struct sctp_association *sctp_unpack_cookie(
* There must be enough room for our cookie and our peer's
* INIT chunk.
*/
- if (ntohs(chunk->chunk_hdr->length) <
- (fixed_size + sizeof(sctp_chunkhdr_t)))
+ len = ntohs(chunk->chunk_hdr->length);
+ if (len < fixed_size + sizeof(struct sctp_chunkhdr))
goto malformed;
/* Verify that the cookie has been padded out. */
@@ -1454,7 +1454,7 @@ no_hmac:
retval->peer.port = ntohs(chunk->sctp_hdr->source);
/* Populate the association from the cookie. */
- retval->c = *bear_cookie;
+ memcpy(&retval->c, bear_cookie, sizeof(*bear_cookie));
if (sctp_assoc_set_bind_addr_from_cookie(retval, bear_cookie,
GFP_ATOMIC) < 0) {
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index eb1050886920..a63c26ef4a8c 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1948,22 +1948,23 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *chunk = arg;
+ unsigned len;
__u16 error = SCTP_ERROR_NO_ERROR;
if (!sctp_vtag_verify_either(chunk, asoc))
return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
- if (chunk && (ntohs(chunk->chunk_hdr->length) >=
- (sizeof(struct sctp_chunkhdr) +
- sizeof(struct sctp_errhdr))))
+ /* Check that chunk header looks valid. */
+ len = ntohs(chunk->chunk_hdr->length);
+ if (len >= sizeof(struct sctp_chunkhdr) + sizeof(struct sctp_errhdr))
error = ((sctp_errhdr_t *)chunk->skb->data)->cause;
+
/* ASSOC_FAILED will DELETE_TCB. */
sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, SCTP_U32(error));
SCTP_INC_STATS(SctpAborteds);
SCTP_DEC_STATS(SctpCurrEstab);
- /* BUG? This does not look complete... */
return SCTP_DISPOSITION_ABORT;
}
@@ -1979,6 +1980,7 @@ sctp_disposition_t sctp_sf_cookie_wait_abort(const struct sctp_endpoint *ep,
sctp_cmd_seq_t *commands)
{
struct sctp_chunk *chunk = arg;
+ unsigned len;
__u16 error = SCTP_ERROR_NO_ERROR;
if (!sctp_vtag_verify_either(chunk, asoc))
@@ -1990,9 +1992,9 @@ sctp_disposition_t sctp_sf_cookie_wait_abort(const struct sctp_endpoint *ep,
sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT));
- if (chunk && (ntohs(chunk->chunk_hdr->length) >=
- (sizeof(struct sctp_chunkhdr) +
- sizeof(struct sctp_errhdr))))
+ /* Check that chunk header looks valid. */
+ len = ntohs(chunk->chunk_hdr->length);
+ if (len >= sizeof(struct sctp_chunkhdr) + sizeof(struct sctp_errhdr))
error = ((sctp_errhdr_t *)chunk->skb->data)->cause;
/* CMD_INIT_FAILED will DELETE_TCB. */