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,
93 const struct sctp_association *asoc,
103 const struct sctp_association *asoc,
109 const struct sctp_association *asoc,
118 const struct sctp_association *asoc,
126 const struct sctp_association *asoc,
134 const struct sctp_association *asoc,
142 const struct sctp_association *asoc,
148 const struct sctp_association *asoc,
154 const struct sctp_association *asoc,
161 const struct sctp_association *asoc,
224 * (endpoint, asoc, chunk)
227 * (asoc, reply_msg, msg_up, timers, counters)
233 const struct sctp_association *asoc,
240 if (!sctp_vtag_verify_either(chunk, asoc))
241 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
249 return sctp_sf_violation_chunk(net, ep, asoc, type, arg, commands);
253 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
263 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_SHUTDOWN_COMP,
309 * (endpoint, asoc, chunk)
312 * (asoc, reply_msg, msg_up, timers, counters)
318 const struct sctp_association *asoc,
339 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
347 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
354 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
361 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
370 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
374 if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
381 packet = sctp_abort_pkt_new(net, ep, asoc, arg,
398 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg,
416 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
509 * (endpoint, asoc, chunk)
512 * (asoc, reply_msg, msg_up, timers, counters)
518 const struct sctp_association *asoc,
528 if (!sctp_vtag_verify(chunk, asoc))
529 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
536 return sctp_sf_violation_chunk(net, ep, asoc, type, arg, commands);
540 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
547 if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
559 packet = sctp_abort_pkt_new(net, ep, asoc, arg,
586 if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc))
587 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
591 asoc, chunk->transport);
636 const struct sctp_association *asoc)
651 if (!net->sctp.auth_enable || !asoc->peer.auth_capable)
656 auth.asoc = chunk->asoc;
664 return sctp_sf_authenticate(asoc, &auth) == SCTP_IERROR_NO_ERROR;
691 * (endpoint, asoc, chunk)
694 * (asoc, reply_msg, msg_up, timers, counters)
700 const struct sctp_association *asoc,
714 if (asoc && !sctp_vtag_verify(chunk, asoc))
715 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
722 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
731 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
741 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
756 new_asoc = sctp_unpack_cookie(ep, asoc, chunk, GFP_ATOMIC, &error,
774 sctp_send_stale_cookie_err(net, ep, asoc, chunk, commands,
776 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
780 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
786 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
813 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
912 * (endpoint, asoc, chunk)
915 * (asoc, reply_msg, msg_up, timers, counters)
921 const struct sctp_association *asoc,
929 if (!sctp_vtag_verify(chunk, asoc))
930 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
933 if (security_sctp_assoc_established((struct sctp_association *)asoc,
935 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
941 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
965 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE])
973 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_COMM_UP,
974 0, asoc->c.sinit_num_ostreams,
975 asoc->c.sinit_max_instreams,
988 if (asoc->peer.adaptation_ind) {
989 ev = sctp_ulpevent_make_adaptation_indication(asoc, GFP_ATOMIC);
997 if (!asoc->peer.auth_capable) {
998 ev = sctp_ulpevent_make_authkey(asoc, 0, SCTP_AUTH_NO_AUTH,
1014 const struct sctp_association *asoc,
1023 reply = sctp_make_heartbeat(asoc, transport, 0);
1040 const struct sctp_association *asoc,
1047 if (asoc->overall_error_count >= asoc->max_retrans) {
1067 sctp_sf_heartbeat(ep, asoc, type, arg,
1085 /* resend asoc strreset_chunk. */
1088 const struct sctp_association *asoc,
1095 if (asoc->overall_error_count >= asoc->max_retrans) {
1106 sctp_chunk_hold(asoc->strreset_chunk);
1108 SCTP_CHUNK(asoc->strreset_chunk));
1117 const struct sctp_association *asoc,
1129 reply = sctp_make_heartbeat(asoc, transport, transport->pl.probe_size);
1156 * (endpoint, asoc, chunk)
1159 * (asoc, reply_msg, msg_up, timers, counters)
1165 const struct sctp_association *asoc,
1174 if (!sctp_vtag_verify(chunk, asoc))
1175 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1180 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
1192 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
1198 reply = sctp_make_heartbeat_ack(asoc, chunk, param_hdr, paylen);
1230 * (endpoint, asoc, chunk)
1233 * (asoc, reply_msg, msg_up, timers, counters)
1239 const struct sctp_association *asoc,
1250 if (!sctp_vtag_verify(chunk, asoc))
1251 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1256 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
1265 link = sctp_assoc_lookup_paddr(asoc, &from_addr);
1272 asoc,
1277 asoc,
1295 return sctp_sf_send_probe(net, ep, asoc, type, link, commands);
1388 const struct sctp_association *asoc,
1409 if (!list_has_sctp_addr(&asoc->peer.transport_addr_list,
1428 const struct sctp_association *asoc)
1430 switch (asoc->state) {
1435 new_asoc->c.my_vtag = asoc->c.my_vtag;
1436 new_asoc->c.my_ttag = asoc->c.my_vtag;
1441 new_asoc->c.my_vtag = asoc->c.my_vtag;
1442 new_asoc->c.my_ttag = asoc->c.my_vtag;
1443 new_asoc->c.peer_ttag = asoc->c.peer_vtag;
1450 new_asoc->c.my_ttag = asoc->c.my_vtag;
1451 new_asoc->c.peer_ttag = asoc->c.peer_vtag;
1459 new_asoc->rwnd = asoc->rwnd;
1460 new_asoc->c.sinit_num_ostreams = asoc->c.sinit_num_ostreams;
1461 new_asoc->c.sinit_max_instreams = asoc->c.sinit_max_instreams;
1462 new_asoc->c.initial_tsn = asoc->c.initial_tsn;
1475 const struct sctp_association *asoc)
1478 if ((asoc->c.my_vtag != new_asoc->c.my_vtag) &&
1479 (asoc->c.peer_vtag != new_asoc->c.peer_vtag) &&
1480 (asoc->c.my_vtag == new_asoc->c.my_ttag) &&
1481 (asoc->c.peer_vtag == new_asoc->c.peer_ttag))
1485 if ((asoc->c.my_vtag == new_asoc->c.my_vtag) &&
1486 ((asoc->c.peer_vtag != new_asoc->c.peer_vtag) ||
1487 (0 == asoc->c.peer_vtag))) {
1492 if ((asoc->c.my_vtag == new_asoc->c.my_vtag) &&
1493 (asoc->c.peer_vtag == new_asoc->c.peer_vtag))
1497 if ((asoc->c.my_vtag != new_asoc->c.my_vtag) &&
1498 (asoc->c.peer_vtag == new_asoc->c.peer_vtag) &&
1513 const struct sctp_association *asoc,
1535 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1539 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1545 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
1548 return sctp_sf_new_encap_port(net, ep, asoc, type, arg, commands);
1558 if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
1565 packet = sctp_abort_pkt_new(net, ep, asoc, arg,
1581 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg,
1600 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1621 if (!sctp_state(asoc, COOKIE_WAIT)) {
1622 if (!sctp_sf_check_restart_addrs(new_asoc, asoc, chunk,
1629 sctp_tietags_populate(new_asoc, asoc);
1722 * (endpoint, asoc, chunk)
1725 * (asoc, reply_msg, msg_up, timers, counters)
1732 const struct sctp_association *asoc,
1740 return sctp_sf_do_unexpected_init(net, ep, asoc, type, arg, commands);
1777 * (endpoint, asoc, chunk)
1780 * (asoc, reply_msg, msg_up, timers, counters)
1787 const struct sctp_association *asoc,
1795 return sctp_sf_do_unexpected_init(net, ep, asoc, type, arg, commands);
1811 const struct sctp_association *asoc,
1820 return sctp_sf_ootb(net, ep, asoc, type, arg, commands);
1822 return sctp_sf_discard_chunk(net, ep, asoc, type, arg, commands);
1825 static int sctp_sf_do_assoc_update(struct sctp_association *asoc,
1829 struct net *net = asoc->base.net;
1832 if (!sctp_assoc_update(asoc, new))
1835 abort = sctp_make_abort(asoc, NULL, sizeof(struct sctp_errhdr));
1857 const struct sctp_association *asoc,
1886 if (!sctp_sf_check_restart_addrs(new_asoc, asoc, chunk, commands))
1895 if (sctp_state(asoc, SHUTDOWN_ACK_SENT)) {
1896 disposition = __sctp_sf_do_9_2_reshutack(net, ep, asoc,
1902 err = sctp_make_op_error(asoc, chunk,
1928 if (sctp_sf_do_assoc_update((struct sctp_association *)asoc, new_asoc, commands))
1931 repl = sctp_make_cookie_ack(asoc, chunk);
1936 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_RESTART, 0,
1937 asoc->c.sinit_num_ostreams,
1938 asoc->c.sinit_max_instreams,
1944 if ((sctp_state(asoc, SHUTDOWN_PENDING) ||
1945 sctp_state(asoc, SHUTDOWN_SENT)) &&
1946 (sctp_sstate(asoc->base.sk, CLOSING) ||
1947 sock_flag(asoc->base.sk, SOCK_DEAD))) {
1953 return sctp_sf_do_9_2_start_shutdown(net, ep, asoc,
1980 const struct sctp_association *asoc,
2004 if (asoc->state < SCTP_STATE_ESTABLISHED)
2009 if (sctp_sf_do_assoc_update((struct sctp_association *)asoc, new_asoc, commands))
2012 repl = sctp_make_cookie_ack(asoc, chunk);
2040 if (asoc->peer.adaptation_ind)
2043 if (!asoc->peer.auth_capable)
2064 const struct sctp_association *asoc,
2087 const struct sctp_association *asoc,
2102 if (!sctp_auth_chunk_verify(net, chunk, asoc))
2106 if (asoc->state < SCTP_STATE_ESTABLISHED) {
2122 ev = sctp_ulpevent_make_assoc_change(asoc, 0,
2124 asoc->c.sinit_num_ostreams,
2125 asoc->c.sinit_max_instreams,
2135 if (asoc->peer.adaptation_ind) {
2136 ai_ev = sctp_ulpevent_make_adaptation_indication(asoc,
2143 if (!asoc->peer.auth_capable) {
2144 auth_ev = sctp_ulpevent_make_authkey(asoc, 0,
2152 repl = sctp_make_cookie_ack(asoc, chunk);
2189 * (endpoint, asoc, chunk)
2192 * (asoc, reply_msg, msg_up, timers, counters)
2199 const struct sctp_association *asoc,
2217 if (!sctp_vtag_verify(chunk, asoc))
2218 asoc = NULL;
2219 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, commands);
2235 new_asoc = sctp_unpack_cookie(ep, asoc, chunk, GFP_ATOMIC, &error,
2253 sctp_send_stale_cookie_err(net, ep, asoc, chunk, commands,
2255 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2258 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2265 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2274 action = sctp_tietags_compare(new_asoc, asoc);
2278 retval = sctp_sf_do_dupcook_a(net, ep, asoc, chunk, commands,
2283 retval = sctp_sf_do_dupcook_b(net, ep, asoc, chunk, commands,
2288 retval = sctp_sf_do_dupcook_c(net, ep, asoc, chunk, commands,
2293 retval = sctp_sf_do_dupcook_d(net, ep, asoc, chunk, commands,
2298 retval = sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2310 SCTP_ASOC((struct sctp_association *)asoc));
2326 const struct sctp_association *asoc,
2333 if (!sctp_vtag_verify_either(chunk, asoc))
2334 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2347 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2355 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest))
2356 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2359 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2361 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands);
2372 const struct sctp_association *asoc,
2379 if (!sctp_vtag_verify_either(chunk, asoc))
2380 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2393 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2401 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest))
2402 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2405 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2415 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands);
2426 const struct sctp_association *asoc,
2434 return sctp_sf_shutdown_sent_abort(net, ep, asoc, type, arg, commands);
2444 * (endpoint, asoc, chunk)
2447 * (asoc, reply_msg, msg_up, timers, counters)
2454 const struct sctp_association *asoc,
2462 if (!sctp_vtag_verify(chunk, asoc))
2463 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2469 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
2479 return sctp_sf_do_5_2_6_stale(net, ep, asoc, type,
2488 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2509 * (endpoint, asoc, chunk)
2512 * (asoc, reply_msg, msg_up, timers, counters)
2519 const struct sctp_association *asoc,
2524 int attempts = asoc->init_err_counter + 1;
2531 if (attempts > asoc->max_init_attempts) {
2563 bp = (struct sctp_bind_addr *) &asoc->base.bind_addr;
2564 reply = sctp_make_init(asoc, bp, GFP_ATOMIC, sizeof(bht));
2586 SCTP_TRANSPORT(asoc->peer.primary_path));
2632 * (endpoint, asoc, chunk)
2635 * (asoc, reply_msg, msg_up, timers, counters)
2642 const struct sctp_association *asoc,
2649 if (!sctp_vtag_verify_either(chunk, asoc))
2650 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2663 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2671 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest))
2672 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2675 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2677 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands);
2683 const struct sctp_association *asoc,
2714 const struct sctp_association *asoc,
2723 if (!sctp_vtag_verify_either(chunk, asoc))
2724 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2737 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2744 return sctp_stop_t1_and_abort(net, commands, error, ECONNREFUSED, asoc,
2754 const struct sctp_association *asoc,
2760 ENOPROTOOPT, asoc,
2770 const struct sctp_association *asoc,
2778 return sctp_sf_cookie_wait_abort(net, ep, asoc, type, arg, commands);
2790 const struct sctp_association *asoc,
2834 * (endpoint, asoc, chunk)
2837 * (asoc, reply_msg, msg_up, timers, counters)
2844 const struct sctp_association *asoc,
2855 if (!sctp_vtag_verify(chunk, asoc))
2856 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2860 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
2869 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) {
2871 asoc->ctsn_ack_point);
2880 if (!TSN_lt(ctsn, asoc->next_tsn))
2881 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands);
2887 ev = sctp_ulpevent_make_shutdown_event(asoc, 0, GFP_ATOMIC);
2904 if (sctp_outq_is_empty(&asoc->outqueue)) {
2905 disposition = sctp_sf_do_9_2_shutdown_ack(net, ep, asoc, type,
2934 const struct sctp_association *asoc,
2943 if (!sctp_vtag_verify(chunk, asoc))
2944 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2948 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
2954 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) {
2956 asoc->ctsn_ack_point);
2965 if (!TSN_lt(ctsn, asoc->next_tsn))
2966 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands);
2987 const struct sctp_association *asoc,
2996 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3003 reply = sctp_make_shutdown_ack(asoc, chunk);
3025 const struct sctp_association *asoc,
3032 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3035 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3038 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
3040 return __sctp_sf_do_9_2_reshutack(net, ep, asoc, type, arg, commands);
3061 * (endpoint, asoc, chunk)
3064 * (asoc, reply_msg, msg_up, timers, counters)
3070 const struct sctp_association *asoc,
3079 if (!sctp_vtag_verify(chunk, asoc))
3080 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3083 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3092 if (TSN_lte(asoc->last_ecne_tsn, lowest_tsn)) {
3117 * (endpoint, asoc, chunk)
3120 * (asoc, reply_msg, msg_up, timers, counters)
3126 const struct sctp_association *asoc,
3133 if (!sctp_vtag_verify(chunk, asoc))
3134 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3137 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3173 * (endpoint, asoc, chunk)
3176 * (asoc, reply_msg, msg_up, timers, counters)
3182 const struct sctp_association *asoc,
3191 if (!sctp_vtag_verify(chunk, asoc)) {
3194 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3197 if (!sctp_chunk_length_valid(chunk, sctp_datachk_len(&asoc->stream)))
3198 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3201 error = sctp_eat_data(asoc, chunk, commands);
3216 return sctp_sf_abort_violation(net, ep, asoc, chunk, commands,
3218 sctp_datahdr_len(&asoc->stream));
3226 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) {
3293 * (endpoint, asoc, chunk)
3296 * (asoc, reply_msg, msg_up, timers, counters)
3303 const struct sctp_association *asoc,
3311 if (!sctp_vtag_verify(chunk, asoc)) {
3314 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3317 if (!sctp_chunk_length_valid(chunk, sctp_datachk_len(&asoc->stream)))
3318 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3321 error = sctp_eat_data(asoc, chunk, commands);
3332 return sctp_sf_abort_violation(net, ep, asoc, chunk, commands,
3334 sctp_datahdr_len(&asoc->stream));
3385 * (endpoint, asoc, chunk)
3388 * (asoc, reply_msg, msg_up, timers, counters)
3394 const struct sctp_association *asoc,
3403 if (!sctp_vtag_verify(chunk, asoc))
3404 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3408 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3415 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3423 if (TSN_lte(asoc->next_tsn, ctsn))
3424 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands);
3426 trace_sctp_probe(ep, asoc, chunk);
3434 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) {
3436 asoc->ctsn_ack_point);
3471 const struct sctp_association *asoc,
3480 packet = sctp_ootb_pkt_new(net, asoc, chunk);
3484 /* Make an ABORT. The T bit will be set if the asoc
3487 abort = sctp_make_abort(asoc, chunk, 0);
3506 sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3518 const struct sctp_association *asoc,
3527 packet = sctp_ootb_pkt_new(net, asoc, chunk);
3531 abort = sctp_make_new_encap_port(asoc, chunk);
3546 sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3560 const struct sctp_association *asoc,
3568 if (!sctp_vtag_verify(chunk, asoc))
3569 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3573 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3577 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
3598 const struct sctp_association *asoc,
3607 if (!sctp_vtag_verify(chunk, asoc))
3608 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3612 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3619 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_SHUTDOWN_COMP,
3625 reply = sctp_make_shutdown_complete(asoc, chunk);
3681 const struct sctp_association *asoc,
3695 if (asoc && !sctp_vtag_verify(chunk, asoc))
3696 asoc = NULL;
3702 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3708 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3723 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3746 return sctp_sf_shut_8_4_5(net, ep, asoc, type, arg, commands);
3748 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3750 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
3767 * (endpoint, asoc, type, arg, commands)
3777 const struct sctp_association *asoc,
3786 packet = sctp_ootb_pkt_new(net, asoc, chunk);
3791 * The T bit will be set if the asoc is NULL.
3793 shut = sctp_make_shutdown_complete(asoc, chunk);
3817 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3833 const struct sctp_association *asoc,
3840 if (!sctp_vtag_verify(chunk, asoc))
3841 asoc = NULL;
3845 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3861 const struct sctp_association *asoc,
3872 if (!sctp_vtag_verify(chunk, asoc)) {
3875 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3880 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3889 if (!asoc->peer.asconf_capable ||
3891 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3897 if (!sctp_verify_asconf(asoc, chunk, true, &err_param))
3898 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
3905 if (serial == asoc->peer.addip_serial + 1) {
3910 sctp_assoc_clean_asconf_ack_cache(asoc);
3921 asoc, chunk);
3924 } else if (serial < asoc->peer.addip_serial + 1) {
3937 asconf_ack = sctp_assoc_lookup_asconf_ack(asoc, hdr->serial);
3964 if (asoc->new_transport) {
3965 sctp_sf_heartbeat(ep, asoc, type, asoc->new_transport, commands);
3966 ((struct sctp_association *)asoc)->new_transport = NULL;
3975 struct sctp_association *asoc,
3982 if (list_empty(&asoc->addip_chunk_list))
3985 entry = asoc->addip_chunk_list.next;
3990 asoc->addip_last_asconf = asconf;
3992 return sctp_sf_do_prm_asconf(net, ep, asoc, type, asconf, commands);
4002 const struct sctp_association *asoc,
4007 struct sctp_chunk *last_asconf = asoc->addip_last_asconf;
4014 if (!sctp_vtag_verify(asconf_ack, asoc)) {
4017 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4023 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4032 if (!asoc->peer.asconf_capable ||
4034 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4040 if (!sctp_verify_asconf(asoc, asconf_ack, false, &err_param))
4041 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
4048 sent_serial = asoc->addip_serial - 1;
4058 !(asoc->addip_last_asconf)) {
4059 abort = sctp_make_abort(asoc, asconf_ack,
4081 if ((rcvd_serial == sent_serial) && asoc->addip_last_asconf) {
4085 if (!sctp_process_asconf_ack((struct sctp_association *)asoc,
4088 (struct sctp_association *)asoc,
4091 abort = sctp_make_abort(asoc, asconf_ack,
4117 const struct sctp_association *asoc,
4127 if (!sctp_vtag_verify(chunk, asoc)) {
4130 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4135 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4138 if (!sctp_verify_reconf(asoc, chunk, &err_param))
4139 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
4149 (struct sctp_association *)asoc, param, &ev);
4152 (struct sctp_association *)asoc, param, &ev);
4155 (struct sctp_association *)asoc, param, &ev);
4158 (struct sctp_association *)asoc, param, &ev);
4161 (struct sctp_association *)asoc, param, &ev);
4164 (struct sctp_association *)asoc, param, &ev);
4194 const struct sctp_association *asoc,
4204 if (!sctp_vtag_verify(chunk, asoc)) {
4207 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4210 if (!asoc->peer.prsctp_capable)
4211 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands);
4214 if (!sctp_chunk_length_valid(chunk, sctp_ftsnchk_len(&asoc->stream)))
4215 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4230 if (sctp_tsnmap_check(&asoc->peer.tsn_map, tsn) < 0)
4233 if (!asoc->stream.si->validate_ftsn(chunk))
4237 if (len > sctp_ftsnhdr_len(&asoc->stream))
4242 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) {
4261 const struct sctp_association *asoc,
4271 if (!sctp_vtag_verify(chunk, asoc)) {
4274 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4277 if (!asoc->peer.prsctp_capable)
4278 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands);
4281 if (!sctp_chunk_length_valid(chunk, sctp_ftsnchk_len(&asoc->stream)))
4282 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4297 if (sctp_tsnmap_check(&asoc->peer.tsn_map, tsn) < 0)
4300 if (!asoc->stream.si->validate_ftsn(chunk))
4304 if (len > sctp_ftsnhdr_len(&asoc->stream))
4347 const struct sctp_association *asoc,
4365 if (!sctp_auth_asoc_verify_hmac_id(asoc, auth_hdr->hmac_id))
4372 if (key_id != asoc->active_key_id) {
4373 sh_key = sctp_auth_get_shkey(asoc, key_id);
4403 sctp_auth_calculate_hmac(asoc, chunk->skb,
4423 const struct sctp_association *asoc,
4433 if (!asoc->peer.auth_capable)
4434 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands);
4436 if (!sctp_vtag_verify(chunk, asoc)) {
4439 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4444 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4448 error = sctp_sf_authenticate(asoc, chunk);
4454 err_chunk = sctp_make_op_error(asoc, chunk,
4465 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4468 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4478 if (asoc->active_key_id != ntohs(auth_hdr->shkey_id)) {
4481 ev = sctp_ulpevent_make_authkey(asoc, ntohs(auth_hdr->shkey_id),
4519 const struct sctp_association *asoc,
4530 if (!sctp_vtag_verify(unk_chunk, asoc))
4531 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4538 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4544 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4548 err_chunk = sctp_make_op_error(asoc, unk_chunk,
4558 sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4566 err_chunk = sctp_make_op_error(asoc, unk_chunk,
4590 * (endpoint, asoc, chunk)
4593 * (asoc, reply_msg, msg_up, timers, counters)
4599 const struct sctp_association *asoc,
4606 if (asoc && !sctp_vtag_verify(chunk, asoc))
4607 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4614 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4633 * (endpoint, asoc, chunk)
4636 * (asoc, reply_msg, msg_up, timers, counters)
4642 const struct sctp_association *asoc,
4659 * (endpoint, asoc, chunk)
4662 * (asoc, reply_msg, msg_up, timers, counters)
4669 const struct sctp_association *asoc,
4676 if (!sctp_vtag_verify(chunk, asoc))
4677 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4681 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4693 const struct sctp_association *asoc,
4714 if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc))
4718 abort = sctp_make_abort_violation(asoc, chunk, payload, paylen);
4722 if (asoc) {
4725 !asoc->peer.i.init_tag) {
4743 if (asoc->state <= SCTP_STATE_COOKIE_ECHOED) {
4758 packet = sctp_ootb_pkt_new(net, asoc, chunk);
4779 sctp_sf_pdiscard(net, ep, asoc, SCTP_ST_CHUNK(0), arg, commands);
4800 * (endpoint, asoc, chunk)
4810 const struct sctp_association *asoc,
4817 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str,
4830 const struct sctp_association *asoc,
4839 if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc))
4843 abort = sctp_make_violation_paramlen(asoc, chunk, param);
4858 sctp_sf_pdiscard(net, ep, asoc, SCTP_ST_CHUNK(0), arg, commands);
4873 const struct sctp_association *asoc,
4880 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str,
4893 const struct sctp_association *asoc,
4900 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str,
4949 * [This is the argument asoc.]
4953 * [This is asoc->peer.active_path.]
4965 const struct sctp_association *asoc,
4988 repl = sctp_make_init(asoc, &asoc->base.bind_addr, GFP_ATOMIC, 0);
4999 my_asoc = (struct sctp_association *)asoc;
5077 const struct sctp_association *asoc,
5117 const struct sctp_association *asoc,
5136 if (sctp_outq_is_empty(&asoc->outqueue)) {
5137 disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type,
5174 const struct sctp_association *asoc,
5211 const struct sctp_association *asoc,
5226 const struct sctp_association *asoc,
5242 * (endpoint, asoc)
5253 const struct sctp_association *asoc,
5277 * (endpoint, asoc)
5288 const struct sctp_association *asoc,
5296 return sctp_sf_cookie_wait_prm_shutdown(net, ep, asoc, type, arg, commands);
5305 * (endpoint, asoc)
5316 const struct sctp_association *asoc,
5354 * (endpoint, asoc)
5365 const struct sctp_association *asoc,
5373 return sctp_sf_cookie_wait_prm_abort(net, ep, asoc, type, arg, commands);
5380 * (endpoint, asoc)
5391 const struct sctp_association *asoc,
5400 return sctp_sf_do_9_1_prm_abort(net, ep, asoc, type, arg, commands);
5407 * (endpoint, asoc)
5418 const struct sctp_association *asoc,
5431 return sctp_sf_do_9_1_prm_abort(net, ep, asoc, type, arg, commands);
5438 * (endpoint, asoc)
5449 const struct sctp_association *asoc,
5457 return sctp_sf_shutdown_sent_prm_abort(net, ep, asoc, type, arg, commands);
5485 const struct sctp_association *asoc,
5490 if (SCTP_DISPOSITION_NOMEM == sctp_sf_heartbeat(ep, asoc, type,
5517 const struct sctp_association *asoc,
5534 const struct sctp_association *asoc,
5553 const struct sctp_association *asoc,
5577 const struct sctp_association *asoc,
5584 event = sctp_ulpevent_make_sender_dry_event(asoc, GFP_ATOMIC);
5609 const struct sctp_association *asoc,
5621 reply = sctp_make_shutdown(asoc, arg);
5641 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE])
5679 const struct sctp_association *asoc,
5695 if (!sctp_vtag_verify(chunk, asoc))
5696 return sctp_sf_pdiscard(net, ep, asoc, type, arg,
5702 return sctp_sf_violation_chunklen(net, ep, asoc, type,
5709 reply = sctp_make_shutdown_ack(asoc, chunk);
5722 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE])
5752 const struct sctp_association *asoc,
5780 const struct sctp_association *asoc,
5789 if (asoc->overall_error_count >= asoc->max_retrans) {
5790 if (asoc->peer.zero_window_announced &&
5791 asoc->state == SCTP_STATE_SHUTDOWN_PENDING) {
5868 const struct sctp_association *asoc,
5884 * (endpoint, asoc)
5900 const struct sctp_association *asoc,
5905 int attempts = asoc->init_err_counter + 1;
5913 if (attempts <= asoc->max_init_attempts) {
5914 bp = (struct sctp_bind_addr *) &asoc->base.bind_addr;
5915 repl = sctp_make_init(asoc, bp, GFP_ATOMIC, 0);
5931 asoc->max_init_attempts);
5949 * (endpoint, asoc)
5965 const struct sctp_association *asoc,
5970 int attempts = asoc->init_err_counter + 1;
5977 if (attempts <= asoc->max_init_attempts) {
5978 repl = sctp_make_cookie_echo(asoc, NULL);
6016 const struct sctp_association *asoc,
6027 ((struct sctp_association *)asoc)->shutdown_retries++;
6029 if (asoc->overall_error_count >= asoc->max_retrans) {
6040 switch (asoc->state) {
6042 reply = sctp_make_shutdown(asoc, NULL);
6046 reply = sctp_make_shutdown_ack(asoc, NULL);
6061 if (asoc->shutdown_last_sent_to)
6063 SCTP_TRANSPORT(asoc->shutdown_last_sent_to));
6087 const struct sctp_association *asoc,
6092 struct sctp_chunk *chunk = asoc->addip_last_asconf;
6113 if (asoc->overall_error_count >= asoc->max_retrans) {
6136 sctp_chunk_hold(asoc->addip_last_asconf);
6138 SCTP_CHUNK(asoc->addip_last_asconf));
6159 const struct sctp_association *asoc,
6170 reply = sctp_make_abort(asoc, NULL, 0);
6196 const struct sctp_association *asoc,
6217 if (sctp_outq_is_empty(&asoc->outqueue)) {
6218 disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type,
6233 * (endpoint, asoc, chunk)
6239 const struct sctp_association *asoc,
6250 * (endpoint, asoc, chunk)
6256 const struct sctp_association *asoc,
6270 * (endpoint, asoc, chunk)
6276 const struct sctp_association *asoc,
6321 const struct sctp_association *asoc,
6328 packet = sctp_ootb_pkt_new(net, asoc, chunk);
6332 * The T bit will be set if the asoc is NULL.
6334 abort = sctp_make_abort(asoc, chunk, paylen);
6362 const struct sctp_association *asoc,
6377 if (asoc) {
6392 vtag = asoc->peer.i.init_tag;
6446 const struct sctp_association *asoc,
6454 packet = sctp_ootb_pkt_new(net, asoc, chunk);
6475 static int sctp_eat_data(const struct sctp_association *asoc,
6479 struct sctp_tsnmap *map = (struct sctp_tsnmap *)&asoc->peer.tsn_map;
6480 struct sock *sk = asoc->base.sk;
6491 skb_pull(chunk->skb, sctp_datahdr_len(&asoc->stream));
6508 if (asoc->peer.ecn_capable && !chunk->ecn_ce_done) {
6519 tmp = sctp_tsnmap_check(&asoc->peer.tsn_map, tsn);
6524 if (chunk->asoc)
6525 chunk->asoc->stats.outofseqtsns++;
6539 datalen -= sctp_datachk_len(&asoc->stream);
6544 if ((datalen >= asoc->rwnd) && (!asoc->ulpq.pd_mode)) {
6557 if ((!chunk->data_accepted) && (!asoc->rwnd || asoc->rwnd_over ||
6558 (datalen > asoc->rwnd + asoc->frag_point))) {
6572 __func__, tsn, datalen, asoc->rwnd);
6603 err = sctp_make_abort_no_data(asoc, chunk, tsn);
6628 if (chunk->asoc)
6629 chunk->asoc->stats.iuodchunks++;
6632 if (chunk->asoc)
6633 chunk->asoc->stats.iodchunks++;
6644 if (ntohs(data_hdr->stream) >= asoc->stream.incnt) {
6648 err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM,
6665 if (!asoc->stream.si->validate_data(chunk))