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