inqueue.c (5a84d159061d914c8dd4aa372ac6e9529c2be453) | inqueue.c (27a884dc3cb63b93c2b3b643f5b31eed5f8a4d26) |
---|---|
1/* SCTP kernel reference Implementation 2 * Copyright (c) 1999-2000 Cisco, Inc. 3 * Copyright (c) 1999-2001 Motorola, Inc. 4 * Copyright (c) 2002 International Business Machines, Corp. 5 * 6 * This file is part of the SCTP kernel reference Implementation 7 * 8 * These functions are the methods for accessing the SCTP inqueue. --- 145 unchanged lines hidden (view full) --- 154 155 chunk->chunk_hdr = ch; 156 chunk->chunk_end = ((__u8 *)ch) + WORD_ROUND(ntohs(ch->length)); 157 /* In the unlikely case of an IP reassembly, the skb could be 158 * non-linear. If so, update chunk_end so that it doesn't go past 159 * the skb->tail. 160 */ 161 if (unlikely(skb_is_nonlinear(chunk->skb))) { | 1/* SCTP kernel reference Implementation 2 * Copyright (c) 1999-2000 Cisco, Inc. 3 * Copyright (c) 1999-2001 Motorola, Inc. 4 * Copyright (c) 2002 International Business Machines, Corp. 5 * 6 * This file is part of the SCTP kernel reference Implementation 7 * 8 * These functions are the methods for accessing the SCTP inqueue. --- 145 unchanged lines hidden (view full) --- 154 155 chunk->chunk_hdr = ch; 156 chunk->chunk_end = ((__u8 *)ch) + WORD_ROUND(ntohs(ch->length)); 157 /* In the unlikely case of an IP reassembly, the skb could be 158 * non-linear. If so, update chunk_end so that it doesn't go past 159 * the skb->tail. 160 */ 161 if (unlikely(skb_is_nonlinear(chunk->skb))) { |
162 if (chunk->chunk_end > chunk->skb->tail) 163 chunk->chunk_end = chunk->skb->tail; | 162 if (chunk->chunk_end > skb_tail_pointer(chunk->skb)) 163 chunk->chunk_end = skb_tail_pointer(chunk->skb); |
164 } 165 skb_pull(chunk->skb, sizeof(sctp_chunkhdr_t)); 166 chunk->subh.v = NULL; /* Subheader is no longer valid. */ 167 | 164 } 165 skb_pull(chunk->skb, sizeof(sctp_chunkhdr_t)); 166 chunk->subh.v = NULL; /* Subheader is no longer valid. */ 167 |
168 if (chunk->chunk_end < chunk->skb->tail) { | 168 if (chunk->chunk_end < skb_tail_pointer(chunk->skb)) { |
169 /* This is not a singleton */ 170 chunk->singleton = 0; | 169 /* This is not a singleton */ 170 chunk->singleton = 0; |
171 } else if (chunk->chunk_end > chunk->skb->tail) { | 171 } else if (chunk->chunk_end > skb_tail_pointer(chunk->skb)) { |
172 /* RFC 2960, Section 6.10 Bundling 173 * 174 * Partial chunks MUST NOT be placed in an SCTP packet. 175 * If the receiver detects a partial chunk, it MUST drop 176 * the chunk. 177 * 178 * Since the end of the chunk is past the end of our buffer 179 * (which contains the whole packet, we can freely discard --- 33 unchanged lines hidden --- | 172 /* RFC 2960, Section 6.10 Bundling 173 * 174 * Partial chunks MUST NOT be placed in an SCTP packet. 175 * If the receiver detects a partial chunk, it MUST drop 176 * the chunk. 177 * 178 * Since the end of the chunk is past the end of our buffer 179 * (which contains the whole packet, we can freely discard --- 33 unchanged lines hidden --- |