• Home
  • Raw
  • Download

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()
2268 action = sctp_tietags_compare(new_asoc, asoc); in sctp_sf_do_5_2_4_dupcook()
2278 if (security_sctp_assoc_request((struct sctp_association *)asoc, in sctp_sf_do_5_2_4_dupcook()
2281 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_2_4_dupcook()
2288 retval = sctp_sf_do_dupcook_a(net, ep, asoc, chunk, commands, in sctp_sf_do_5_2_4_dupcook()
2293 retval = sctp_sf_do_dupcook_b(net, ep, asoc, chunk, commands, in sctp_sf_do_5_2_4_dupcook()
2298 retval = sctp_sf_do_dupcook_c(net, ep, asoc, chunk, commands, in sctp_sf_do_5_2_4_dupcook()
2303 retval = sctp_sf_do_dupcook_d(net, ep, asoc, chunk, commands, in sctp_sf_do_5_2_4_dupcook()
2308 retval = sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_2_4_dupcook()
2320 SCTP_ASOC((struct sctp_association *)asoc)); in sctp_sf_do_5_2_4_dupcook()
2336 const struct sctp_association *asoc, in sctp_sf_shutdown_pending_abort() argument
2343 if (!sctp_vtag_verify_either(chunk, asoc)) in sctp_sf_shutdown_pending_abort()
2344 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_pending_abort()
2357 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_pending_abort()
2365 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest)) in sctp_sf_shutdown_pending_abort()
2366 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_pending_abort()
2369 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_pending_abort()
2371 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_pending_abort()
2382 const struct sctp_association *asoc, in sctp_sf_shutdown_sent_abort() argument
2389 if (!sctp_vtag_verify_either(chunk, asoc)) in sctp_sf_shutdown_sent_abort()
2390 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_sent_abort()
2403 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_sent_abort()
2411 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest)) in sctp_sf_shutdown_sent_abort()
2412 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_sent_abort()
2415 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_sent_abort()
2425 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_sent_abort()
2436 const struct sctp_association *asoc, in sctp_sf_shutdown_ack_sent_abort() argument
2444 return sctp_sf_shutdown_sent_abort(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_ack_sent_abort()
2454 * (endpoint, asoc, chunk)
2457 * (asoc, reply_msg, msg_up, timers, counters)
2464 const struct sctp_association *asoc, in sctp_sf_cookie_echoed_err() argument
2472 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_cookie_echoed_err()
2473 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_cookie_echoed_err()
2479 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_cookie_echoed_err()
2489 return sctp_sf_do_5_2_6_stale(net, ep, asoc, type, in sctp_sf_cookie_echoed_err()
2498 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_cookie_echoed_err()
2519 * (endpoint, asoc, chunk)
2522 * (asoc, reply_msg, msg_up, timers, counters)
2529 const struct sctp_association *asoc, in sctp_sf_do_5_2_6_stale() argument
2534 int attempts = asoc->init_err_counter + 1; in sctp_sf_do_5_2_6_stale()
2541 if (attempts > asoc->max_init_attempts) { in sctp_sf_do_5_2_6_stale()
2573 bp = (struct sctp_bind_addr *) &asoc->base.bind_addr; in sctp_sf_do_5_2_6_stale()
2574 reply = sctp_make_init(asoc, bp, GFP_ATOMIC, sizeof(bht)); in sctp_sf_do_5_2_6_stale()
2596 SCTP_TRANSPORT(asoc->peer.primary_path)); in sctp_sf_do_5_2_6_stale()
2642 * (endpoint, asoc, chunk)
2645 * (asoc, reply_msg, msg_up, timers, counters)
2652 const struct sctp_association *asoc, in sctp_sf_do_9_1_abort() argument
2659 if (!sctp_vtag_verify_either(chunk, asoc)) in sctp_sf_do_9_1_abort()
2660 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_1_abort()
2673 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_1_abort()
2681 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest)) in sctp_sf_do_9_1_abort()
2682 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_1_abort()
2685 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_1_abort()
2687 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_1_abort()
2693 const struct sctp_association *asoc, in __sctp_sf_do_9_1_abort() argument
2724 const struct sctp_association *asoc, in sctp_sf_cookie_wait_abort() argument
2733 if (!sctp_vtag_verify_either(chunk, asoc)) in sctp_sf_cookie_wait_abort()
2734 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_cookie_wait_abort()
2747 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_cookie_wait_abort()
2754 return sctp_stop_t1_and_abort(net, commands, error, ECONNREFUSED, asoc, in sctp_sf_cookie_wait_abort()
2764 const struct sctp_association *asoc, in sctp_sf_cookie_wait_icmp_abort() argument
2770 ENOPROTOOPT, asoc, in sctp_sf_cookie_wait_icmp_abort()
2780 const struct sctp_association *asoc, in sctp_sf_cookie_echoed_abort() argument
2788 return sctp_sf_cookie_wait_abort(net, ep, asoc, type, arg, commands); in sctp_sf_cookie_echoed_abort()
2800 const struct sctp_association *asoc, in sctp_stop_t1_and_abort() argument
2844 * (endpoint, asoc, chunk)
2847 * (asoc, reply_msg, msg_up, timers, counters)
2854 const struct sctp_association *asoc, in sctp_sf_do_9_2_shutdown() argument
2865 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_9_2_shutdown()
2866 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_shutdown()
2870 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_9_2_shutdown()
2879 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) { in sctp_sf_do_9_2_shutdown()
2881 asoc->ctsn_ack_point); in sctp_sf_do_9_2_shutdown()
2890 if (!TSN_lt(ctsn, asoc->next_tsn)) in sctp_sf_do_9_2_shutdown()
2891 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_shutdown()
2897 ev = sctp_ulpevent_make_shutdown_event(asoc, 0, GFP_ATOMIC); in sctp_sf_do_9_2_shutdown()
2914 if (sctp_outq_is_empty(&asoc->outqueue)) { in sctp_sf_do_9_2_shutdown()
2915 disposition = sctp_sf_do_9_2_shutdown_ack(net, ep, asoc, type, in sctp_sf_do_9_2_shutdown()
2944 const struct sctp_association *asoc, in sctp_sf_do_9_2_shut_ctsn() argument
2953 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_9_2_shut_ctsn()
2954 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_shut_ctsn()
2958 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_9_2_shut_ctsn()
2964 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) { in sctp_sf_do_9_2_shut_ctsn()
2966 asoc->ctsn_ack_point); in sctp_sf_do_9_2_shut_ctsn()
2975 if (!TSN_lt(ctsn, asoc->next_tsn)) in sctp_sf_do_9_2_shut_ctsn()
2976 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_shut_ctsn()
2997 const struct sctp_association *asoc, in __sctp_sf_do_9_2_reshutack() argument
3006 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in __sctp_sf_do_9_2_reshutack()
3013 reply = sctp_make_shutdown_ack(asoc, chunk); in __sctp_sf_do_9_2_reshutack()
3035 const struct sctp_association *asoc, in sctp_sf_do_9_2_reshutack() argument
3042 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_reshutack()
3045 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_reshutack()
3048 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_reshutack()
3050 return __sctp_sf_do_9_2_reshutack(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_reshutack()
3071 * (endpoint, asoc, chunk)
3074 * (asoc, reply_msg, msg_up, timers, counters)
3080 const struct sctp_association *asoc, in sctp_sf_do_ecn_cwr() argument
3089 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_ecn_cwr()
3090 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_ecn_cwr()
3093 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_ecn_cwr()
3102 if (TSN_lte(asoc->last_ecne_tsn, lowest_tsn)) { in sctp_sf_do_ecn_cwr()
3127 * (endpoint, asoc, chunk)
3130 * (asoc, reply_msg, msg_up, timers, counters)
3136 const struct sctp_association *asoc, in sctp_sf_do_ecne() argument
3143 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_ecne()
3144 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_ecne()
3147 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_ecne()
3183 * (endpoint, asoc, chunk)
3186 * (asoc, reply_msg, msg_up, timers, counters)
3192 const struct sctp_association *asoc, in sctp_sf_eat_data_6_2() argument
3201 if (!sctp_vtag_verify(chunk, asoc)) { in sctp_sf_eat_data_6_2()
3204 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_data_6_2()
3207 if (!sctp_chunk_length_valid(chunk, sctp_datachk_len(&asoc->stream))) in sctp_sf_eat_data_6_2()
3208 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_eat_data_6_2()
3211 error = sctp_eat_data(asoc, chunk, commands); in sctp_sf_eat_data_6_2()
3226 return sctp_sf_abort_violation(net, ep, asoc, chunk, commands, in sctp_sf_eat_data_6_2()
3228 sctp_datahdr_len(&asoc->stream)); in sctp_sf_eat_data_6_2()
3236 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) { in sctp_sf_eat_data_6_2()
3303 * (endpoint, asoc, chunk)
3306 * (asoc, reply_msg, msg_up, timers, counters)
3313 const struct sctp_association *asoc, in sctp_sf_eat_data_fast_4_4() argument
3321 if (!sctp_vtag_verify(chunk, asoc)) { in sctp_sf_eat_data_fast_4_4()
3324 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_data_fast_4_4()
3327 if (!sctp_chunk_length_valid(chunk, sctp_datachk_len(&asoc->stream))) in sctp_sf_eat_data_fast_4_4()
3328 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_eat_data_fast_4_4()
3331 error = sctp_eat_data(asoc, chunk, commands); in sctp_sf_eat_data_fast_4_4()
3342 return sctp_sf_abort_violation(net, ep, asoc, chunk, commands, in sctp_sf_eat_data_fast_4_4()
3344 sctp_datahdr_len(&asoc->stream)); in sctp_sf_eat_data_fast_4_4()
3395 * (endpoint, asoc, chunk)
3398 * (asoc, reply_msg, msg_up, timers, counters)
3404 const struct sctp_association *asoc, in sctp_sf_eat_sack_6_2() argument
3413 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_eat_sack_6_2()
3414 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_sack_6_2()
3418 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_eat_sack_6_2()
3425 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_sack_6_2()
3433 if (TSN_lte(asoc->next_tsn, ctsn)) in sctp_sf_eat_sack_6_2()
3434 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands); in sctp_sf_eat_sack_6_2()
3436 trace_sctp_probe(ep, asoc, chunk); in sctp_sf_eat_sack_6_2()
3444 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) { in sctp_sf_eat_sack_6_2()
3446 asoc->ctsn_ack_point); in sctp_sf_eat_sack_6_2()
3481 const struct sctp_association *asoc, in sctp_sf_tabort_8_4_8() argument
3490 packet = sctp_ootb_pkt_new(net, asoc, chunk); in sctp_sf_tabort_8_4_8()
3494 /* Make an ABORT. The T bit will be set if the asoc in sctp_sf_tabort_8_4_8()
3497 abort = sctp_make_abort(asoc, chunk, 0); in sctp_sf_tabort_8_4_8()
3516 sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_tabort_8_4_8()
3528 const struct sctp_association *asoc, in sctp_sf_new_encap_port() argument
3537 packet = sctp_ootb_pkt_new(net, asoc, chunk); in sctp_sf_new_encap_port()
3541 abort = sctp_make_new_encap_port(asoc, chunk); in sctp_sf_new_encap_port()
3556 sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_new_encap_port()
3570 const struct sctp_association *asoc, in sctp_sf_operr_notify() argument
3578 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_operr_notify()
3579 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_operr_notify()
3583 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_operr_notify()
3587 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg, in sctp_sf_operr_notify()
3608 const struct sctp_association *asoc, in sctp_sf_do_9_2_final() argument
3617 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_9_2_final()
3618 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_final()
3622 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_9_2_final()
3629 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_SHUTDOWN_COMP, in sctp_sf_do_9_2_final()
3635 reply = sctp_make_shutdown_complete(asoc, chunk); in sctp_sf_do_9_2_final()
3691 const struct sctp_association *asoc, in sctp_sf_ootb() argument
3705 if (asoc && !sctp_vtag_verify(chunk, asoc)) in sctp_sf_ootb()
3706 asoc = NULL; in sctp_sf_ootb()
3712 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_ootb()
3718 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_ootb()
3733 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_ootb()
3756 return sctp_sf_shut_8_4_5(net, ep, asoc, type, arg, commands); in sctp_sf_ootb()
3758 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_ootb()
3760 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands); in sctp_sf_ootb()
3777 * (endpoint, asoc, type, arg, commands)
3787 const struct sctp_association *asoc, in sctp_sf_shut_8_4_5() argument
3796 packet = sctp_ootb_pkt_new(net, asoc, chunk); in sctp_sf_shut_8_4_5()
3801 * The T bit will be set if the asoc is NULL. in sctp_sf_shut_8_4_5()
3803 shut = sctp_make_shutdown_complete(asoc, chunk); in sctp_sf_shut_8_4_5()
3827 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shut_8_4_5()
3843 const struct sctp_association *asoc, in sctp_sf_do_8_5_1_E_sa() argument
3850 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_8_5_1_E_sa()
3851 asoc = NULL; in sctp_sf_do_8_5_1_E_sa()
3855 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_8_5_1_E_sa()
3871 const struct sctp_association *asoc, in sctp_sf_do_asconf() argument
3882 if (!sctp_vtag_verify(chunk, asoc)) { in sctp_sf_do_asconf()
3885 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_asconf()
3890 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_asconf()
3899 if (!asoc->peer.asconf_capable || in sctp_sf_do_asconf()
3901 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_asconf()
3907 if (!sctp_verify_asconf(asoc, chunk, true, &err_param)) in sctp_sf_do_asconf()
3908 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg, in sctp_sf_do_asconf()
3915 if (serial == asoc->peer.addip_serial + 1) { in sctp_sf_do_asconf()
3920 sctp_assoc_clean_asconf_ack_cache(asoc); in sctp_sf_do_asconf()
3931 asoc, chunk); in sctp_sf_do_asconf()
3934 } else if (serial < asoc->peer.addip_serial + 1) { in sctp_sf_do_asconf()
3947 asconf_ack = sctp_assoc_lookup_asconf_ack(asoc, hdr->serial); in sctp_sf_do_asconf()
3974 if (asoc->new_transport) { in sctp_sf_do_asconf()
3975 sctp_sf_heartbeat(ep, asoc, type, asoc->new_transport, commands); in sctp_sf_do_asconf()
3976 ((struct sctp_association *)asoc)->new_transport = NULL; in sctp_sf_do_asconf()
3985 struct sctp_association *asoc, in sctp_send_next_asconf() argument
3992 if (list_empty(&asoc->addip_chunk_list)) in sctp_send_next_asconf()
3995 entry = asoc->addip_chunk_list.next; in sctp_send_next_asconf()
4000 asoc->addip_last_asconf = asconf; in sctp_send_next_asconf()
4002 return sctp_sf_do_prm_asconf(net, ep, asoc, type, asconf, commands); in sctp_send_next_asconf()
4012 const struct sctp_association *asoc, in sctp_sf_do_asconf_ack() argument
4017 struct sctp_chunk *last_asconf = asoc->addip_last_asconf; in sctp_sf_do_asconf_ack()
4024 if (!sctp_vtag_verify(asconf_ack, asoc)) { in sctp_sf_do_asconf_ack()
4027 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_asconf_ack()
4033 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_asconf_ack()
4042 if (!asoc->peer.asconf_capable || in sctp_sf_do_asconf_ack()
4044 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_asconf_ack()
4050 if (!sctp_verify_asconf(asoc, asconf_ack, false, &err_param)) in sctp_sf_do_asconf_ack()
4051 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg, in sctp_sf_do_asconf_ack()
4058 sent_serial = asoc->addip_serial - 1; in sctp_sf_do_asconf_ack()
4068 !(asoc->addip_last_asconf)) { in sctp_sf_do_asconf_ack()
4069 abort = sctp_make_abort(asoc, asconf_ack, in sctp_sf_do_asconf_ack()
4091 if ((rcvd_serial == sent_serial) && asoc->addip_last_asconf) { in sctp_sf_do_asconf_ack()
4095 if (!sctp_process_asconf_ack((struct sctp_association *)asoc, in sctp_sf_do_asconf_ack()
4098 (struct sctp_association *)asoc, in sctp_sf_do_asconf_ack()
4101 abort = sctp_make_abort(asoc, asconf_ack, in sctp_sf_do_asconf_ack()
4127 const struct sctp_association *asoc, in sctp_sf_do_reconf() argument
4137 if (!sctp_vtag_verify(chunk, asoc)) { in sctp_sf_do_reconf()
4140 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_reconf()
4145 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_reconf()
4148 if (!sctp_verify_reconf(asoc, chunk, &err_param)) in sctp_sf_do_reconf()
4149 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg, in sctp_sf_do_reconf()
4159 (struct sctp_association *)asoc, param, &ev); in sctp_sf_do_reconf()
4162 (struct sctp_association *)asoc, param, &ev); in sctp_sf_do_reconf()
4165 (struct sctp_association *)asoc, param, &ev); in sctp_sf_do_reconf()
4168 (struct sctp_association *)asoc, param, &ev); in sctp_sf_do_reconf()
4171 (struct sctp_association *)asoc, param, &ev); in sctp_sf_do_reconf()
4174 (struct sctp_association *)asoc, param, &ev); in sctp_sf_do_reconf()
4204 const struct sctp_association *asoc, in sctp_sf_eat_fwd_tsn() argument
4214 if (!sctp_vtag_verify(chunk, asoc)) { in sctp_sf_eat_fwd_tsn()
4217 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_fwd_tsn()
4220 if (!asoc->peer.prsctp_capable) in sctp_sf_eat_fwd_tsn()
4221 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands); in sctp_sf_eat_fwd_tsn()
4224 if (!sctp_chunk_length_valid(chunk, sctp_ftsnchk_len(&asoc->stream))) in sctp_sf_eat_fwd_tsn()
4225 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_eat_fwd_tsn()
4240 if (sctp_tsnmap_check(&asoc->peer.tsn_map, tsn) < 0) in sctp_sf_eat_fwd_tsn()
4243 if (!asoc->stream.si->validate_ftsn(chunk)) in sctp_sf_eat_fwd_tsn()
4247 if (len > sctp_ftsnhdr_len(&asoc->stream)) in sctp_sf_eat_fwd_tsn()
4252 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) { in sctp_sf_eat_fwd_tsn()
4271 const struct sctp_association *asoc, in sctp_sf_eat_fwd_tsn_fast() argument
4281 if (!sctp_vtag_verify(chunk, asoc)) { in sctp_sf_eat_fwd_tsn_fast()
4284 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_fwd_tsn_fast()
4287 if (!asoc->peer.prsctp_capable) in sctp_sf_eat_fwd_tsn_fast()
4288 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands); in sctp_sf_eat_fwd_tsn_fast()
4291 if (!sctp_chunk_length_valid(chunk, sctp_ftsnchk_len(&asoc->stream))) in sctp_sf_eat_fwd_tsn_fast()
4292 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_eat_fwd_tsn_fast()
4307 if (sctp_tsnmap_check(&asoc->peer.tsn_map, tsn) < 0) in sctp_sf_eat_fwd_tsn_fast()
4310 if (!asoc->stream.si->validate_ftsn(chunk)) in sctp_sf_eat_fwd_tsn_fast()
4314 if (len > sctp_ftsnhdr_len(&asoc->stream)) in sctp_sf_eat_fwd_tsn_fast()
4357 const struct sctp_association *asoc, in sctp_sf_authenticate() argument
4375 if (!sctp_auth_asoc_verify_hmac_id(asoc, auth_hdr->hmac_id)) in sctp_sf_authenticate()
4382 if (key_id != asoc->active_key_id) { in sctp_sf_authenticate()
4383 sh_key = sctp_auth_get_shkey(asoc, key_id); in sctp_sf_authenticate()
4413 sctp_auth_calculate_hmac(asoc, chunk->skb, in sctp_sf_authenticate()
4433 const struct sctp_association *asoc, in sctp_sf_eat_auth() argument
4443 if (!asoc->peer.auth_capable) in sctp_sf_eat_auth()
4444 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands); in sctp_sf_eat_auth()
4446 if (!sctp_vtag_verify(chunk, asoc)) { in sctp_sf_eat_auth()
4449 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_auth()
4454 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_eat_auth()
4458 error = sctp_sf_authenticate(asoc, chunk); in sctp_sf_eat_auth()
4464 err_chunk = sctp_make_op_error(asoc, chunk, in sctp_sf_eat_auth()
4475 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_auth()
4478 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_eat_auth()
4488 if (asoc->active_key_id != ntohs(auth_hdr->shkey_id)) { in sctp_sf_eat_auth()
4491 ev = sctp_ulpevent_make_authkey(asoc, ntohs(auth_hdr->shkey_id), in sctp_sf_eat_auth()
4529 const struct sctp_association *asoc, in sctp_sf_unk_chunk() argument
4540 if (!sctp_vtag_verify(unk_chunk, asoc)) in sctp_sf_unk_chunk()
4541 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_unk_chunk()
4548 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_unk_chunk()
4554 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_unk_chunk()
4558 err_chunk = sctp_make_op_error(asoc, unk_chunk, in sctp_sf_unk_chunk()
4568 sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_unk_chunk()
4576 err_chunk = sctp_make_op_error(asoc, unk_chunk, in sctp_sf_unk_chunk()
4600 * (endpoint, asoc, chunk)
4603 * (asoc, reply_msg, msg_up, timers, counters)
4609 const struct sctp_association *asoc, in sctp_sf_discard_chunk() argument
4616 if (asoc && !sctp_vtag_verify(chunk, asoc)) in sctp_sf_discard_chunk()
4617 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_discard_chunk()
4624 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_discard_chunk()
4643 * (endpoint, asoc, chunk)
4646 * (asoc, reply_msg, msg_up, timers, counters)
4652 const struct sctp_association *asoc, in sctp_sf_pdiscard() argument
4669 * (endpoint, asoc, chunk)
4672 * (asoc, reply_msg, msg_up, timers, counters)
4679 const struct sctp_association *asoc, in sctp_sf_violation() argument
4686 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_violation()
4687 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_violation()
4691 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_violation()
4703 const struct sctp_association *asoc, in sctp_sf_abort_violation() argument
4724 if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc)) in sctp_sf_abort_violation()
4728 abort = sctp_make_abort_violation(asoc, chunk, payload, paylen); in sctp_sf_abort_violation()
4732 if (asoc) { in sctp_sf_abort_violation()
4735 !asoc->peer.i.init_tag) { in sctp_sf_abort_violation()
4753 if (asoc->state <= SCTP_STATE_COOKIE_ECHOED) { in sctp_sf_abort_violation()
4768 packet = sctp_ootb_pkt_new(net, asoc, chunk); in sctp_sf_abort_violation()
4789 sctp_sf_pdiscard(net, ep, asoc, SCTP_ST_CHUNK(0), arg, commands); in sctp_sf_abort_violation()
4810 * (endpoint, asoc, chunk)
4820 const struct sctp_association *asoc, in sctp_sf_violation_chunklen() argument
4827 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, in sctp_sf_violation_chunklen()
4840 const struct sctp_association *asoc, in sctp_sf_violation_paramlen() argument
4849 if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc)) in sctp_sf_violation_paramlen()
4853 abort = sctp_make_violation_paramlen(asoc, chunk, param); in sctp_sf_violation_paramlen()
4868 sctp_sf_pdiscard(net, ep, asoc, SCTP_ST_CHUNK(0), arg, commands); in sctp_sf_violation_paramlen()
4883 const struct sctp_association *asoc, in sctp_sf_violation_ctsn() argument
4890 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, in sctp_sf_violation_ctsn()
4903 const struct sctp_association *asoc, in sctp_sf_violation_chunk() argument
4910 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, in sctp_sf_violation_chunk()
4959 * [This is the argument asoc.]
4963 * [This is asoc->peer.active_path.]
4975 const struct sctp_association *asoc, in sctp_sf_do_prm_asoc() argument
4998 repl = sctp_make_init(asoc, &asoc->base.bind_addr, GFP_ATOMIC, 0); in sctp_sf_do_prm_asoc()
5009 my_asoc = (struct sctp_association *)asoc; in sctp_sf_do_prm_asoc()
5087 const struct sctp_association *asoc, in sctp_sf_do_prm_send() argument
5127 const struct sctp_association *asoc, in sctp_sf_do_9_2_prm_shutdown() argument
5146 if (sctp_outq_is_empty(&asoc->outqueue)) { in sctp_sf_do_9_2_prm_shutdown()
5147 disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type, in sctp_sf_do_9_2_prm_shutdown()
5184 const struct sctp_association *asoc, in sctp_sf_do_9_1_prm_abort() argument
5221 const struct sctp_association *asoc, in sctp_sf_error_closed() argument
5236 const struct sctp_association *asoc, in sctp_sf_error_shutdown() argument
5252 * (endpoint, asoc)
5263 const struct sctp_association *asoc, in sctp_sf_cookie_wait_prm_shutdown() argument
5287 * (endpoint, asoc)
5298 const struct sctp_association *asoc, in sctp_sf_cookie_echoed_prm_shutdown() argument
5306 return sctp_sf_cookie_wait_prm_shutdown(net, ep, asoc, type, arg, commands); in sctp_sf_cookie_echoed_prm_shutdown()
5315 * (endpoint, asoc)
5326 const struct sctp_association *asoc, in sctp_sf_cookie_wait_prm_abort() argument
5364 * (endpoint, asoc)
5375 const struct sctp_association *asoc, in sctp_sf_cookie_echoed_prm_abort() argument
5383 return sctp_sf_cookie_wait_prm_abort(net, ep, asoc, type, arg, commands); in sctp_sf_cookie_echoed_prm_abort()
5390 * (endpoint, asoc)
5401 const struct sctp_association *asoc, in sctp_sf_shutdown_pending_prm_abort() argument
5410 return sctp_sf_do_9_1_prm_abort(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_pending_prm_abort()
5417 * (endpoint, asoc)
5428 const struct sctp_association *asoc, in sctp_sf_shutdown_sent_prm_abort() argument
5441 return sctp_sf_do_9_1_prm_abort(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_sent_prm_abort()
5448 * (endpoint, asoc)
5459 const struct sctp_association *asoc, in sctp_sf_shutdown_ack_sent_prm_abort() argument
5467 return sctp_sf_shutdown_sent_prm_abort(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_ack_sent_prm_abort()
5495 const struct sctp_association *asoc, in sctp_sf_do_prm_requestheartbeat() argument
5500 if (SCTP_DISPOSITION_NOMEM == sctp_sf_heartbeat(ep, asoc, type, in sctp_sf_do_prm_requestheartbeat()
5527 const struct sctp_association *asoc, in sctp_sf_do_prm_asconf() argument
5544 const struct sctp_association *asoc, in sctp_sf_do_prm_reconf() argument
5563 const struct sctp_association *asoc, in sctp_sf_ignore_primitive() argument
5587 const struct sctp_association *asoc, in sctp_sf_do_no_pending_tsn() argument
5594 event = sctp_ulpevent_make_sender_dry_event(asoc, GFP_ATOMIC); in sctp_sf_do_no_pending_tsn()
5619 const struct sctp_association *asoc, in sctp_sf_do_9_2_start_shutdown() argument
5631 reply = sctp_make_shutdown(asoc, arg); in sctp_sf_do_9_2_start_shutdown()
5651 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) in sctp_sf_do_9_2_start_shutdown()
5689 const struct sctp_association *asoc, in sctp_sf_do_9_2_shutdown_ack() argument
5705 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_9_2_shutdown_ack()
5706 return sctp_sf_pdiscard(net, ep, asoc, type, arg, in sctp_sf_do_9_2_shutdown_ack()
5712 return sctp_sf_violation_chunklen(net, ep, asoc, type, in sctp_sf_do_9_2_shutdown_ack()
5719 reply = sctp_make_shutdown_ack(asoc, chunk); in sctp_sf_do_9_2_shutdown_ack()
5732 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) in sctp_sf_do_9_2_shutdown_ack()
5762 const struct sctp_association *asoc, in sctp_sf_ignore_other() argument
5790 const struct sctp_association *asoc, in sctp_sf_do_6_3_3_rtx() argument
5799 if (asoc->overall_error_count >= asoc->max_retrans) { in sctp_sf_do_6_3_3_rtx()
5800 if (asoc->peer.zero_window_announced && in sctp_sf_do_6_3_3_rtx()
5801 asoc->state == SCTP_STATE_SHUTDOWN_PENDING) { in sctp_sf_do_6_3_3_rtx()
5878 const struct sctp_association *asoc, in sctp_sf_do_6_2_sack() argument
5894 * (endpoint, asoc)
5910 const struct sctp_association *asoc, in sctp_sf_t1_init_timer_expire() argument
5915 int attempts = asoc->init_err_counter + 1; in sctp_sf_t1_init_timer_expire()
5923 if (attempts <= asoc->max_init_attempts) { in sctp_sf_t1_init_timer_expire()
5924 bp = (struct sctp_bind_addr *) &asoc->base.bind_addr; in sctp_sf_t1_init_timer_expire()
5925 repl = sctp_make_init(asoc, bp, GFP_ATOMIC, 0); in sctp_sf_t1_init_timer_expire()
5941 asoc->max_init_attempts); in sctp_sf_t1_init_timer_expire()
5959 * (endpoint, asoc)
5975 const struct sctp_association *asoc, in sctp_sf_t1_cookie_timer_expire() argument
5980 int attempts = asoc->init_err_counter + 1; in sctp_sf_t1_cookie_timer_expire()
5987 if (attempts <= asoc->max_init_attempts) { in sctp_sf_t1_cookie_timer_expire()
5988 repl = sctp_make_cookie_echo(asoc, NULL); in sctp_sf_t1_cookie_timer_expire()
6026 const struct sctp_association *asoc, in sctp_sf_t2_timer_expire() argument
6037 ((struct sctp_association *)asoc)->shutdown_retries++; in sctp_sf_t2_timer_expire()
6039 if (asoc->overall_error_count >= asoc->max_retrans) { in sctp_sf_t2_timer_expire()
6050 switch (asoc->state) { in sctp_sf_t2_timer_expire()
6052 reply = sctp_make_shutdown(asoc, NULL); in sctp_sf_t2_timer_expire()
6056 reply = sctp_make_shutdown_ack(asoc, NULL); in sctp_sf_t2_timer_expire()
6071 if (asoc->shutdown_last_sent_to) in sctp_sf_t2_timer_expire()
6073 SCTP_TRANSPORT(asoc->shutdown_last_sent_to)); in sctp_sf_t2_timer_expire()
6097 const struct sctp_association *asoc, in sctp_sf_t4_timer_expire() argument
6102 struct sctp_chunk *chunk = asoc->addip_last_asconf; in sctp_sf_t4_timer_expire()
6123 if (asoc->overall_error_count >= asoc->max_retrans) { in sctp_sf_t4_timer_expire()
6146 sctp_chunk_hold(asoc->addip_last_asconf); in sctp_sf_t4_timer_expire()
6148 SCTP_CHUNK(asoc->addip_last_asconf)); in sctp_sf_t4_timer_expire()
6169 const struct sctp_association *asoc, in sctp_sf_t5_timer_expire() argument
6180 reply = sctp_make_abort(asoc, NULL, 0); in sctp_sf_t5_timer_expire()
6206 const struct sctp_association *asoc, in sctp_sf_autoclose_timer_expire() argument
6227 if (sctp_outq_is_empty(&asoc->outqueue)) { in sctp_sf_autoclose_timer_expire()
6228 disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type, in sctp_sf_autoclose_timer_expire()
6243 * (endpoint, asoc, chunk)
6249 const struct sctp_association *asoc, in sctp_sf_not_impl() argument
6260 * (endpoint, asoc, chunk)
6266 const struct sctp_association *asoc, in sctp_sf_bug() argument
6280 * (endpoint, asoc, chunk)
6286 const struct sctp_association *asoc, in sctp_sf_timer_ignore() argument
6331 const struct sctp_association *asoc, in sctp_abort_pkt_new() argument
6338 packet = sctp_ootb_pkt_new(net, asoc, chunk); in sctp_abort_pkt_new()
6342 * The T bit will be set if the asoc is NULL. in sctp_abort_pkt_new()
6344 abort = sctp_make_abort(asoc, chunk, paylen); in sctp_abort_pkt_new()
6372 const struct sctp_association *asoc, in sctp_ootb_pkt_new() argument
6387 if (asoc) { in sctp_ootb_pkt_new()
6402 vtag = asoc->peer.i.init_tag; in sctp_ootb_pkt_new()
6456 const struct sctp_association *asoc, in sctp_send_stale_cookie_err() argument
6464 packet = sctp_ootb_pkt_new(net, asoc, chunk); in sctp_send_stale_cookie_err()
6485 static int sctp_eat_data(const struct sctp_association *asoc, in sctp_eat_data() argument
6489 struct sctp_tsnmap *map = (struct sctp_tsnmap *)&asoc->peer.tsn_map; in sctp_eat_data()
6490 struct sock *sk = asoc->base.sk; in sctp_eat_data()
6501 skb_pull(chunk->skb, sctp_datahdr_len(&asoc->stream)); in sctp_eat_data()
6518 if (asoc->peer.ecn_capable && !chunk->ecn_ce_done) { in sctp_eat_data()
6529 tmp = sctp_tsnmap_check(&asoc->peer.tsn_map, tsn); in sctp_eat_data()
6534 if (chunk->asoc) in sctp_eat_data()
6535 chunk->asoc->stats.outofseqtsns++; in sctp_eat_data()
6549 datalen -= sctp_datachk_len(&asoc->stream); in sctp_eat_data()
6554 if ((datalen >= asoc->rwnd) && (!asoc->ulpq.pd_mode)) { in sctp_eat_data()
6567 if ((!chunk->data_accepted) && (!asoc->rwnd || asoc->rwnd_over || in sctp_eat_data()
6568 (datalen > asoc->rwnd + asoc->frag_point))) { in sctp_eat_data()
6582 __func__, tsn, datalen, asoc->rwnd); in sctp_eat_data()
6613 err = sctp_make_abort_no_data(asoc, chunk, tsn); in sctp_eat_data()
6638 if (chunk->asoc) in sctp_eat_data()
6639 chunk->asoc->stats.iuodchunks++; in sctp_eat_data()
6642 if (chunk->asoc) in sctp_eat_data()
6643 chunk->asoc->stats.iodchunks++; in sctp_eat_data()
6654 if (ntohs(data_hdr->stream) >= asoc->stream.incnt) { in sctp_eat_data()
6658 err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM, in sctp_eat_data()
6675 if (!asoc->stream.si->validate_data(chunk)) in sctp_eat_data()