Lines Matching refs:asoc
53 const struct sctp_association *asoc,
56 static int sctp_eat_data(const struct sctp_association *asoc,
61 const struct sctp_association *asoc,
65 const struct sctp_association *asoc,
72 const struct sctp_association *asoc,
79 const struct sctp_association *asoc,
86 const struct sctp_association *asoc,
96 const struct sctp_association *asoc,
102 const struct sctp_association *asoc,
111 const struct sctp_association *asoc,
119 const struct sctp_association *asoc,
127 const struct sctp_association *asoc,
135 const struct sctp_association *asoc,
141 const struct sctp_association *asoc,
147 const struct sctp_association *asoc,
154 const struct sctp_association *asoc,
217 * (endpoint, asoc, chunk)
220 * (asoc, reply_msg, msg_up, timers, counters)
226 const struct sctp_association *asoc,
233 if (!sctp_vtag_verify_either(chunk, asoc))
234 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
242 return sctp_sf_violation_chunk(net, ep, asoc, type, arg, commands);
246 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
256 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_SHUTDOWN_COMP,
302 * (endpoint, asoc, chunk)
305 * (asoc, reply_msg, msg_up, timers, counters)
311 const struct sctp_association *asoc,
325 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
337 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
345 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
352 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
359 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
368 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
372 if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
379 packet = sctp_abort_pkt_new(net, ep, asoc, arg,
396 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg,
501 * (endpoint, asoc, chunk)
504 * (asoc, reply_msg, msg_up, timers, counters)
510 const struct sctp_association *asoc,
520 if (!sctp_vtag_verify(chunk, asoc))
521 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
528 return sctp_sf_violation_chunk(net, ep, asoc, type, arg, commands);
532 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
539 if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
551 packet = sctp_abort_pkt_new(net, ep, asoc, arg,
578 if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc))
579 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
583 asoc, chunk->transport);
628 const struct sctp_association *asoc)
643 if (!net->sctp.auth_enable || !asoc->peer.auth_capable)
648 auth.asoc = chunk->asoc;
656 return sctp_sf_authenticate(asoc, &auth) == SCTP_IERROR_NO_ERROR;
683 * (endpoint, asoc, chunk)
686 * (asoc, reply_msg, msg_up, timers, counters)
692 const struct sctp_association *asoc,
706 if (asoc && !sctp_vtag_verify(chunk, asoc))
707 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
714 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
723 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
733 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
748 new_asoc = sctp_unpack_cookie(ep, asoc, chunk, GFP_ATOMIC, &error,
766 sctp_send_stale_cookie_err(net, ep, asoc, chunk, commands,
768 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
772 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
802 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
901 * (endpoint, asoc, chunk)
904 * (asoc, reply_msg, msg_up, timers, counters)
910 const struct sctp_association *asoc,
918 if (!sctp_vtag_verify(chunk, asoc))
919 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
925 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
952 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE])
960 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_COMM_UP,
961 0, asoc->c.sinit_num_ostreams,
962 asoc->c.sinit_max_instreams,
975 if (asoc->peer.adaptation_ind) {
976 ev = sctp_ulpevent_make_adaptation_indication(asoc, GFP_ATOMIC);
984 if (!asoc->peer.auth_capable) {
985 ev = sctp_ulpevent_make_authkey(asoc, 0, SCTP_AUTH_NO_AUTH,
1001 const struct sctp_association *asoc,
1010 reply = sctp_make_heartbeat(asoc, transport);
1027 const struct sctp_association *asoc,
1034 if (asoc->overall_error_count >= asoc->max_retrans) {
1054 sctp_sf_heartbeat(ep, asoc, type, arg,
1072 /* resend asoc strreset_chunk. */
1075 const struct sctp_association *asoc,
1082 if (asoc->overall_error_count >= asoc->max_retrans) {
1093 sctp_chunk_hold(asoc->strreset_chunk);
1095 SCTP_CHUNK(asoc->strreset_chunk));
1118 * (endpoint, asoc, chunk)
1121 * (asoc, reply_msg, msg_up, timers, counters)
1127 const struct sctp_association *asoc,
1136 if (!sctp_vtag_verify(chunk, asoc))
1137 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1142 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
1154 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
1160 reply = sctp_make_heartbeat_ack(asoc, chunk, param_hdr, paylen);
1192 * (endpoint, asoc, chunk)
1195 * (asoc, reply_msg, msg_up, timers, counters)
1201 const struct sctp_association *asoc,
1212 if (!sctp_vtag_verify(chunk, asoc))
1213 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1218 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
1227 link = sctp_assoc_lookup_paddr(asoc, &from_addr);
1234 asoc,
1239 asoc,
1339 const struct sctp_association *asoc,
1360 if (!list_has_sctp_addr(&asoc->peer.transport_addr_list,
1379 const struct sctp_association *asoc)
1381 switch (asoc->state) {
1386 new_asoc->c.my_vtag = asoc->c.my_vtag;
1387 new_asoc->c.my_ttag = asoc->c.my_vtag;
1392 new_asoc->c.my_vtag = asoc->c.my_vtag;
1393 new_asoc->c.my_ttag = asoc->c.my_vtag;
1394 new_asoc->c.peer_ttag = asoc->c.peer_vtag;
1401 new_asoc->c.my_ttag = asoc->c.my_vtag;
1402 new_asoc->c.peer_ttag = asoc->c.peer_vtag;
1410 new_asoc->rwnd = asoc->rwnd;
1411 new_asoc->c.sinit_num_ostreams = asoc->c.sinit_num_ostreams;
1412 new_asoc->c.sinit_max_instreams = asoc->c.sinit_max_instreams;
1413 new_asoc->c.initial_tsn = asoc->c.initial_tsn;
1426 const struct sctp_association *asoc)
1429 if ((asoc->c.my_vtag != new_asoc->c.my_vtag) &&
1430 (asoc->c.peer_vtag != new_asoc->c.peer_vtag) &&
1431 (asoc->c.my_vtag == new_asoc->c.my_ttag) &&
1432 (asoc->c.peer_vtag == new_asoc->c.peer_ttag))
1436 if ((asoc->c.my_vtag == new_asoc->c.my_vtag) &&
1437 ((asoc->c.peer_vtag != new_asoc->c.peer_vtag) ||
1438 (0 == asoc->c.peer_vtag))) {
1443 if ((asoc->c.my_vtag == new_asoc->c.my_vtag) &&
1444 (asoc->c.peer_vtag == new_asoc->c.peer_vtag))
1448 if ((asoc->c.my_vtag != new_asoc->c.my_vtag) &&
1449 (asoc->c.peer_vtag == new_asoc->c.peer_vtag) &&
1464 const struct sctp_association *asoc,
1479 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1491 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1495 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1501 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
1511 if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
1518 packet = sctp_abort_pkt_new(net, ep, asoc, arg,
1534 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg,
1568 if (!sctp_state(asoc, COOKIE_WAIT)) {
1569 if (!sctp_sf_check_restart_addrs(new_asoc, asoc, chunk,
1576 sctp_tietags_populate(new_asoc, asoc);
1669 * (endpoint, asoc, chunk)
1672 * (asoc, reply_msg, msg_up, timers, counters)
1679 const struct sctp_association *asoc,
1687 return sctp_sf_do_unexpected_init(net, ep, asoc, type, arg, commands);
1724 * (endpoint, asoc, chunk)
1727 * (asoc, reply_msg, msg_up, timers, counters)
1734 const struct sctp_association *asoc,
1742 return sctp_sf_do_unexpected_init(net, ep, asoc, type, arg, commands);
1758 const struct sctp_association *asoc,
1767 return sctp_sf_ootb(net, ep, asoc, type, arg, commands);
1769 return sctp_sf_discard_chunk(net, ep, asoc, type, arg, commands);
1780 const struct sctp_association *asoc,
1810 if (!sctp_sf_check_restart_addrs(new_asoc, asoc, chunk, commands))
1819 if (sctp_state(asoc, SHUTDOWN_ACK_SENT)) {
1820 disposition = __sctp_sf_do_9_2_reshutack(net, ep, asoc,
1826 err = sctp_make_op_error(asoc, chunk,
1852 if (sctp_assoc_update((struct sctp_association *)asoc, new_asoc)) {
1855 abort = sctp_make_abort(asoc, NULL, sizeof(struct sctp_errhdr));
1868 repl = sctp_make_cookie_ack(asoc, chunk);
1873 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_RESTART, 0,
1874 asoc->c.sinit_num_ostreams,
1875 asoc->c.sinit_max_instreams,
1881 if ((sctp_state(asoc, SHUTDOWN_PENDING) ||
1882 sctp_state(asoc, SHUTDOWN_SENT)) &&
1883 (sctp_sstate(asoc->base.sk, CLOSING) ||
1884 sock_flag(asoc->base.sk, SOCK_DEAD))) {
1890 return sctp_sf_do_9_2_start_shutdown(net, ep, asoc,
1917 const struct sctp_association *asoc,
1943 if (asoc->state < SCTP_STATE_ESTABLISHED)
1975 if (asoc->peer.adaptation_ind)
1978 if (!asoc->peer.auth_capable)
1999 const struct sctp_association *asoc,
2022 const struct sctp_association *asoc,
2037 if (!sctp_auth_chunk_verify(net, chunk, asoc))
2041 if (asoc->state < SCTP_STATE_ESTABLISHED) {
2057 ev = sctp_ulpevent_make_assoc_change(asoc, 0,
2059 asoc->c.sinit_num_ostreams,
2060 asoc->c.sinit_max_instreams,
2070 if (asoc->peer.adaptation_ind) {
2071 ai_ev = sctp_ulpevent_make_adaptation_indication(asoc,
2078 if (!asoc->peer.auth_capable) {
2079 auth_ev = sctp_ulpevent_make_authkey(asoc, 0,
2087 repl = sctp_make_cookie_ack(asoc, chunk);
2124 * (endpoint, asoc, chunk)
2127 * (asoc, reply_msg, msg_up, timers, counters)
2134 const struct sctp_association *asoc,
2152 if (!sctp_vtag_verify(chunk, asoc))
2153 asoc = NULL;
2154 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, commands);
2170 new_asoc = sctp_unpack_cookie(ep, asoc, chunk, GFP_ATOMIC, &error,
2188 sctp_send_stale_cookie_err(net, ep, asoc, chunk, commands,
2190 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2193 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2201 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2210 action = sctp_tietags_compare(new_asoc, asoc);
2214 retval = sctp_sf_do_dupcook_a(net, ep, asoc, chunk, commands,
2219 retval = sctp_sf_do_dupcook_b(net, ep, asoc, chunk, commands,
2224 retval = sctp_sf_do_dupcook_c(net, ep, asoc, chunk, commands,
2229 retval = sctp_sf_do_dupcook_d(net, ep, asoc, chunk, commands,
2234 retval = sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2246 SCTP_ASOC((struct sctp_association *)asoc));
2262 const struct sctp_association *asoc,
2269 if (!sctp_vtag_verify_either(chunk, asoc))
2270 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2283 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2291 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest))
2292 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2295 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2297 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands);
2308 const struct sctp_association *asoc,
2315 if (!sctp_vtag_verify_either(chunk, asoc))
2316 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2329 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2337 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest))
2338 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2341 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2351 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands);
2362 const struct sctp_association *asoc,
2370 return sctp_sf_shutdown_sent_abort(net, ep, asoc, type, arg, commands);
2380 * (endpoint, asoc, chunk)
2383 * (asoc, reply_msg, msg_up, timers, counters)
2390 const struct sctp_association *asoc,
2398 if (!sctp_vtag_verify(chunk, asoc))
2399 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2405 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
2415 return sctp_sf_do_5_2_6_stale(net, ep, asoc, type,
2424 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2445 * (endpoint, asoc, chunk)
2448 * (asoc, reply_msg, msg_up, timers, counters)
2455 const struct sctp_association *asoc,
2460 int attempts = asoc->init_err_counter + 1;
2467 if (attempts > asoc->max_init_attempts) {
2499 bp = (struct sctp_bind_addr *) &asoc->base.bind_addr;
2500 reply = sctp_make_init(asoc, bp, GFP_ATOMIC, sizeof(bht));
2522 SCTP_TRANSPORT(asoc->peer.primary_path));
2568 * (endpoint, asoc, chunk)
2571 * (asoc, reply_msg, msg_up, timers, counters)
2578 const struct sctp_association *asoc,
2585 if (!sctp_vtag_verify_either(chunk, asoc))
2586 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2599 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2607 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest))
2608 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2611 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2613 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands);
2619 const struct sctp_association *asoc,
2650 const struct sctp_association *asoc,
2659 if (!sctp_vtag_verify_either(chunk, asoc))
2660 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2673 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2680 return sctp_stop_t1_and_abort(net, commands, error, ECONNREFUSED, asoc,
2690 const struct sctp_association *asoc,
2696 ENOPROTOOPT, asoc,
2706 const struct sctp_association *asoc,
2714 return sctp_sf_cookie_wait_abort(net, ep, asoc, type, arg, commands);
2726 const struct sctp_association *asoc,
2770 * (endpoint, asoc, chunk)
2773 * (asoc, reply_msg, msg_up, timers, counters)
2780 const struct sctp_association *asoc,
2791 if (!sctp_vtag_verify(chunk, asoc))
2792 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2796 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
2805 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) {
2807 asoc->ctsn_ack_point);
2816 if (!TSN_lt(ctsn, asoc->next_tsn))
2817 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands);
2823 ev = sctp_ulpevent_make_shutdown_event(asoc, 0, GFP_ATOMIC);
2840 if (sctp_outq_is_empty(&asoc->outqueue)) {
2841 disposition = sctp_sf_do_9_2_shutdown_ack(net, ep, asoc, type,
2870 const struct sctp_association *asoc,
2879 if (!sctp_vtag_verify(chunk, asoc))
2880 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2884 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
2890 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) {
2892 asoc->ctsn_ack_point);
2901 if (!TSN_lt(ctsn, asoc->next_tsn))
2902 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands);
2923 const struct sctp_association *asoc,
2932 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
2939 reply = sctp_make_shutdown_ack(asoc, chunk);
2961 const struct sctp_association *asoc,
2968 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2971 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2974 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
2976 return __sctp_sf_do_9_2_reshutack(net, ep, asoc, type, arg, commands);
2997 * (endpoint, asoc, chunk)
3000 * (asoc, reply_msg, msg_up, timers, counters)
3006 const struct sctp_association *asoc,
3015 if (!sctp_vtag_verify(chunk, asoc))
3016 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3019 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3028 if (TSN_lte(asoc->last_ecne_tsn, lowest_tsn)) {
3053 * (endpoint, asoc, chunk)
3056 * (asoc, reply_msg, msg_up, timers, counters)
3062 const struct sctp_association *asoc,
3069 if (!sctp_vtag_verify(chunk, asoc))
3070 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3073 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3109 * (endpoint, asoc, chunk)
3112 * (asoc, reply_msg, msg_up, timers, counters)
3118 const struct sctp_association *asoc,
3127 if (!sctp_vtag_verify(chunk, asoc)) {
3130 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3133 if (!sctp_chunk_length_valid(chunk, sctp_datachk_len(&asoc->stream)))
3134 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3137 error = sctp_eat_data(asoc, chunk, commands);
3152 return sctp_sf_abort_violation(net, ep, asoc, chunk, commands,
3154 sctp_datahdr_len(&asoc->stream));
3162 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) {
3229 * (endpoint, asoc, chunk)
3232 * (asoc, reply_msg, msg_up, timers, counters)
3239 const struct sctp_association *asoc,
3247 if (!sctp_vtag_verify(chunk, asoc)) {
3250 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3253 if (!sctp_chunk_length_valid(chunk, sctp_datachk_len(&asoc->stream)))
3254 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3257 error = sctp_eat_data(asoc, chunk, commands);
3268 return sctp_sf_abort_violation(net, ep, asoc, chunk, commands,
3270 sctp_datahdr_len(&asoc->stream));
3321 * (endpoint, asoc, chunk)
3324 * (asoc, reply_msg, msg_up, timers, counters)
3330 const struct sctp_association *asoc,
3339 if (!sctp_vtag_verify(chunk, asoc))
3340 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3344 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3351 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3359 if (TSN_lte(asoc->next_tsn, ctsn))
3360 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands);
3362 trace_sctp_probe(ep, asoc, chunk);
3370 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) {
3372 asoc->ctsn_ack_point);
3407 const struct sctp_association *asoc,
3416 packet = sctp_ootb_pkt_new(net, asoc, chunk);
3420 /* Make an ABORT. The T bit will be set if the asoc
3423 abort = sctp_make_abort(asoc, chunk, 0);
3443 sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3457 const struct sctp_association *asoc,
3465 if (!sctp_vtag_verify(chunk, asoc))
3466 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3470 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3474 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
3495 const struct sctp_association *asoc,
3504 if (!sctp_vtag_verify(chunk, asoc))
3505 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3509 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3516 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_SHUTDOWN_COMP,
3522 reply = sctp_make_shutdown_complete(asoc, chunk);
3578 const struct sctp_association *asoc,
3592 if (asoc && !sctp_vtag_verify(chunk, asoc))
3593 asoc = NULL;
3599 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3605 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3620 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3643 return sctp_sf_shut_8_4_5(net, ep, asoc, type, arg, commands);
3645 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3647 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
3664 * (endpoint, asoc, type, arg, commands)
3674 const struct sctp_association *asoc,
3683 packet = sctp_ootb_pkt_new(net, asoc, chunk);
3688 * The T bit will be set if the asoc is NULL.
3690 shut = sctp_make_shutdown_complete(asoc, chunk);
3714 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3730 const struct sctp_association *asoc,
3737 if (!sctp_vtag_verify(chunk, asoc))
3738 asoc = NULL;
3742 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3758 const struct sctp_association *asoc,
3769 if (!sctp_vtag_verify(chunk, asoc)) {
3772 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3777 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3786 if (!asoc->peer.asconf_capable ||
3788 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3794 if (!sctp_verify_asconf(asoc, chunk, true, &err_param))
3795 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
3802 if (serial == asoc->peer.addip_serial + 1) {
3807 sctp_assoc_clean_asconf_ack_cache(asoc);
3818 asoc, chunk);
3821 } else if (serial < asoc->peer.addip_serial + 1) {
3834 asconf_ack = sctp_assoc_lookup_asconf_ack(asoc, hdr->serial);
3861 if (asoc->new_transport) {
3862 sctp_sf_heartbeat(ep, asoc, type, asoc->new_transport, commands);
3863 ((struct sctp_association *)asoc)->new_transport = NULL;
3872 struct sctp_association *asoc,
3879 if (list_empty(&asoc->addip_chunk_list))
3882 entry = asoc->addip_chunk_list.next;
3887 asoc->addip_last_asconf = asconf;
3889 return sctp_sf_do_prm_asconf(net, ep, asoc, type, asconf, commands);
3899 const struct sctp_association *asoc,
3904 struct sctp_chunk *last_asconf = asoc->addip_last_asconf;
3911 if (!sctp_vtag_verify(asconf_ack, asoc)) {
3914 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3920 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3929 if (!asoc->peer.asconf_capable ||
3931 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3937 if (!sctp_verify_asconf(asoc, asconf_ack, false, &err_param))
3938 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
3945 sent_serial = asoc->addip_serial - 1;
3955 !(asoc->addip_last_asconf)) {
3956 abort = sctp_make_abort(asoc, asconf_ack,
3978 if ((rcvd_serial == sent_serial) && asoc->addip_last_asconf) {
3982 if (!sctp_process_asconf_ack((struct sctp_association *)asoc,
3985 (struct sctp_association *)asoc,
3988 abort = sctp_make_abort(asoc, asconf_ack,
4014 const struct sctp_association *asoc,
4024 if (!sctp_vtag_verify(chunk, asoc)) {
4027 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4032 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4035 if (!sctp_verify_reconf(asoc, chunk, &err_param))
4036 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
4046 (struct sctp_association *)asoc, param, &ev);
4049 (struct sctp_association *)asoc, param, &ev);
4052 (struct sctp_association *)asoc, param, &ev);
4055 (struct sctp_association *)asoc, param, &ev);
4058 (struct sctp_association *)asoc, param, &ev);
4061 (struct sctp_association *)asoc, param, &ev);
4091 const struct sctp_association *asoc,
4101 if (!sctp_vtag_verify(chunk, asoc)) {
4104 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4107 if (!asoc->peer.prsctp_capable)
4108 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands);
4111 if (!sctp_chunk_length_valid(chunk, sctp_ftsnchk_len(&asoc->stream)))
4112 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4127 if (sctp_tsnmap_check(&asoc->peer.tsn_map, tsn) < 0)
4130 if (!asoc->stream.si->validate_ftsn(chunk))
4134 if (len > sctp_ftsnhdr_len(&asoc->stream))
4139 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) {
4158 const struct sctp_association *asoc,
4168 if (!sctp_vtag_verify(chunk, asoc)) {
4171 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4174 if (!asoc->peer.prsctp_capable)
4175 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands);
4178 if (!sctp_chunk_length_valid(chunk, sctp_ftsnchk_len(&asoc->stream)))
4179 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4194 if (sctp_tsnmap_check(&asoc->peer.tsn_map, tsn) < 0)
4197 if (!asoc->stream.si->validate_ftsn(chunk))
4201 if (len > sctp_ftsnhdr_len(&asoc->stream))
4244 const struct sctp_association *asoc,
4262 if (!sctp_auth_asoc_verify_hmac_id(asoc, auth_hdr->hmac_id))
4269 if (key_id != asoc->active_key_id) {
4270 sh_key = sctp_auth_get_shkey(asoc, key_id);
4300 sctp_auth_calculate_hmac(asoc, chunk->skb,
4320 const struct sctp_association *asoc,
4330 if (!asoc->peer.auth_capable)
4331 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands);
4333 if (!sctp_vtag_verify(chunk, asoc)) {
4336 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4341 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4345 error = sctp_sf_authenticate(asoc, chunk);
4351 err_chunk = sctp_make_op_error(asoc, chunk,
4362 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4365 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4375 if (asoc->active_key_id != ntohs(auth_hdr->shkey_id)) {
4378 ev = sctp_ulpevent_make_authkey(asoc, ntohs(auth_hdr->shkey_id),
4416 const struct sctp_association *asoc,
4427 if (!sctp_vtag_verify(unk_chunk, asoc))
4428 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4435 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4441 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4445 err_chunk = sctp_make_op_error(asoc, unk_chunk,
4455 sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4463 err_chunk = sctp_make_op_error(asoc, unk_chunk,
4487 * (endpoint, asoc, chunk)
4490 * (asoc, reply_msg, msg_up, timers, counters)
4496 const struct sctp_association *asoc,
4503 if (asoc && !sctp_vtag_verify(chunk, asoc))
4504 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4511 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4530 * (endpoint, asoc, chunk)
4533 * (asoc, reply_msg, msg_up, timers, counters)
4539 const struct sctp_association *asoc,
4556 * (endpoint, asoc, chunk)
4559 * (asoc, reply_msg, msg_up, timers, counters)
4566 const struct sctp_association *asoc,
4573 if (!sctp_vtag_verify(chunk, asoc))
4574 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4578 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4590 const struct sctp_association *asoc,
4611 if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc))
4615 abort = sctp_make_abort_violation(asoc, chunk, payload, paylen);
4619 if (asoc) {
4622 !asoc->peer.i.init_tag) {
4640 if (asoc->state <= SCTP_STATE_COOKIE_ECHOED) {
4655 packet = sctp_ootb_pkt_new(net, asoc, chunk);
4676 sctp_sf_pdiscard(net, ep, asoc, SCTP_ST_CHUNK(0), arg, commands);
4697 * (endpoint, asoc, chunk)
4707 const struct sctp_association *asoc,
4714 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str,
4727 const struct sctp_association *asoc,
4736 if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc))
4740 abort = sctp_make_violation_paramlen(asoc, chunk, param);
4755 sctp_sf_pdiscard(net, ep, asoc, SCTP_ST_CHUNK(0), arg, commands);
4770 const struct sctp_association *asoc,
4777 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str,
4790 const struct sctp_association *asoc,
4797 if (!asoc)
4798 return sctp_sf_violation(net, ep, asoc, type, arg, commands);
4800 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str,
4849 * [This is the argument asoc.]
4853 * [This is asoc->peer.active_path.]
4865 const struct sctp_association *asoc,
4888 repl = sctp_make_init(asoc, &asoc->base.bind_addr, GFP_ATOMIC, 0);
4899 my_asoc = (struct sctp_association *)asoc;
4977 const struct sctp_association *asoc,
5017 const struct sctp_association *asoc,
5036 if (sctp_outq_is_empty(&asoc->outqueue)) {
5037 disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type,
5074 const struct sctp_association *asoc,
5111 const struct sctp_association *asoc,
5126 const struct sctp_association *asoc,
5142 * (endpoint, asoc)
5153 const struct sctp_association *asoc,
5177 * (endpoint, asoc)
5188 const struct sctp_association *asoc,
5196 return sctp_sf_cookie_wait_prm_shutdown(net, ep, asoc, type, arg, commands);
5205 * (endpoint, asoc)
5216 const struct sctp_association *asoc,
5254 * (endpoint, asoc)
5265 const struct sctp_association *asoc,
5273 return sctp_sf_cookie_wait_prm_abort(net, ep, asoc, type, arg, commands);
5280 * (endpoint, asoc)
5291 const struct sctp_association *asoc,
5300 return sctp_sf_do_9_1_prm_abort(net, ep, asoc, type, arg, commands);
5307 * (endpoint, asoc)
5318 const struct sctp_association *asoc,
5331 return sctp_sf_do_9_1_prm_abort(net, ep, asoc, type, arg, commands);
5338 * (endpoint, asoc)
5349 const struct sctp_association *asoc,
5357 return sctp_sf_shutdown_sent_prm_abort(net, ep, asoc, type, arg, commands);
5385 const struct sctp_association *asoc,
5390 if (SCTP_DISPOSITION_NOMEM == sctp_sf_heartbeat(ep, asoc, type,
5417 const struct sctp_association *asoc,
5434 const struct sctp_association *asoc,
5453 const struct sctp_association *asoc,
5477 const struct sctp_association *asoc,
5484 event = sctp_ulpevent_make_sender_dry_event(asoc, GFP_ATOMIC);
5509 const struct sctp_association *asoc,
5521 reply = sctp_make_shutdown(asoc, arg);
5541 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE])
5579 const struct sctp_association *asoc,
5595 if (!sctp_vtag_verify(chunk, asoc))
5596 return sctp_sf_pdiscard(net, ep, asoc, type, arg,
5602 return sctp_sf_violation_chunklen(net, ep, asoc, type,
5609 reply = sctp_make_shutdown_ack(asoc, chunk);
5622 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE])
5652 const struct sctp_association *asoc,
5680 const struct sctp_association *asoc,
5689 if (asoc->overall_error_count >= asoc->max_retrans) {
5690 if (asoc->peer.zero_window_announced &&
5691 asoc->state == SCTP_STATE_SHUTDOWN_PENDING) {
5768 const struct sctp_association *asoc,
5784 * (endpoint, asoc)
5800 const struct sctp_association *asoc,
5805 int attempts = asoc->init_err_counter + 1;
5813 if (attempts <= asoc->max_init_attempts) {
5814 bp = (struct sctp_bind_addr *) &asoc->base.bind_addr;
5815 repl = sctp_make_init(asoc, bp, GFP_ATOMIC, 0);
5831 asoc->max_init_attempts);
5849 * (endpoint, asoc)
5865 const struct sctp_association *asoc,
5870 int attempts = asoc->init_err_counter + 1;
5877 if (attempts <= asoc->max_init_attempts) {
5878 repl = sctp_make_cookie_echo(asoc, NULL);
5916 const struct sctp_association *asoc,
5927 ((struct sctp_association *)asoc)->shutdown_retries++;
5929 if (asoc->overall_error_count >= asoc->max_retrans) {
5940 switch (asoc->state) {
5942 reply = sctp_make_shutdown(asoc, NULL);
5946 reply = sctp_make_shutdown_ack(asoc, NULL);
5961 if (asoc->shutdown_last_sent_to)
5963 SCTP_TRANSPORT(asoc->shutdown_last_sent_to));
5987 const struct sctp_association *asoc,
5992 struct sctp_chunk *chunk = asoc->addip_last_asconf;
6013 if (asoc->overall_error_count >= asoc->max_retrans) {
6036 sctp_chunk_hold(asoc->addip_last_asconf);
6038 SCTP_CHUNK(asoc->addip_last_asconf));
6059 const struct sctp_association *asoc,
6070 reply = sctp_make_abort(asoc, NULL, 0);
6096 const struct sctp_association *asoc,
6117 if (sctp_outq_is_empty(&asoc->outqueue)) {
6118 disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type,
6133 * (endpoint, asoc, chunk)
6139 const struct sctp_association *asoc,
6150 * (endpoint, asoc, chunk)
6156 const struct sctp_association *asoc,
6170 * (endpoint, asoc, chunk)
6176 const struct sctp_association *asoc,
6221 const struct sctp_association *asoc,
6228 packet = sctp_ootb_pkt_new(net, asoc, chunk);
6232 * The T bit will be set if the asoc is NULL.
6234 abort = sctp_make_abort(asoc, chunk, paylen);
6262 const struct sctp_association *asoc,
6277 if (asoc) {
6292 vtag = asoc->peer.i.init_tag;
6344 const struct sctp_association *asoc,
6352 packet = sctp_ootb_pkt_new(net, asoc, chunk);
6373 static int sctp_eat_data(const struct sctp_association *asoc,
6377 struct sctp_tsnmap *map = (struct sctp_tsnmap *)&asoc->peer.tsn_map;
6378 struct sock *sk = asoc->base.sk;
6389 skb_pull(chunk->skb, sctp_datahdr_len(&asoc->stream));
6406 if (asoc->peer.ecn_capable && !chunk->ecn_ce_done) {
6417 tmp = sctp_tsnmap_check(&asoc->peer.tsn_map, tsn);
6422 if (chunk->asoc)
6423 chunk->asoc->stats.outofseqtsns++;
6437 datalen -= sctp_datachk_len(&asoc->stream);
6442 if ((datalen >= asoc->rwnd) && (!asoc->ulpq.pd_mode)) {
6455 if ((!chunk->data_accepted) && (!asoc->rwnd || asoc->rwnd_over ||
6456 (datalen > asoc->rwnd + asoc->frag_point))) {
6470 __func__, tsn, datalen, asoc->rwnd);
6503 err = sctp_make_abort_no_data(asoc, chunk, tsn);
6528 if (chunk->asoc)
6529 chunk->asoc->stats.iuodchunks++;
6532 if (chunk->asoc)
6533 chunk->asoc->stats.iodchunks++;
6544 if (ntohs(data_hdr->stream) >= asoc->stream.incnt) {
6548 err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM,
6565 if (!asoc->stream.si->validate_data(chunk))