aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp
diff options
context:
space:
mode:
authorJerome Forissier <jerome.forissier@hp.com>2005-04-28 11:58:43 -0700
committerDavid S. Miller <davem@davemloft.net>2005-04-28 11:58:43 -0700
commit047a2428a14216a83980ed26b6a59b3ca40a1fb0 (patch)
tree9b4b4abb85b045fbf95700c1a9ca6e6ed7dfd60b /include/net/sctp
parent173372162ddbd414cc471c1a3a52ad7ea279aaf4 (diff)
downloadkernel_samsung_smdk4412-047a2428a14216a83980ed26b6a59b3ca40a1fb0.zip
kernel_samsung_smdk4412-047a2428a14216a83980ed26b6a59b3ca40a1fb0.tar.gz
kernel_samsung_smdk4412-047a2428a14216a83980ed26b6a59b3ca40a1fb0.tar.bz2
[SCTP] Implement Sec 2.41 of SCTP Implementers guide.
- Fixed sctp_vtag_verify_either() to comply with impguide 2.41 B) and C). - Make sure vtag is reflected when T-bit is set in SHUTDOWN-COMPLETE sent due to an OOTB SHUTDOWN-ACK and in ABORT sent due to an OOTB packet. - Do not set T-Bit in ABORT chunk in response to INIT. - Fixed some comments to reflect the new meaning of the T-Bit. Signed-off-by: Jerome Forissier <jerome.forissier@hp.com> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp')
-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 5576db5..f4fcee1 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,
return 0;
}
-/* Check VTAG of the packet matches the sender's own tag OR its peer's
- * tag and the T bit is set in the Chunk Flags.
+/* Check VTAG of the packet matches the sender's own tag and the T bit is
+ * not set, OR its peer's tag and the T bit is set in the Chunk Flags.
*/
static inline int
sctp_vtag_verify_either(const struct sctp_chunk *chunk,
const struct sctp_association *asoc)
{
- /* RFC 2960 Section 8.5.1, sctpimpguide-06 Section 2.13.2
+ /* RFC 2960 Section 8.5.1, sctpimpguide Section 2.41
*
- * B) The receiver of a ABORT shall accept the packet if the
- * Verification Tag field of the packet matches its own tag OR it
- * is set to its peer's tag and the T bit is set in the Chunk
- * Flags. Otherwise, the receiver MUST silently discard the packet
- * and take no further action.
- *
- * (C) The receiver of a SHUTDOWN COMPLETE shall accept the
- * packet if the Verification Tag field of the packet
- * matches its own tag OR it is set to its peer's tag and
- * the T bit is set in the Chunk Flags. Otherwise, the
- * receiver MUST silently discard the packet and take no
- * further action....
+ * B) The receiver of a ABORT MUST accept the packet
+ * if the Verification Tag field of the packet matches its own tag
+ * and the T bit is not set
+ * OR
+ * it is set to its peer's tag and the T bit is set in the Chunk
+ * Flags.
+ * Otherwise, the receiver MUST silently discard the packet
+ * and take no further action.
*
+ * C) The receiver of a SHUTDOWN COMPLETE shall accept the packet
+ * if the Verification Tag field of the packet matches its own tag
+ * and the T bit is not set
+ * OR
+ * it is set to its peer's tag and the T bit is set in the Chunk
+ * Flags.
+ * Otherwise, the receiver MUST silently discard the packet
+ * and take no further action. An endpoint MUST ignore the
+ * SHUTDOWN COMPLETE if it is not in the SHUTDOWN-ACK-SENT state.
*/
- if ((ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag) ||
- (sctp_test_T_bit(chunk) && (ntohl(chunk->sctp_hdr->vtag)
- == asoc->c.peer_vtag))) {
+ if ((!sctp_test_T_bit(chunk) &&
+ (ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag)) ||
+ (sctp_test_T_bit(chunk) &&
+ (ntohl(chunk->sctp_hdr->vtag) == asoc->c.peer_vtag))) {
return 1;
}