aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp/sm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sctp/sm.h')
-rw-r--r--include/net/sctp/sm.h42
1 files changed, 24 insertions, 18 deletions
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 5576db56324d..f4fcee104707 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -407,32 +407,38 @@ sctp_vtag_verify(const struct sctp_chunk *chunk,
407 return 0; 407 return 0;
408} 408}
409 409
410/* Check VTAG of the packet matches the sender's own tag OR its peer's 410/* Check VTAG of the packet matches the sender's own tag and the T bit is
411 * tag and the T bit is set in the Chunk Flags. 411 * not set, OR its peer's tag and the T bit is set in the Chunk Flags.
412 */ 412 */
413static inline int 413static inline int
414sctp_vtag_verify_either(const struct sctp_chunk *chunk, 414sctp_vtag_verify_either(const struct sctp_chunk *chunk,
415 const struct sctp_association *asoc) 415 const struct sctp_association *asoc)
416{ 416{
417 /* RFC 2960 Section 8.5.1, sctpimpguide-06 Section 2.13.2 417 /* RFC 2960 Section 8.5.1, sctpimpguide Section 2.41
418 * 418 *
419 * B) The receiver of a ABORT shall accept the packet if the 419 * B) The receiver of a ABORT MUST accept the packet
420 * Verification Tag field of the packet matches its own tag OR it 420 * if the Verification Tag field of the packet matches its own tag
421 * is set to its peer's tag and the T bit is set in the Chunk 421 * and the T bit is not set
422 * Flags. Otherwise, the receiver MUST silently discard the packet 422 * OR
423 * and take no further action. 423 * it is set to its peer's tag and the T bit is set in the Chunk
424 * 424 * Flags.
425 * (C) The receiver of a SHUTDOWN COMPLETE shall accept the 425 * Otherwise, the receiver MUST silently discard the packet
426 * packet if the Verification Tag field of the packet 426 * and take no further action.
427 * matches its own tag OR it is set to its peer's tag and
428 * the T bit is set in the Chunk Flags. Otherwise, the
429 * receiver MUST silently discard the packet and take no
430 * further action....
431 * 427 *
428 * C) The receiver of a SHUTDOWN COMPLETE shall accept the packet
429 * if the Verification Tag field of the packet matches its own tag
430 * and the T bit is not set
431 * OR
432 * it is set to its peer's tag and the T bit is set in the Chunk
433 * Flags.
434 * Otherwise, the receiver MUST silently discard the packet
435 * and take no further action. An endpoint MUST ignore the
436 * SHUTDOWN COMPLETE if it is not in the SHUTDOWN-ACK-SENT state.
432 */ 437 */
433 if ((ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag) || 438 if ((!sctp_test_T_bit(chunk) &&
434 (sctp_test_T_bit(chunk) && (ntohl(chunk->sctp_hdr->vtag) 439 (ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag)) ||
435 == asoc->c.peer_vtag))) { 440 (sctp_test_T_bit(chunk) &&
441 (ntohl(chunk->sctp_hdr->vtag) == asoc->c.peer_vtag))) {
436 return 1; 442 return 1;
437 } 443 }
438 444