Merge to Fedora kernel-2.6.17-1.2187_FC5 patched with stable patch-2.6.17.13-vs2...
[linux-2.6.git] / include / net / sctp / sm.h
index 5576db5..de313de 100644 (file)
@@ -116,7 +116,8 @@ sctp_state_fn_t sctp_sf_eat_data_fast_4_4;
 sctp_state_fn_t sctp_sf_eat_sack_6_2;
 sctp_state_fn_t sctp_sf_tabort_8_4_8;
 sctp_state_fn_t sctp_sf_operr_notify;
-sctp_state_fn_t sctp_sf_t1_timer_expire;
+sctp_state_fn_t sctp_sf_t1_init_timer_expire;
+sctp_state_fn_t sctp_sf_t1_cookie_timer_expire;
 sctp_state_fn_t sctp_sf_t2_timer_expire;
 sctp_state_fn_t sctp_sf_t4_timer_expire;
 sctp_state_fn_t sctp_sf_t5_timer_expire;
@@ -130,7 +131,6 @@ sctp_state_fn_t sctp_sf_do_ecne;
 sctp_state_fn_t sctp_sf_ootb;
 sctp_state_fn_t sctp_sf_pdiscard;
 sctp_state_fn_t sctp_sf_violation;
-sctp_state_fn_t sctp_sf_violation_chunklen;
 sctp_state_fn_t sctp_sf_discard_chunk;
 sctp_state_fn_t sctp_sf_do_5_2_1_siminit;
 sctp_state_fn_t sctp_sf_do_5_2_2_dupinit;
@@ -181,17 +181,17 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t,
 int sctp_chunk_iif(const struct sctp_chunk *);
 struct sctp_association *sctp_make_temp_asoc(const struct sctp_endpoint *,
                                             struct sctp_chunk *,
-                                            int gfp);
+                                            gfp_t gfp);
 __u32 sctp_generate_verification_tag(void);
 void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag);
 
 /* Prototypes for chunk-building functions.  */
 struct sctp_chunk *sctp_make_init(const struct sctp_association *,
                             const struct sctp_bind_addr *,
-                            int gfp, int vparam_len);
+                            gfp_t gfp, int vparam_len);
 struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *,
                                 const struct sctp_chunk *,
-                                const int gfp,
+                                const gfp_t gfp,
                                 const int unkparam_len);
 struct sctp_chunk *sctp_make_cookie_echo(const struct sctp_association *,
                                    const struct sctp_chunk *);
@@ -221,8 +221,7 @@ struct sctp_chunk *sctp_make_abort_no_data(const struct sctp_association *,
                                      const struct sctp_chunk *,
                                      __u32 tsn);
 struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *,
-                                  const struct sctp_chunk *,
-                                  const struct msghdr *);
+                                       const struct msghdr *, size_t msg_len);
 struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *,
                                   const struct sctp_chunk *,
                                   const __u8 *,
@@ -258,8 +257,6 @@ struct sctp_chunk *sctp_make_fwdtsn(const struct sctp_association *asoc,
 void sctp_chunk_assign_tsn(struct sctp_chunk *);
 void sctp_chunk_assign_ssn(struct sctp_chunk *);
 
-void sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, __u16 error);
-
 /* Prototypes for statetable processing. */
 
 int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype,
@@ -267,7 +264,7 @@ int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype,
                struct sctp_endpoint *,
                struct sctp_association *asoc,
                void *event_arg,
-               int gfp);
+              gfp_t gfp);
 
 /* 2nd level prototypes */
 void sctp_generate_t3_rtx_event(unsigned long peer);
@@ -277,7 +274,8 @@ void sctp_ootb_pkt_free(struct sctp_packet *);
 
 struct sctp_association *sctp_unpack_cookie(const struct sctp_endpoint *,
                                       const struct sctp_association *,
-                                      struct sctp_chunk *, int gfp, int *err,
+                                      struct sctp_chunk *,
+                                      gfp_t gfp, int *err,
                                       struct sctp_chunk **err_chk_p);
 int sctp_addip_addr_config(struct sctp_association *, sctp_param_t,
                           struct sockaddr_storage*, int);
@@ -407,32 +405,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
-        *
-        * 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.
+        /* RFC 2960 Section 8.5.1, sctpimpguide Section 2.41
         *
-        * (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;
        }