summaryrefslogtreecommitdiffstats
path: root/net/sctp/inqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/inqueue.c')
-rw-r--r--net/sctp/inqueue.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/sctp/inqueue.c b/net/sctp/inqueue.c
index f731de3e8428..48392552ee7c 100644
--- a/net/sctp/inqueue.c
+++ b/net/sctp/inqueue.c
@@ -99,7 +99,7 @@ void sctp_inq_push(struct sctp_inq *q, struct sctp_chunk *chunk)
99struct sctp_chunkhdr *sctp_inq_peek(struct sctp_inq *queue) 99struct sctp_chunkhdr *sctp_inq_peek(struct sctp_inq *queue)
100{ 100{
101 struct sctp_chunk *chunk; 101 struct sctp_chunk *chunk;
102 sctp_chunkhdr_t *ch = NULL; 102 struct sctp_chunkhdr *ch = NULL;
103 103
104 chunk = queue->in_progress; 104 chunk = queue->in_progress;
105 /* If there is no more chunks in this packet, say so */ 105 /* If there is no more chunks in this packet, say so */
@@ -108,7 +108,7 @@ struct sctp_chunkhdr *sctp_inq_peek(struct sctp_inq *queue)
108 chunk->pdiscard) 108 chunk->pdiscard)
109 return NULL; 109 return NULL;
110 110
111 ch = (sctp_chunkhdr_t *)chunk->chunk_end; 111 ch = (struct sctp_chunkhdr *)chunk->chunk_end;
112 112
113 return ch; 113 return ch;
114} 114}
@@ -122,7 +122,7 @@ struct sctp_chunkhdr *sctp_inq_peek(struct sctp_inq *queue)
122struct sctp_chunk *sctp_inq_pop(struct sctp_inq *queue) 122struct sctp_chunk *sctp_inq_pop(struct sctp_inq *queue)
123{ 123{
124 struct sctp_chunk *chunk; 124 struct sctp_chunk *chunk;
125 sctp_chunkhdr_t *ch = NULL; 125 struct sctp_chunkhdr *ch = NULL;
126 126
127 /* The assumption is that we are safe to process the chunks 127 /* The assumption is that we are safe to process the chunks
128 * at this time. 128 * at this time.
@@ -151,7 +151,7 @@ struct sctp_chunk *sctp_inq_pop(struct sctp_inq *queue)
151 chunk = queue->in_progress = NULL; 151 chunk = queue->in_progress = NULL;
152 } else { 152 } else {
153 /* Nothing to do. Next chunk in the packet, please. */ 153 /* Nothing to do. Next chunk in the packet, please. */
154 ch = (sctp_chunkhdr_t *) chunk->chunk_end; 154 ch = (struct sctp_chunkhdr *)chunk->chunk_end;
155 /* Force chunk->skb->data to chunk->chunk_end. */ 155 /* Force chunk->skb->data to chunk->chunk_end. */
156 skb_pull(chunk->skb, chunk->chunk_end - chunk->skb->data); 156 skb_pull(chunk->skb, chunk->chunk_end - chunk->skb->data);
157 /* We are guaranteed to pull a SCTP header. */ 157 /* We are guaranteed to pull a SCTP header. */
@@ -195,7 +195,7 @@ next_chunk:
195 195
196new_skb: 196new_skb:
197 /* This is the first chunk in the packet. */ 197 /* This is the first chunk in the packet. */
198 ch = (sctp_chunkhdr_t *) chunk->skb->data; 198 ch = (struct sctp_chunkhdr *)chunk->skb->data;
199 chunk->singleton = 1; 199 chunk->singleton = 1;
200 chunk->data_accepted = 0; 200 chunk->data_accepted = 0;
201 chunk->pdiscard = 0; 201 chunk->pdiscard = 0;
@@ -214,11 +214,10 @@ new_skb:
214 214
215 chunk->chunk_hdr = ch; 215 chunk->chunk_hdr = ch;
216 chunk->chunk_end = ((__u8 *)ch) + SCTP_PAD4(ntohs(ch->length)); 216 chunk->chunk_end = ((__u8 *)ch) + SCTP_PAD4(ntohs(ch->length));
217 skb_pull(chunk->skb, sizeof(sctp_chunkhdr_t)); 217 skb_pull(chunk->skb, sizeof(*ch));
218 chunk->subh.v = NULL; /* Subheader is no longer valid. */ 218 chunk->subh.v = NULL; /* Subheader is no longer valid. */
219 219
220 if (chunk->chunk_end + sizeof(sctp_chunkhdr_t) < 220 if (chunk->chunk_end + sizeof(*ch) < skb_tail_pointer(chunk->skb)) {
221 skb_tail_pointer(chunk->skb)) {
222 /* This is not a singleton */ 221 /* This is not a singleton */
223 chunk->singleton = 0; 222 chunk->singleton = 0;
224 } else if (chunk->chunk_end > skb_tail_pointer(chunk->skb)) { 223 } else if (chunk->chunk_end > skb_tail_pointer(chunk->skb)) {