Lines Matching defs:asoc

54 					const struct sctp_association *asoc,
57 static int sctp_eat_data(const struct sctp_association *asoc,
62 const struct sctp_association *asoc,
66 const struct sctp_association *asoc,
73 const struct sctp_association *asoc,
80 const struct sctp_association *asoc,
87 const struct sctp_association *asoc,
94 const struct sctp_association *asoc,
104 const struct sctp_association *asoc,
110 const struct sctp_association *asoc,
119 const struct sctp_association *asoc,
127 const struct sctp_association *asoc,
135 const struct sctp_association *asoc,
143 const struct sctp_association *asoc,
149 const struct sctp_association *asoc,
155 const struct sctp_association *asoc,
162 const struct sctp_association *asoc,
225 * (endpoint, asoc, chunk)
228 * (asoc, reply_msg, msg_up, timers, counters)
234 const struct sctp_association *asoc,
241 if (!sctp_vtag_verify_either(chunk, asoc))
242 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
250 return sctp_sf_violation_chunk(net, ep, asoc, type, arg, commands);
254 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
264 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_SHUTDOWN_COMP,
310 * (endpoint, asoc, chunk)
313 * (asoc, reply_msg, msg_up, timers, counters)
319 const struct sctp_association *asoc,
340 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
348 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
355 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
362 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
371 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
375 if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
382 packet = sctp_abort_pkt_new(net, ep, asoc, arg,
399 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg,
417 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
510 * (endpoint, asoc, chunk)
513 * (asoc, reply_msg, msg_up, timers, counters)
519 const struct sctp_association *asoc,
529 if (!sctp_vtag_verify(chunk, asoc))
530 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
537 return sctp_sf_violation_chunk(net, ep, asoc, type, arg, commands);
541 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
548 if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
560 packet = sctp_abort_pkt_new(net, ep, asoc, arg,
587 if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc))
588 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
592 asoc, chunk->transport);
637 const struct sctp_association *asoc)
652 if (!net->sctp.auth_enable || !asoc->peer.auth_capable)
657 auth.asoc = chunk->asoc;
665 return sctp_sf_authenticate(asoc, &auth) == SCTP_IERROR_NO_ERROR;
692 * (endpoint, asoc, chunk)
695 * (asoc, reply_msg, msg_up, timers, counters)
701 const struct sctp_association *asoc,
715 if (asoc && !sctp_vtag_verify(chunk, asoc))
716 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
723 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
732 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
742 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
757 new_asoc = sctp_unpack_cookie(ep, asoc, chunk, GFP_ATOMIC, &error,
775 sctp_send_stale_cookie_err(net, ep, asoc, chunk, commands,
777 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
781 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
787 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
814 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
913 * (endpoint, asoc, chunk)
916 * (asoc, reply_msg, msg_up, timers, counters)
922 const struct sctp_association *asoc,
930 if (!sctp_vtag_verify(chunk, asoc))
931 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
934 if (security_sctp_assoc_established((struct sctp_association *)asoc,
936 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
942 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
966 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE])
974 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_COMM_UP,
975 0, asoc->c.sinit_num_ostreams,
976 asoc->c.sinit_max_instreams,
989 if (asoc->peer.adaptation_ind) {
990 ev = sctp_ulpevent_make_adaptation_indication(asoc, GFP_ATOMIC);
998 if (!asoc->peer.auth_capable) {
999 ev = sctp_ulpevent_make_authkey(asoc, 0, SCTP_AUTH_NO_AUTH,
1015 const struct sctp_association *asoc,
1024 reply = sctp_make_heartbeat(asoc, transport, 0);
1041 const struct sctp_association *asoc,
1048 if (asoc->overall_error_count >= asoc->max_retrans) {
1068 sctp_sf_heartbeat(ep, asoc, type, arg,
1086 /* resend asoc strreset_chunk. */
1089 const struct sctp_association *asoc,
1096 if (asoc->overall_error_count >= asoc->max_retrans) {
1107 sctp_chunk_hold(asoc->strreset_chunk);
1109 SCTP_CHUNK(asoc->strreset_chunk));
1118 const struct sctp_association *asoc,
1130 reply = sctp_make_heartbeat(asoc, transport, transport->pl.probe_size);
1157 * (endpoint, asoc, chunk)
1160 * (asoc, reply_msg, msg_up, timers, counters)
1166 const struct sctp_association *asoc,
1175 if (!sctp_vtag_verify(chunk, asoc))
1176 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1181 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
1193 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
1199 reply = sctp_make_heartbeat_ack(asoc, chunk, param_hdr, paylen);
1231 * (endpoint, asoc, chunk)
1234 * (asoc, reply_msg, msg_up, timers, counters)
1240 const struct sctp_association *asoc,
1251 if (!sctp_vtag_verify(chunk, asoc))
1252 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1257 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
1266 link = sctp_assoc_lookup_paddr(asoc, &from_addr);
1273 asoc,
1278 asoc,
1296 return sctp_sf_send_probe(net, ep, asoc, type, link, commands);
1389 const struct sctp_association *asoc,
1410 if (!list_has_sctp_addr(&asoc->peer.transport_addr_list,
1429 const struct sctp_association *asoc)
1431 switch (asoc->state) {
1436 new_asoc->c.my_vtag = asoc->c.my_vtag;
1437 new_asoc->c.my_ttag = asoc->c.my_vtag;
1442 new_asoc->c.my_vtag = asoc->c.my_vtag;
1443 new_asoc->c.my_ttag = asoc->c.my_vtag;
1444 new_asoc->c.peer_ttag = asoc->c.peer_vtag;
1451 new_asoc->c.my_ttag = asoc->c.my_vtag;
1452 new_asoc->c.peer_ttag = asoc->c.peer_vtag;
1460 new_asoc->rwnd = asoc->rwnd;
1461 new_asoc->c.sinit_num_ostreams = asoc->c.sinit_num_ostreams;
1462 new_asoc->c.sinit_max_instreams = asoc->c.sinit_max_instreams;
1463 new_asoc->c.initial_tsn = asoc->c.initial_tsn;
1476 const struct sctp_association *asoc)
1479 if ((asoc->c.my_vtag != new_asoc->c.my_vtag) &&
1480 (asoc->c.peer_vtag != new_asoc->c.peer_vtag) &&
1481 (asoc->c.my_vtag == new_asoc->c.my_ttag) &&
1482 (asoc->c.peer_vtag == new_asoc->c.peer_ttag))
1486 if ((asoc->c.my_vtag == new_asoc->c.my_vtag) &&
1487 ((asoc->c.peer_vtag != new_asoc->c.peer_vtag) ||
1488 (0 == asoc->c.peer_vtag))) {
1493 if ((asoc->c.my_vtag == new_asoc->c.my_vtag) &&
1494 (asoc->c.peer_vtag == new_asoc->c.peer_vtag))
1498 if ((asoc->c.my_vtag != new_asoc->c.my_vtag) &&
1499 (asoc->c.peer_vtag == new_asoc->c.peer_vtag) &&
1514 const struct sctp_association *asoc,
1536 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1540 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1546 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
1549 return sctp_sf_new_encap_port(net, ep, asoc, type, arg, commands);
1559 if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
1566 packet = sctp_abort_pkt_new(net, ep, asoc, arg,
1582 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg,
1601 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
1622 if (!sctp_state(asoc, COOKIE_WAIT)) {
1623 if (!sctp_sf_check_restart_addrs(new_asoc, asoc, chunk,
1630 sctp_tietags_populate(new_asoc, asoc);
1723 * (endpoint, asoc, chunk)
1726 * (asoc, reply_msg, msg_up, timers, counters)
1733 const struct sctp_association *asoc,
1741 return sctp_sf_do_unexpected_init(net, ep, asoc, type, arg, commands);
1778 * (endpoint, asoc, chunk)
1781 * (asoc, reply_msg, msg_up, timers, counters)
1788 const struct sctp_association *asoc,
1796 return sctp_sf_do_unexpected_init(net, ep, asoc, type, arg, commands);
1812 const struct sctp_association *asoc,
1821 return sctp_sf_ootb(net, ep, asoc, type, arg, commands);
1823 return sctp_sf_discard_chunk(net, ep, asoc, type, arg, commands);
1826 static int sctp_sf_do_assoc_update(struct sctp_association *asoc,
1830 struct net *net = asoc->base.net;
1833 if (!sctp_assoc_update(asoc, new))
1836 abort = sctp_make_abort(asoc, NULL, sizeof(struct sctp_errhdr));
1858 const struct sctp_association *asoc,
1887 if (!sctp_sf_check_restart_addrs(new_asoc, asoc, chunk, commands))
1896 if (sctp_state(asoc, SHUTDOWN_ACK_SENT)) {
1897 disposition = __sctp_sf_do_9_2_reshutack(net, ep, asoc,
1903 err = sctp_make_op_error(asoc, chunk,
1929 if (sctp_sf_do_assoc_update((struct sctp_association *)asoc, new_asoc, commands))
1932 repl = sctp_make_cookie_ack(asoc, chunk);
1937 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_RESTART, 0,
1938 asoc->c.sinit_num_ostreams,
1939 asoc->c.sinit_max_instreams,
1945 if ((sctp_state(asoc, SHUTDOWN_PENDING) ||
1946 sctp_state(asoc, SHUTDOWN_SENT)) &&
1947 (sctp_sstate(asoc->base.sk, CLOSING) ||
1948 sock_flag(asoc->base.sk, SOCK_DEAD))) {
1954 return sctp_sf_do_9_2_start_shutdown(net, ep, asoc,
1981 const struct sctp_association *asoc,
2005 if (asoc->state < SCTP_STATE_ESTABLISHED)
2010 if (sctp_sf_do_assoc_update((struct sctp_association *)asoc, new_asoc, commands))
2013 repl = sctp_make_cookie_ack(asoc, chunk);
2041 if (asoc->peer.adaptation_ind)
2044 if (!asoc->peer.auth_capable)
2065 const struct sctp_association *asoc,
2088 const struct sctp_association *asoc,
2103 if (!sctp_auth_chunk_verify(net, chunk, asoc))
2107 if (asoc->state < SCTP_STATE_ESTABLISHED) {
2123 ev = sctp_ulpevent_make_assoc_change(asoc, 0,
2125 asoc->c.sinit_num_ostreams,
2126 asoc->c.sinit_max_instreams,
2136 if (asoc->peer.adaptation_ind) {
2137 ai_ev = sctp_ulpevent_make_adaptation_indication(asoc,
2144 if (!asoc->peer.auth_capable) {
2145 auth_ev = sctp_ulpevent_make_authkey(asoc, 0,
2153 repl = sctp_make_cookie_ack(asoc, chunk);
2190 * (endpoint, asoc, chunk)
2193 * (asoc, reply_msg, msg_up, timers, counters)
2200 const struct sctp_association *asoc,
2218 if (!sctp_vtag_verify(chunk, asoc))
2219 asoc = NULL;
2220 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, commands);
2236 new_asoc = sctp_unpack_cookie(ep, asoc, chunk, GFP_ATOMIC, &error,
2254 sctp_send_stale_cookie_err(net, ep, asoc, chunk, commands,
2256 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2259 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2266 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2275 action = sctp_tietags_compare(new_asoc, asoc);
2279 retval = sctp_sf_do_dupcook_a(net, ep, asoc, chunk, commands,
2284 retval = sctp_sf_do_dupcook_b(net, ep, asoc, chunk, commands,
2289 retval = sctp_sf_do_dupcook_c(net, ep, asoc, chunk, commands,
2294 retval = sctp_sf_do_dupcook_d(net, ep, asoc, chunk, commands,
2299 retval = sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2311 SCTP_ASOC((struct sctp_association *)asoc));
2327 const struct sctp_association *asoc,
2334 if (!sctp_vtag_verify_either(chunk, asoc))
2335 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2348 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2356 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest))
2357 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2360 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2362 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands);
2373 const struct sctp_association *asoc,
2380 if (!sctp_vtag_verify_either(chunk, asoc))
2381 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2394 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2402 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest))
2403 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2406 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2416 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands);
2427 const struct sctp_association *asoc,
2435 return sctp_sf_shutdown_sent_abort(net, ep, asoc, type, arg, commands);
2445 * (endpoint, asoc, chunk)
2448 * (asoc, reply_msg, msg_up, timers, counters)
2455 const struct sctp_association *asoc,
2463 if (!sctp_vtag_verify(chunk, asoc))
2464 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2470 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
2480 return sctp_sf_do_5_2_6_stale(net, ep, asoc, type,
2489 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2510 * (endpoint, asoc, chunk)
2513 * (asoc, reply_msg, msg_up, timers, counters)
2520 const struct sctp_association *asoc,
2525 int attempts = asoc->init_err_counter + 1;
2532 if (attempts > asoc->max_init_attempts) {
2564 bp = (struct sctp_bind_addr *) &asoc->base.bind_addr;
2565 reply = sctp_make_init(asoc, bp, GFP_ATOMIC, sizeof(bht));
2587 SCTP_TRANSPORT(asoc->peer.primary_path));
2633 * (endpoint, asoc, chunk)
2636 * (asoc, reply_msg, msg_up, timers, counters)
2643 const struct sctp_association *asoc,
2650 if (!sctp_vtag_verify_either(chunk, asoc))
2651 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2664 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2672 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest))
2673 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2676 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2678 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands);
2684 const struct sctp_association *asoc,
2715 const struct sctp_association *asoc,
2724 if (!sctp_vtag_verify_either(chunk, asoc))
2725 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2738 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2745 return sctp_stop_t1_and_abort(net, commands, error, ECONNREFUSED, asoc,
2755 const struct sctp_association *asoc,
2761 ENOPROTOOPT, asoc,
2771 const struct sctp_association *asoc,
2779 return sctp_sf_cookie_wait_abort(net, ep, asoc, type, arg, commands);
2791 const struct sctp_association *asoc,
2835 * (endpoint, asoc, chunk)
2838 * (asoc, reply_msg, msg_up, timers, counters)
2845 const struct sctp_association *asoc,
2856 if (!sctp_vtag_verify(chunk, asoc))
2857 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2861 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
2870 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) {
2872 asoc->ctsn_ack_point);
2881 if (!TSN_lt(ctsn, asoc->next_tsn))
2882 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands);
2888 ev = sctp_ulpevent_make_shutdown_event(asoc, 0, GFP_ATOMIC);
2905 if (sctp_outq_is_empty(&asoc->outqueue)) {
2906 disposition = sctp_sf_do_9_2_shutdown_ack(net, ep, asoc, type,
2935 const struct sctp_association *asoc,
2944 if (!sctp_vtag_verify(chunk, asoc))
2945 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
2949 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
2955 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) {
2957 asoc->ctsn_ack_point);
2966 if (!TSN_lt(ctsn, asoc->next_tsn))
2967 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands);
2988 const struct sctp_association *asoc,
2997 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3004 reply = sctp_make_shutdown_ack(asoc, chunk);
3026 const struct sctp_association *asoc,
3033 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3036 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3039 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
3041 return __sctp_sf_do_9_2_reshutack(net, ep, asoc, type, arg, commands);
3062 * (endpoint, asoc, chunk)
3065 * (asoc, reply_msg, msg_up, timers, counters)
3071 const struct sctp_association *asoc,
3080 if (!sctp_vtag_verify(chunk, asoc))
3081 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3084 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3093 if (TSN_lte(asoc->last_ecne_tsn, lowest_tsn)) {
3118 * (endpoint, asoc, chunk)
3121 * (asoc, reply_msg, msg_up, timers, counters)
3127 const struct sctp_association *asoc,
3134 if (!sctp_vtag_verify(chunk, asoc))
3135 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3138 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3174 * (endpoint, asoc, chunk)
3177 * (asoc, reply_msg, msg_up, timers, counters)
3183 const struct sctp_association *asoc,
3192 if (!sctp_vtag_verify(chunk, asoc)) {
3195 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3198 if (!sctp_chunk_length_valid(chunk, sctp_datachk_len(&asoc->stream)))
3199 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3202 error = sctp_eat_data(asoc, chunk, commands);
3217 return sctp_sf_abort_violation(net, ep, asoc, chunk, commands,
3219 sctp_datahdr_len(&asoc->stream));
3227 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) {
3294 * (endpoint, asoc, chunk)
3297 * (asoc, reply_msg, msg_up, timers, counters)
3304 const struct sctp_association *asoc,
3312 if (!sctp_vtag_verify(chunk, asoc)) {
3315 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3318 if (!sctp_chunk_length_valid(chunk, sctp_datachk_len(&asoc->stream)))
3319 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3322 error = sctp_eat_data(asoc, chunk, commands);
3333 return sctp_sf_abort_violation(net, ep, asoc, chunk, commands,
3335 sctp_datahdr_len(&asoc->stream));
3386 * (endpoint, asoc, chunk)
3389 * (asoc, reply_msg, msg_up, timers, counters)
3395 const struct sctp_association *asoc,
3404 if (!sctp_vtag_verify(chunk, asoc))
3405 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3409 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3416 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3424 if (TSN_lte(asoc->next_tsn, ctsn))
3425 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands);
3427 trace_sctp_probe(ep, asoc, chunk);
3435 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) {
3437 asoc->ctsn_ack_point);
3472 const struct sctp_association *asoc,
3481 packet = sctp_ootb_pkt_new(net, asoc, chunk);
3485 /* Make an ABORT. The T bit will be set if the asoc
3488 abort = sctp_make_abort(asoc, chunk, 0);
3507 sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3519 const struct sctp_association *asoc,
3528 packet = sctp_ootb_pkt_new(net, asoc, chunk);
3532 abort = sctp_make_new_encap_port(asoc, chunk);
3547 sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3561 const struct sctp_association *asoc,
3569 if (!sctp_vtag_verify(chunk, asoc))
3570 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3574 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3578 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
3599 const struct sctp_association *asoc,
3608 if (!sctp_vtag_verify(chunk, asoc))
3609 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3613 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3620 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_SHUTDOWN_COMP,
3626 reply = sctp_make_shutdown_complete(asoc, chunk);
3682 const struct sctp_association *asoc,
3696 if (asoc && !sctp_vtag_verify(chunk, asoc))
3697 asoc = NULL;
3703 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3709 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3724 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3747 return sctp_sf_shut_8_4_5(net, ep, asoc, type, arg, commands);
3749 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3751 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands);
3768 * (endpoint, asoc, type, arg, commands)
3778 const struct sctp_association *asoc,
3787 packet = sctp_ootb_pkt_new(net, asoc, chunk);
3792 * The T bit will be set if the asoc is NULL.
3794 shut = sctp_make_shutdown_complete(asoc, chunk);
3818 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3834 const struct sctp_association *asoc,
3841 if (!sctp_vtag_verify(chunk, asoc))
3842 asoc = NULL;
3846 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3862 const struct sctp_association *asoc,
3873 if (!sctp_vtag_verify(chunk, asoc)) {
3876 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3881 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3890 if (!asoc->peer.asconf_capable ||
3892 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
3898 if (!sctp_verify_asconf(asoc, chunk, true, &err_param))
3899 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
3906 if (serial == asoc->peer.addip_serial + 1) {
3911 sctp_assoc_clean_asconf_ack_cache(asoc);
3922 asoc, chunk);
3925 } else if (serial < asoc->peer.addip_serial + 1) {
3938 asconf_ack = sctp_assoc_lookup_asconf_ack(asoc, hdr->serial);
3965 if (asoc->new_transport) {
3966 sctp_sf_heartbeat(ep, asoc, type, asoc->new_transport, commands);
3967 ((struct sctp_association *)asoc)->new_transport = NULL;
3976 struct sctp_association *asoc,
3983 if (list_empty(&asoc->addip_chunk_list))
3986 entry = asoc->addip_chunk_list.next;
3991 asoc->addip_last_asconf = asconf;
3993 return sctp_sf_do_prm_asconf(net, ep, asoc, type, asconf, commands);
4003 const struct sctp_association *asoc,
4008 struct sctp_chunk *last_asconf = asoc->addip_last_asconf;
4015 if (!sctp_vtag_verify(asconf_ack, asoc)) {
4018 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4024 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4033 if (!asoc->peer.asconf_capable ||
4035 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4041 if (!sctp_verify_asconf(asoc, asconf_ack, false, &err_param))
4042 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
4049 sent_serial = asoc->addip_serial - 1;
4059 !(asoc->addip_last_asconf)) {
4060 abort = sctp_make_abort(asoc, asconf_ack,
4082 if ((rcvd_serial == sent_serial) && asoc->addip_last_asconf) {
4086 if (!sctp_process_asconf_ack((struct sctp_association *)asoc,
4089 (struct sctp_association *)asoc,
4092 abort = sctp_make_abort(asoc, asconf_ack,
4118 const struct sctp_association *asoc,
4128 if (!sctp_vtag_verify(chunk, asoc)) {
4131 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4136 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4139 if (!sctp_verify_reconf(asoc, chunk, &err_param))
4140 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg,
4150 (struct sctp_association *)asoc, param, &ev);
4153 (struct sctp_association *)asoc, param, &ev);
4156 (struct sctp_association *)asoc, param, &ev);
4159 (struct sctp_association *)asoc, param, &ev);
4162 (struct sctp_association *)asoc, param, &ev);
4165 (struct sctp_association *)asoc, param, &ev);
4195 const struct sctp_association *asoc,
4205 if (!sctp_vtag_verify(chunk, asoc)) {
4208 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4211 if (!asoc->peer.prsctp_capable)
4212 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands);
4215 if (!sctp_chunk_length_valid(chunk, sctp_ftsnchk_len(&asoc->stream)))
4216 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4231 if (sctp_tsnmap_check(&asoc->peer.tsn_map, tsn) < 0)
4234 if (!asoc->stream.si->validate_ftsn(chunk))
4238 if (len > sctp_ftsnhdr_len(&asoc->stream))
4243 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) {
4262 const struct sctp_association *asoc,
4272 if (!sctp_vtag_verify(chunk, asoc)) {
4275 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4278 if (!asoc->peer.prsctp_capable)
4279 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands);
4282 if (!sctp_chunk_length_valid(chunk, sctp_ftsnchk_len(&asoc->stream)))
4283 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4298 if (sctp_tsnmap_check(&asoc->peer.tsn_map, tsn) < 0)
4301 if (!asoc->stream.si->validate_ftsn(chunk))
4305 if (len > sctp_ftsnhdr_len(&asoc->stream))
4348 const struct sctp_association *asoc,
4366 if (!sctp_auth_asoc_verify_hmac_id(asoc, auth_hdr->hmac_id))
4373 if (key_id != asoc->active_key_id) {
4374 sh_key = sctp_auth_get_shkey(asoc, key_id);
4404 sctp_auth_calculate_hmac(asoc, chunk->skb,
4424 const struct sctp_association *asoc,
4434 if (!asoc->peer.auth_capable)
4435 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands);
4437 if (!sctp_vtag_verify(chunk, asoc)) {
4440 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4445 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4449 error = sctp_sf_authenticate(asoc, chunk);
4455 err_chunk = sctp_make_op_error(asoc, chunk,
4466 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4469 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4479 if (asoc->active_key_id != ntohs(auth_hdr->shkey_id)) {
4482 ev = sctp_ulpevent_make_authkey(asoc, ntohs(auth_hdr->shkey_id),
4520 const struct sctp_association *asoc,
4531 if (!sctp_vtag_verify(unk_chunk, asoc))
4532 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4539 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4545 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4549 err_chunk = sctp_make_op_error(asoc, unk_chunk,
4559 sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4567 err_chunk = sctp_make_op_error(asoc, unk_chunk,
4591 * (endpoint, asoc, chunk)
4594 * (asoc, reply_msg, msg_up, timers, counters)
4600 const struct sctp_association *asoc,
4607 if (asoc && !sctp_vtag_verify(chunk, asoc))
4608 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4615 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4634 * (endpoint, asoc, chunk)
4637 * (asoc, reply_msg, msg_up, timers, counters)
4643 const struct sctp_association *asoc,
4660 * (endpoint, asoc, chunk)
4663 * (asoc, reply_msg, msg_up, timers, counters)
4670 const struct sctp_association *asoc,
4677 if (!sctp_vtag_verify(chunk, asoc))
4678 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
4682 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4694 const struct sctp_association *asoc,
4715 if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc))
4719 abort = sctp_make_abort_violation(asoc, chunk, payload, paylen);
4723 if (asoc) {
4726 !asoc->peer.i.init_tag) {
4744 if (asoc->state <= SCTP_STATE_COOKIE_ECHOED) {
4759 packet = sctp_ootb_pkt_new(net, asoc, chunk);
4780 sctp_sf_pdiscard(net, ep, asoc, SCTP_ST_CHUNK(0), arg, commands);
4801 * (endpoint, asoc, chunk)
4811 const struct sctp_association *asoc,
4818 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str,
4831 const struct sctp_association *asoc,
4840 if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc))
4844 abort = sctp_make_violation_paramlen(asoc, chunk, param);
4859 sctp_sf_pdiscard(net, ep, asoc, SCTP_ST_CHUNK(0), arg, commands);
4874 const struct sctp_association *asoc,
4881 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str,
4894 const struct sctp_association *asoc,
4901 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str,
4950 * [This is the argument asoc.]
4954 * [This is asoc->peer.active_path.]
4966 const struct sctp_association *asoc,
4989 repl = sctp_make_init(asoc, &asoc->base.bind_addr, GFP_ATOMIC, 0);
5000 my_asoc = (struct sctp_association *)asoc;
5078 const struct sctp_association *asoc,
5118 const struct sctp_association *asoc,
5137 if (sctp_outq_is_empty(&asoc->outqueue)) {
5138 disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type,
5175 const struct sctp_association *asoc,
5212 const struct sctp_association *asoc,
5227 const struct sctp_association *asoc,
5243 * (endpoint, asoc)
5254 const struct sctp_association *asoc,
5278 * (endpoint, asoc)
5289 const struct sctp_association *asoc,
5297 return sctp_sf_cookie_wait_prm_shutdown(net, ep, asoc, type, arg, commands);
5306 * (endpoint, asoc)
5317 const struct sctp_association *asoc,
5355 * (endpoint, asoc)
5366 const struct sctp_association *asoc,
5374 return sctp_sf_cookie_wait_prm_abort(net, ep, asoc, type, arg, commands);
5381 * (endpoint, asoc)
5392 const struct sctp_association *asoc,
5401 return sctp_sf_do_9_1_prm_abort(net, ep, asoc, type, arg, commands);
5408 * (endpoint, asoc)
5419 const struct sctp_association *asoc,
5432 return sctp_sf_do_9_1_prm_abort(net, ep, asoc, type, arg, commands);
5439 * (endpoint, asoc)
5450 const struct sctp_association *asoc,
5458 return sctp_sf_shutdown_sent_prm_abort(net, ep, asoc, type, arg, commands);
5486 const struct sctp_association *asoc,
5491 if (SCTP_DISPOSITION_NOMEM == sctp_sf_heartbeat(ep, asoc, type,
5518 const struct sctp_association *asoc,
5535 const struct sctp_association *asoc,
5554 const struct sctp_association *asoc,
5578 const struct sctp_association *asoc,
5585 event = sctp_ulpevent_make_sender_dry_event(asoc, GFP_ATOMIC);
5610 const struct sctp_association *asoc,
5622 reply = sctp_make_shutdown(asoc, arg);
5642 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE])
5680 const struct sctp_association *asoc,
5696 if (!sctp_vtag_verify(chunk, asoc))
5697 return sctp_sf_pdiscard(net, ep, asoc, type, arg,
5703 return sctp_sf_violation_chunklen(net, ep, asoc, type,
5710 reply = sctp_make_shutdown_ack(asoc, chunk);
5723 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE])
5753 const struct sctp_association *asoc,
5781 const struct sctp_association *asoc,
5790 if (asoc->overall_error_count >= asoc->max_retrans) {
5791 if (asoc->peer.zero_window_announced &&
5792 asoc->state == SCTP_STATE_SHUTDOWN_PENDING) {
5869 const struct sctp_association *asoc,
5885 * (endpoint, asoc)
5901 const struct sctp_association *asoc,
5906 int attempts = asoc->init_err_counter + 1;
5914 if (attempts <= asoc->max_init_attempts) {
5915 bp = (struct sctp_bind_addr *) &asoc->base.bind_addr;
5916 repl = sctp_make_init(asoc, bp, GFP_ATOMIC, 0);
5932 asoc->max_init_attempts);
5950 * (endpoint, asoc)
5966 const struct sctp_association *asoc,
5971 int attempts = asoc->init_err_counter + 1;
5978 if (attempts <= asoc->max_init_attempts) {
5979 repl = sctp_make_cookie_echo(asoc, NULL);
6017 const struct sctp_association *asoc,
6028 ((struct sctp_association *)asoc)->shutdown_retries++;
6030 if (asoc->overall_error_count >= asoc->max_retrans) {
6041 switch (asoc->state) {
6043 reply = sctp_make_shutdown(asoc, NULL);
6047 reply = sctp_make_shutdown_ack(asoc, NULL);
6062 if (asoc->shutdown_last_sent_to)
6064 SCTP_TRANSPORT(asoc->shutdown_last_sent_to));
6088 const struct sctp_association *asoc,
6093 struct sctp_chunk *chunk = asoc->addip_last_asconf;
6114 if (asoc->overall_error_count >= asoc->max_retrans) {
6137 sctp_chunk_hold(asoc->addip_last_asconf);
6139 SCTP_CHUNK(asoc->addip_last_asconf));
6160 const struct sctp_association *asoc,
6171 reply = sctp_make_abort(asoc, NULL, 0);
6197 const struct sctp_association *asoc,
6218 if (sctp_outq_is_empty(&asoc->outqueue)) {
6219 disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type,
6234 * (endpoint, asoc, chunk)
6240 const struct sctp_association *asoc,
6251 * (endpoint, asoc, chunk)
6257 const struct sctp_association *asoc,
6271 * (endpoint, asoc, chunk)
6277 const struct sctp_association *asoc,
6322 const struct sctp_association *asoc,
6329 packet = sctp_ootb_pkt_new(net, asoc, chunk);
6333 * The T bit will be set if the asoc is NULL.
6335 abort = sctp_make_abort(asoc, chunk, paylen);
6363 const struct sctp_association *asoc,
6378 if (asoc) {
6393 vtag = asoc->peer.i.init_tag;
6447 const struct sctp_association *asoc,
6455 packet = sctp_ootb_pkt_new(net, asoc, chunk);
6476 static int sctp_eat_data(const struct sctp_association *asoc,
6480 struct sctp_tsnmap *map = (struct sctp_tsnmap *)&asoc->peer.tsn_map;
6481 struct sock *sk = asoc->base.sk;
6492 skb_pull(chunk->skb, sctp_datahdr_len(&asoc->stream));
6509 if (asoc->peer.ecn_capable && !chunk->ecn_ce_done) {
6520 tmp = sctp_tsnmap_check(&asoc->peer.tsn_map, tsn);
6525 if (chunk->asoc)
6526 chunk->asoc->stats.outofseqtsns++;
6540 datalen -= sctp_datachk_len(&asoc->stream);
6545 if ((datalen >= asoc->rwnd) && (!asoc->ulpq.pd_mode)) {
6558 if ((!chunk->data_accepted) && (!asoc->rwnd || asoc->rwnd_over ||
6559 (datalen > asoc->rwnd + asoc->frag_point))) {
6573 __func__, tsn, datalen, asoc->rwnd);
6604 err = sctp_make_abort_no_data(asoc, chunk, tsn);
6629 if (chunk->asoc)
6630 chunk->asoc->stats.iuodchunks++;
6633 if (chunk->asoc)
6634 chunk->asoc->stats.iodchunks++;
6645 if (ntohs(data_hdr->stream) >= asoc->stream.incnt) {
6649 err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM,
6666 if (!asoc->stream.si->validate_data(chunk))