Lines Matching refs:asoc
54 const struct sctp_association *asoc,
57 static int sctp_eat_data(const struct sctp_association *asoc,
62 const struct sctp_association *asoc,
66 const struct sctp_association *asoc,
73 const struct sctp_association *asoc,
80 const struct sctp_association *asoc,
87 const struct sctp_association *asoc,
94 const struct sctp_association *asoc,
104 const struct sctp_association *asoc,
110 const struct sctp_association *asoc,
119 const struct sctp_association *asoc,
127 const struct sctp_association *asoc,
135 const struct sctp_association *asoc,
143 const struct sctp_association *asoc,
149 const struct sctp_association *asoc,
155 const struct sctp_association *asoc,
162 const struct sctp_association *asoc,
234 const struct sctp_association *asoc, in sctp_sf_do_4_C() argument
241 if (!sctp_vtag_verify_either(chunk, asoc)) in sctp_sf_do_4_C()
242 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_4_C()
250 return sctp_sf_violation_chunk(net, ep, asoc, type, arg, commands); in sctp_sf_do_4_C()
254 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_4_C()
264 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_SHUTDOWN_COMP, in sctp_sf_do_4_C()
319 const struct sctp_association *asoc, in sctp_sf_do_5_1B_init() argument
340 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1B_init()
348 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1B_init()
355 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1B_init()
362 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1B_init()
371 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1B_init()
375 if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type, in sctp_sf_do_5_1B_init()
382 packet = sctp_abort_pkt_new(net, ep, asoc, arg, in sctp_sf_do_5_1B_init()
399 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, in sctp_sf_do_5_1B_init()
417 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1B_init()
519 const struct sctp_association *asoc, in sctp_sf_do_5_1C_ack() argument
529 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_5_1C_ack()
530 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1C_ack()
537 return sctp_sf_violation_chunk(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1C_ack()
541 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_5_1C_ack()
548 if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type, in sctp_sf_do_5_1C_ack()
560 packet = sctp_abort_pkt_new(net, ep, asoc, arg, in sctp_sf_do_5_1C_ack()
587 if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc)) in sctp_sf_do_5_1C_ack()
588 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1C_ack()
592 asoc, chunk->transport); in sctp_sf_do_5_1C_ack()
637 const struct sctp_association *asoc) in sctp_auth_chunk_verify() argument
652 if (!net->sctp.auth_enable || !asoc->peer.auth_capable) in sctp_auth_chunk_verify()
657 auth.asoc = chunk->asoc; in sctp_auth_chunk_verify()
665 return sctp_sf_authenticate(asoc, &auth) == SCTP_IERROR_NO_ERROR; in sctp_auth_chunk_verify()
701 const struct sctp_association *asoc, in sctp_sf_do_5_1D_ce() argument
715 if (asoc && !sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_5_1D_ce()
716 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1D_ce()
723 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1D_ce()
732 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_5_1D_ce()
742 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1D_ce()
757 new_asoc = sctp_unpack_cookie(ep, asoc, chunk, GFP_ATOMIC, &error, in sctp_sf_do_5_1D_ce()
775 sctp_send_stale_cookie_err(net, ep, asoc, chunk, commands, in sctp_sf_do_5_1D_ce()
777 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1D_ce()
781 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1D_ce()
787 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1D_ce()
814 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1D_ce()
922 const struct sctp_association *asoc, in sctp_sf_do_5_1E_ca() argument
930 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_5_1E_ca()
931 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1E_ca()
934 if (security_sctp_assoc_established((struct sctp_association *)asoc, in sctp_sf_do_5_1E_ca()
936 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_1E_ca()
942 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_5_1E_ca()
966 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) in sctp_sf_do_5_1E_ca()
974 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_COMM_UP, in sctp_sf_do_5_1E_ca()
975 0, asoc->c.sinit_num_ostreams, in sctp_sf_do_5_1E_ca()
976 asoc->c.sinit_max_instreams, in sctp_sf_do_5_1E_ca()
989 if (asoc->peer.adaptation_ind) { in sctp_sf_do_5_1E_ca()
990 ev = sctp_ulpevent_make_adaptation_indication(asoc, GFP_ATOMIC); in sctp_sf_do_5_1E_ca()
998 if (!asoc->peer.auth_capable) { in sctp_sf_do_5_1E_ca()
999 ev = sctp_ulpevent_make_authkey(asoc, 0, SCTP_AUTH_NO_AUTH, in sctp_sf_do_5_1E_ca()
1015 const struct sctp_association *asoc, in sctp_sf_heartbeat() argument
1024 reply = sctp_make_heartbeat(asoc, transport, 0); in sctp_sf_heartbeat()
1041 const struct sctp_association *asoc, in sctp_sf_sendbeat_8_3() argument
1048 if (asoc->overall_error_count >= asoc->max_retrans) { in sctp_sf_sendbeat_8_3()
1068 sctp_sf_heartbeat(ep, asoc, type, arg, in sctp_sf_sendbeat_8_3()
1089 const struct sctp_association *asoc, in sctp_sf_send_reconf() argument
1096 if (asoc->overall_error_count >= asoc->max_retrans) { in sctp_sf_send_reconf()
1107 sctp_chunk_hold(asoc->strreset_chunk); in sctp_sf_send_reconf()
1109 SCTP_CHUNK(asoc->strreset_chunk)); in sctp_sf_send_reconf()
1118 const struct sctp_association *asoc, in sctp_sf_send_probe() argument
1130 reply = sctp_make_heartbeat(asoc, transport, transport->pl.probe_size); in sctp_sf_send_probe()
1166 const struct sctp_association *asoc, in sctp_sf_beat_8_3() argument
1175 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_beat_8_3()
1176 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_beat_8_3()
1181 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_beat_8_3()
1193 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg, in sctp_sf_beat_8_3()
1199 reply = sctp_make_heartbeat_ack(asoc, chunk, param_hdr, paylen); in sctp_sf_beat_8_3()
1240 const struct sctp_association *asoc, in sctp_sf_backbeat_8_3() argument
1251 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_backbeat_8_3()
1252 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_backbeat_8_3()
1257 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_backbeat_8_3()
1266 link = sctp_assoc_lookup_paddr(asoc, &from_addr); in sctp_sf_backbeat_8_3()
1273 asoc, in sctp_sf_backbeat_8_3()
1278 asoc, in sctp_sf_backbeat_8_3()
1296 return sctp_sf_send_probe(net, ep, asoc, type, link, commands); in sctp_sf_backbeat_8_3()
1389 const struct sctp_association *asoc, in sctp_sf_check_restart_addrs() argument
1410 if (!list_has_sctp_addr(&asoc->peer.transport_addr_list, in sctp_sf_check_restart_addrs()
1429 const struct sctp_association *asoc) in sctp_tietags_populate() argument
1431 switch (asoc->state) { in sctp_tietags_populate()
1436 new_asoc->c.my_vtag = asoc->c.my_vtag; in sctp_tietags_populate()
1437 new_asoc->c.my_ttag = asoc->c.my_vtag; in sctp_tietags_populate()
1442 new_asoc->c.my_vtag = asoc->c.my_vtag; in sctp_tietags_populate()
1443 new_asoc->c.my_ttag = asoc->c.my_vtag; in sctp_tietags_populate()
1444 new_asoc->c.peer_ttag = asoc->c.peer_vtag; in sctp_tietags_populate()
1451 new_asoc->c.my_ttag = asoc->c.my_vtag; in sctp_tietags_populate()
1452 new_asoc->c.peer_ttag = asoc->c.peer_vtag; in sctp_tietags_populate()
1460 new_asoc->rwnd = asoc->rwnd; in sctp_tietags_populate()
1461 new_asoc->c.sinit_num_ostreams = asoc->c.sinit_num_ostreams; in sctp_tietags_populate()
1462 new_asoc->c.sinit_max_instreams = asoc->c.sinit_max_instreams; in sctp_tietags_populate()
1463 new_asoc->c.initial_tsn = asoc->c.initial_tsn; in sctp_tietags_populate()
1476 const struct sctp_association *asoc) in sctp_tietags_compare() argument
1479 if ((asoc->c.my_vtag != new_asoc->c.my_vtag) && in sctp_tietags_compare()
1480 (asoc->c.peer_vtag != new_asoc->c.peer_vtag) && in sctp_tietags_compare()
1481 (asoc->c.my_vtag == new_asoc->c.my_ttag) && in sctp_tietags_compare()
1482 (asoc->c.peer_vtag == new_asoc->c.peer_ttag)) in sctp_tietags_compare()
1486 if ((asoc->c.my_vtag == new_asoc->c.my_vtag) && in sctp_tietags_compare()
1487 ((asoc->c.peer_vtag != new_asoc->c.peer_vtag) || in sctp_tietags_compare()
1488 (0 == asoc->c.peer_vtag))) { in sctp_tietags_compare()
1493 if ((asoc->c.my_vtag == new_asoc->c.my_vtag) && in sctp_tietags_compare()
1494 (asoc->c.peer_vtag == new_asoc->c.peer_vtag)) in sctp_tietags_compare()
1498 if ((asoc->c.my_vtag != new_asoc->c.my_vtag) && in sctp_tietags_compare()
1499 (asoc->c.peer_vtag == new_asoc->c.peer_vtag) && in sctp_tietags_compare()
1514 const struct sctp_association *asoc, in sctp_sf_do_unexpected_init() argument
1536 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_unexpected_init()
1540 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_unexpected_init()
1546 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands); in sctp_sf_do_unexpected_init()
1549 return sctp_sf_new_encap_port(net, ep, asoc, type, arg, commands); in sctp_sf_do_unexpected_init()
1559 if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type, in sctp_sf_do_unexpected_init()
1566 packet = sctp_abort_pkt_new(net, ep, asoc, arg, in sctp_sf_do_unexpected_init()
1582 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, in sctp_sf_do_unexpected_init()
1601 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_unexpected_init()
1622 if (!sctp_state(asoc, COOKIE_WAIT)) { in sctp_sf_do_unexpected_init()
1623 if (!sctp_sf_check_restart_addrs(new_asoc, asoc, chunk, in sctp_sf_do_unexpected_init()
1630 sctp_tietags_populate(new_asoc, asoc); in sctp_sf_do_unexpected_init()
1733 const struct sctp_association *asoc, in sctp_sf_do_5_2_1_siminit() argument
1741 return sctp_sf_do_unexpected_init(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_2_1_siminit()
1788 const struct sctp_association *asoc, in sctp_sf_do_5_2_2_dupinit() argument
1796 return sctp_sf_do_unexpected_init(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_2_2_dupinit()
1812 const struct sctp_association *asoc, in sctp_sf_do_5_2_3_initack() argument
1821 return sctp_sf_ootb(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_2_3_initack()
1823 return sctp_sf_discard_chunk(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_2_3_initack()
1826 static int sctp_sf_do_assoc_update(struct sctp_association *asoc, in sctp_sf_do_assoc_update() argument
1830 struct net *net = asoc->base.net; in sctp_sf_do_assoc_update()
1833 if (!sctp_assoc_update(asoc, new)) in sctp_sf_do_assoc_update()
1836 abort = sctp_make_abort(asoc, NULL, sizeof(struct sctp_errhdr)); in sctp_sf_do_assoc_update()
1858 const struct sctp_association *asoc, in sctp_sf_do_dupcook_a() argument
1887 if (!sctp_sf_check_restart_addrs(new_asoc, asoc, chunk, commands)) in sctp_sf_do_dupcook_a()
1896 if (sctp_state(asoc, SHUTDOWN_ACK_SENT)) { in sctp_sf_do_dupcook_a()
1897 disposition = __sctp_sf_do_9_2_reshutack(net, ep, asoc, in sctp_sf_do_dupcook_a()
1903 err = sctp_make_op_error(asoc, chunk, in sctp_sf_do_dupcook_a()
1929 if (sctp_sf_do_assoc_update((struct sctp_association *)asoc, new_asoc, commands)) in sctp_sf_do_dupcook_a()
1932 repl = sctp_make_cookie_ack(asoc, chunk); in sctp_sf_do_dupcook_a()
1937 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_RESTART, 0, in sctp_sf_do_dupcook_a()
1938 asoc->c.sinit_num_ostreams, in sctp_sf_do_dupcook_a()
1939 asoc->c.sinit_max_instreams, in sctp_sf_do_dupcook_a()
1945 if ((sctp_state(asoc, SHUTDOWN_PENDING) || in sctp_sf_do_dupcook_a()
1946 sctp_state(asoc, SHUTDOWN_SENT)) && in sctp_sf_do_dupcook_a()
1947 (sctp_sstate(asoc->base.sk, CLOSING) || in sctp_sf_do_dupcook_a()
1948 sock_flag(asoc->base.sk, SOCK_DEAD))) { in sctp_sf_do_dupcook_a()
1954 return sctp_sf_do_9_2_start_shutdown(net, ep, asoc, in sctp_sf_do_dupcook_a()
1981 const struct sctp_association *asoc, in sctp_sf_do_dupcook_b() argument
2005 if (asoc->state < SCTP_STATE_ESTABLISHED) in sctp_sf_do_dupcook_b()
2010 if (sctp_sf_do_assoc_update((struct sctp_association *)asoc, new_asoc, commands)) in sctp_sf_do_dupcook_b()
2013 repl = sctp_make_cookie_ack(asoc, chunk); in sctp_sf_do_dupcook_b()
2041 if (asoc->peer.adaptation_ind) in sctp_sf_do_dupcook_b()
2044 if (!asoc->peer.auth_capable) in sctp_sf_do_dupcook_b()
2065 const struct sctp_association *asoc, in sctp_sf_do_dupcook_c() argument
2088 const struct sctp_association *asoc, in sctp_sf_do_dupcook_d() argument
2103 if (!sctp_auth_chunk_verify(net, chunk, asoc)) in sctp_sf_do_dupcook_d()
2107 if (asoc->state < SCTP_STATE_ESTABLISHED) { in sctp_sf_do_dupcook_d()
2123 ev = sctp_ulpevent_make_assoc_change(asoc, 0, in sctp_sf_do_dupcook_d()
2125 asoc->c.sinit_num_ostreams, in sctp_sf_do_dupcook_d()
2126 asoc->c.sinit_max_instreams, in sctp_sf_do_dupcook_d()
2136 if (asoc->peer.adaptation_ind) { in sctp_sf_do_dupcook_d()
2137 ai_ev = sctp_ulpevent_make_adaptation_indication(asoc, in sctp_sf_do_dupcook_d()
2144 if (!asoc->peer.auth_capable) { in sctp_sf_do_dupcook_d()
2145 auth_ev = sctp_ulpevent_make_authkey(asoc, 0, in sctp_sf_do_dupcook_d()
2153 repl = sctp_make_cookie_ack(asoc, chunk); in sctp_sf_do_dupcook_d()
2200 const struct sctp_association *asoc, in sctp_sf_do_5_2_4_dupcook() argument
2218 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_5_2_4_dupcook()
2219 asoc = NULL; in sctp_sf_do_5_2_4_dupcook()
2220 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_2_4_dupcook()
2236 new_asoc = sctp_unpack_cookie(ep, asoc, chunk, GFP_ATOMIC, &error, in sctp_sf_do_5_2_4_dupcook()
2254 sctp_send_stale_cookie_err(net, ep, asoc, chunk, commands, in sctp_sf_do_5_2_4_dupcook()
2256 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_2_4_dupcook()
2259 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_2_4_dupcook()
2269 action = sctp_tietags_compare(new_asoc, asoc); in sctp_sf_do_5_2_4_dupcook()
2279 if (security_sctp_assoc_request((struct sctp_association *)asoc, in sctp_sf_do_5_2_4_dupcook()
2282 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_2_4_dupcook()
2289 retval = sctp_sf_do_dupcook_a(net, ep, asoc, chunk, commands, in sctp_sf_do_5_2_4_dupcook()
2294 retval = sctp_sf_do_dupcook_b(net, ep, asoc, chunk, commands, in sctp_sf_do_5_2_4_dupcook()
2299 retval = sctp_sf_do_dupcook_c(net, ep, asoc, chunk, commands, in sctp_sf_do_5_2_4_dupcook()
2304 retval = sctp_sf_do_dupcook_d(net, ep, asoc, chunk, commands, in sctp_sf_do_5_2_4_dupcook()
2309 retval = sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_5_2_4_dupcook()
2321 SCTP_ASOC((struct sctp_association *)asoc)); in sctp_sf_do_5_2_4_dupcook()
2337 const struct sctp_association *asoc, in sctp_sf_shutdown_pending_abort() argument
2344 if (!sctp_vtag_verify_either(chunk, asoc)) in sctp_sf_shutdown_pending_abort()
2345 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_pending_abort()
2358 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_pending_abort()
2366 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest)) in sctp_sf_shutdown_pending_abort()
2367 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_pending_abort()
2370 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_pending_abort()
2372 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_pending_abort()
2383 const struct sctp_association *asoc, in sctp_sf_shutdown_sent_abort() argument
2390 if (!sctp_vtag_verify_either(chunk, asoc)) in sctp_sf_shutdown_sent_abort()
2391 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_sent_abort()
2404 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_sent_abort()
2412 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest)) in sctp_sf_shutdown_sent_abort()
2413 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_sent_abort()
2416 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_sent_abort()
2426 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_sent_abort()
2437 const struct sctp_association *asoc, in sctp_sf_shutdown_ack_sent_abort() argument
2445 return sctp_sf_shutdown_sent_abort(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_ack_sent_abort()
2465 const struct sctp_association *asoc, in sctp_sf_cookie_echoed_err() argument
2473 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_cookie_echoed_err()
2474 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_cookie_echoed_err()
2480 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_cookie_echoed_err()
2490 return sctp_sf_do_5_2_6_stale(net, ep, asoc, type, in sctp_sf_cookie_echoed_err()
2499 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_cookie_echoed_err()
2530 const struct sctp_association *asoc, in sctp_sf_do_5_2_6_stale() argument
2535 int attempts = asoc->init_err_counter + 1; in sctp_sf_do_5_2_6_stale()
2542 if (attempts > asoc->max_init_attempts) { in sctp_sf_do_5_2_6_stale()
2574 bp = (struct sctp_bind_addr *) &asoc->base.bind_addr; in sctp_sf_do_5_2_6_stale()
2575 reply = sctp_make_init(asoc, bp, GFP_ATOMIC, sizeof(bht)); in sctp_sf_do_5_2_6_stale()
2597 SCTP_TRANSPORT(asoc->peer.primary_path)); in sctp_sf_do_5_2_6_stale()
2653 const struct sctp_association *asoc, in sctp_sf_do_9_1_abort() argument
2660 if (!sctp_vtag_verify_either(chunk, asoc)) in sctp_sf_do_9_1_abort()
2661 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_1_abort()
2674 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_1_abort()
2682 sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest)) in sctp_sf_do_9_1_abort()
2683 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_1_abort()
2686 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_1_abort()
2688 return __sctp_sf_do_9_1_abort(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_1_abort()
2694 const struct sctp_association *asoc, in __sctp_sf_do_9_1_abort() argument
2725 const struct sctp_association *asoc, in sctp_sf_cookie_wait_abort() argument
2734 if (!sctp_vtag_verify_either(chunk, asoc)) in sctp_sf_cookie_wait_abort()
2735 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_cookie_wait_abort()
2748 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_cookie_wait_abort()
2755 return sctp_stop_t1_and_abort(net, commands, error, ECONNREFUSED, asoc, in sctp_sf_cookie_wait_abort()
2765 const struct sctp_association *asoc, in sctp_sf_cookie_wait_icmp_abort() argument
2771 ENOPROTOOPT, asoc, in sctp_sf_cookie_wait_icmp_abort()
2781 const struct sctp_association *asoc, in sctp_sf_cookie_echoed_abort() argument
2789 return sctp_sf_cookie_wait_abort(net, ep, asoc, type, arg, commands); in sctp_sf_cookie_echoed_abort()
2801 const struct sctp_association *asoc, in sctp_stop_t1_and_abort() argument
2855 const struct sctp_association *asoc, in sctp_sf_do_9_2_shutdown() argument
2866 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_9_2_shutdown()
2867 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_shutdown()
2871 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_9_2_shutdown()
2880 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) { in sctp_sf_do_9_2_shutdown()
2882 asoc->ctsn_ack_point); in sctp_sf_do_9_2_shutdown()
2891 if (!TSN_lt(ctsn, asoc->next_tsn)) in sctp_sf_do_9_2_shutdown()
2892 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_shutdown()
2898 ev = sctp_ulpevent_make_shutdown_event(asoc, 0, GFP_ATOMIC); in sctp_sf_do_9_2_shutdown()
2915 if (sctp_outq_is_empty(&asoc->outqueue)) { in sctp_sf_do_9_2_shutdown()
2916 disposition = sctp_sf_do_9_2_shutdown_ack(net, ep, asoc, type, in sctp_sf_do_9_2_shutdown()
2945 const struct sctp_association *asoc, in sctp_sf_do_9_2_shut_ctsn() argument
2954 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_9_2_shut_ctsn()
2955 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_shut_ctsn()
2959 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_9_2_shut_ctsn()
2965 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) { in sctp_sf_do_9_2_shut_ctsn()
2967 asoc->ctsn_ack_point); in sctp_sf_do_9_2_shut_ctsn()
2976 if (!TSN_lt(ctsn, asoc->next_tsn)) in sctp_sf_do_9_2_shut_ctsn()
2977 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_shut_ctsn()
2998 const struct sctp_association *asoc, in __sctp_sf_do_9_2_reshutack() argument
3007 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in __sctp_sf_do_9_2_reshutack()
3014 reply = sctp_make_shutdown_ack(asoc, chunk); in __sctp_sf_do_9_2_reshutack()
3036 const struct sctp_association *asoc, in sctp_sf_do_9_2_reshutack() argument
3043 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_reshutack()
3046 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_reshutack()
3049 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_reshutack()
3051 return __sctp_sf_do_9_2_reshutack(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_reshutack()
3081 const struct sctp_association *asoc, in sctp_sf_do_ecn_cwr() argument
3090 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_ecn_cwr()
3091 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_ecn_cwr()
3094 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_ecn_cwr()
3103 if (TSN_lte(asoc->last_ecne_tsn, lowest_tsn)) { in sctp_sf_do_ecn_cwr()
3137 const struct sctp_association *asoc, in sctp_sf_do_ecne() argument
3144 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_ecne()
3145 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_ecne()
3148 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_ecne()
3193 const struct sctp_association *asoc, in sctp_sf_eat_data_6_2() argument
3202 if (!sctp_vtag_verify(chunk, asoc)) { in sctp_sf_eat_data_6_2()
3205 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_data_6_2()
3208 if (!sctp_chunk_length_valid(chunk, sctp_datachk_len(&asoc->stream))) in sctp_sf_eat_data_6_2()
3209 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_eat_data_6_2()
3212 error = sctp_eat_data(asoc, chunk, commands); in sctp_sf_eat_data_6_2()
3227 return sctp_sf_abort_violation(net, ep, asoc, chunk, commands, in sctp_sf_eat_data_6_2()
3229 sctp_datahdr_len(&asoc->stream)); in sctp_sf_eat_data_6_2()
3237 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) { in sctp_sf_eat_data_6_2()
3314 const struct sctp_association *asoc, in sctp_sf_eat_data_fast_4_4() argument
3322 if (!sctp_vtag_verify(chunk, asoc)) { in sctp_sf_eat_data_fast_4_4()
3325 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_data_fast_4_4()
3328 if (!sctp_chunk_length_valid(chunk, sctp_datachk_len(&asoc->stream))) in sctp_sf_eat_data_fast_4_4()
3329 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_eat_data_fast_4_4()
3332 error = sctp_eat_data(asoc, chunk, commands); in sctp_sf_eat_data_fast_4_4()
3343 return sctp_sf_abort_violation(net, ep, asoc, chunk, commands, in sctp_sf_eat_data_fast_4_4()
3345 sctp_datahdr_len(&asoc->stream)); in sctp_sf_eat_data_fast_4_4()
3405 const struct sctp_association *asoc, in sctp_sf_eat_sack_6_2() argument
3414 if (!sctp_vtag_verify(chunk, asoc)) 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()
3419 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_eat_sack_6_2()
3426 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_sack_6_2()
3434 if (TSN_lte(asoc->next_tsn, ctsn)) in sctp_sf_eat_sack_6_2()
3435 return sctp_sf_violation_ctsn(net, ep, asoc, type, arg, commands); in sctp_sf_eat_sack_6_2()
3437 trace_sctp_probe(ep, asoc, chunk); in sctp_sf_eat_sack_6_2()
3445 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) { in sctp_sf_eat_sack_6_2()
3447 asoc->ctsn_ack_point); in sctp_sf_eat_sack_6_2()
3482 const struct sctp_association *asoc, in sctp_sf_tabort_8_4_8() argument
3491 packet = sctp_ootb_pkt_new(net, asoc, chunk); in sctp_sf_tabort_8_4_8()
3498 abort = sctp_make_abort(asoc, chunk, 0); in sctp_sf_tabort_8_4_8()
3517 sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_tabort_8_4_8()
3529 const struct sctp_association *asoc, in sctp_sf_new_encap_port() argument
3538 packet = sctp_ootb_pkt_new(net, asoc, chunk); in sctp_sf_new_encap_port()
3542 abort = sctp_make_new_encap_port(asoc, chunk); in sctp_sf_new_encap_port()
3557 sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_new_encap_port()
3571 const struct sctp_association *asoc, in sctp_sf_operr_notify() argument
3579 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_operr_notify()
3580 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_operr_notify()
3584 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_operr_notify()
3588 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg, in sctp_sf_operr_notify()
3609 const struct sctp_association *asoc, in sctp_sf_do_9_2_final() argument
3618 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_9_2_final()
3619 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_9_2_final()
3623 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_9_2_final()
3630 ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_SHUTDOWN_COMP, in sctp_sf_do_9_2_final()
3636 reply = sctp_make_shutdown_complete(asoc, chunk); in sctp_sf_do_9_2_final()
3692 const struct sctp_association *asoc, in sctp_sf_ootb() argument
3706 if (asoc && !sctp_vtag_verify(chunk, asoc)) in sctp_sf_ootb()
3707 asoc = NULL; in sctp_sf_ootb()
3713 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_ootb()
3719 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_ootb()
3734 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_ootb()
3757 return sctp_sf_shut_8_4_5(net, ep, asoc, type, arg, commands); in sctp_sf_ootb()
3759 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_ootb()
3761 return sctp_sf_tabort_8_4_8(net, ep, asoc, type, arg, commands); in sctp_sf_ootb()
3788 const struct sctp_association *asoc, in sctp_sf_shut_8_4_5() argument
3797 packet = sctp_ootb_pkt_new(net, asoc, chunk); in sctp_sf_shut_8_4_5()
3804 shut = sctp_make_shutdown_complete(asoc, chunk); in sctp_sf_shut_8_4_5()
3828 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_shut_8_4_5()
3844 const struct sctp_association *asoc, in sctp_sf_do_8_5_1_E_sa() argument
3851 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_8_5_1_E_sa()
3852 asoc = NULL; in sctp_sf_do_8_5_1_E_sa()
3856 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_8_5_1_E_sa()
3872 const struct sctp_association *asoc, in sctp_sf_do_asconf() argument
3883 if (!sctp_vtag_verify(chunk, asoc)) { in sctp_sf_do_asconf()
3886 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_asconf()
3891 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_asconf()
3900 if (!asoc->peer.asconf_capable || in sctp_sf_do_asconf()
3902 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_asconf()
3908 if (!sctp_verify_asconf(asoc, chunk, true, &err_param)) in sctp_sf_do_asconf()
3909 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg, in sctp_sf_do_asconf()
3916 if (serial == asoc->peer.addip_serial + 1) { in sctp_sf_do_asconf()
3921 sctp_assoc_clean_asconf_ack_cache(asoc); in sctp_sf_do_asconf()
3932 asoc, chunk); in sctp_sf_do_asconf()
3935 } else if (serial < asoc->peer.addip_serial + 1) { in sctp_sf_do_asconf()
3948 asconf_ack = sctp_assoc_lookup_asconf_ack(asoc, hdr->serial); in sctp_sf_do_asconf()
3975 if (asoc->new_transport) { in sctp_sf_do_asconf()
3976 sctp_sf_heartbeat(ep, asoc, type, asoc->new_transport, commands); in sctp_sf_do_asconf()
3977 ((struct sctp_association *)asoc)->new_transport = NULL; in sctp_sf_do_asconf()
3986 struct sctp_association *asoc, in sctp_send_next_asconf() argument
3993 if (list_empty(&asoc->addip_chunk_list)) in sctp_send_next_asconf()
3996 entry = asoc->addip_chunk_list.next; in sctp_send_next_asconf()
4001 asoc->addip_last_asconf = asconf; in sctp_send_next_asconf()
4003 return sctp_sf_do_prm_asconf(net, ep, asoc, type, asconf, commands); in sctp_send_next_asconf()
4013 const struct sctp_association *asoc, in sctp_sf_do_asconf_ack() argument
4018 struct sctp_chunk *last_asconf = asoc->addip_last_asconf; in sctp_sf_do_asconf_ack()
4025 if (!sctp_vtag_verify(asconf_ack, asoc)) { in sctp_sf_do_asconf_ack()
4028 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_asconf_ack()
4034 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_asconf_ack()
4043 if (!asoc->peer.asconf_capable || in sctp_sf_do_asconf_ack()
4045 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_asconf_ack()
4051 if (!sctp_verify_asconf(asoc, asconf_ack, false, &err_param)) in sctp_sf_do_asconf_ack()
4052 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg, in sctp_sf_do_asconf_ack()
4059 sent_serial = asoc->addip_serial - 1; in sctp_sf_do_asconf_ack()
4069 !(asoc->addip_last_asconf)) { in sctp_sf_do_asconf_ack()
4070 abort = sctp_make_abort(asoc, asconf_ack, in sctp_sf_do_asconf_ack()
4092 if ((rcvd_serial == sent_serial) && asoc->addip_last_asconf) { in sctp_sf_do_asconf_ack()
4096 if (!sctp_process_asconf_ack((struct sctp_association *)asoc, in sctp_sf_do_asconf_ack()
4099 (struct sctp_association *)asoc, in sctp_sf_do_asconf_ack()
4102 abort = sctp_make_abort(asoc, asconf_ack, in sctp_sf_do_asconf_ack()
4128 const struct sctp_association *asoc, in sctp_sf_do_reconf() argument
4138 if (!sctp_vtag_verify(chunk, asoc)) { in sctp_sf_do_reconf()
4141 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_do_reconf()
4146 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_do_reconf()
4149 if (!sctp_verify_reconf(asoc, chunk, &err_param)) in sctp_sf_do_reconf()
4150 return sctp_sf_violation_paramlen(net, ep, asoc, type, arg, in sctp_sf_do_reconf()
4160 (struct sctp_association *)asoc, param, &ev); in sctp_sf_do_reconf()
4163 (struct sctp_association *)asoc, param, &ev); in sctp_sf_do_reconf()
4166 (struct sctp_association *)asoc, param, &ev); in sctp_sf_do_reconf()
4169 (struct sctp_association *)asoc, param, &ev); in sctp_sf_do_reconf()
4172 (struct sctp_association *)asoc, param, &ev); in sctp_sf_do_reconf()
4175 (struct sctp_association *)asoc, param, &ev); in sctp_sf_do_reconf()
4205 const struct sctp_association *asoc, in sctp_sf_eat_fwd_tsn() argument
4215 if (!sctp_vtag_verify(chunk, asoc)) { in sctp_sf_eat_fwd_tsn()
4218 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_fwd_tsn()
4221 if (!asoc->peer.prsctp_capable) in sctp_sf_eat_fwd_tsn()
4222 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands); in sctp_sf_eat_fwd_tsn()
4225 if (!sctp_chunk_length_valid(chunk, sctp_ftsnchk_len(&asoc->stream))) in sctp_sf_eat_fwd_tsn()
4226 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_eat_fwd_tsn()
4241 if (sctp_tsnmap_check(&asoc->peer.tsn_map, tsn) < 0) in sctp_sf_eat_fwd_tsn()
4244 if (!asoc->stream.si->validate_ftsn(chunk)) in sctp_sf_eat_fwd_tsn()
4248 if (len > sctp_ftsnhdr_len(&asoc->stream)) in sctp_sf_eat_fwd_tsn()
4253 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) { in sctp_sf_eat_fwd_tsn()
4272 const struct sctp_association *asoc, in sctp_sf_eat_fwd_tsn_fast() argument
4282 if (!sctp_vtag_verify(chunk, asoc)) { in sctp_sf_eat_fwd_tsn_fast()
4285 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_fwd_tsn_fast()
4288 if (!asoc->peer.prsctp_capable) in sctp_sf_eat_fwd_tsn_fast()
4289 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands); in sctp_sf_eat_fwd_tsn_fast()
4292 if (!sctp_chunk_length_valid(chunk, sctp_ftsnchk_len(&asoc->stream))) in sctp_sf_eat_fwd_tsn_fast()
4293 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_eat_fwd_tsn_fast()
4308 if (sctp_tsnmap_check(&asoc->peer.tsn_map, tsn) < 0) in sctp_sf_eat_fwd_tsn_fast()
4311 if (!asoc->stream.si->validate_ftsn(chunk)) in sctp_sf_eat_fwd_tsn_fast()
4315 if (len > sctp_ftsnhdr_len(&asoc->stream)) in sctp_sf_eat_fwd_tsn_fast()
4358 const struct sctp_association *asoc, in sctp_sf_authenticate() argument
4376 if (!sctp_auth_asoc_verify_hmac_id(asoc, auth_hdr->hmac_id)) in sctp_sf_authenticate()
4383 if (key_id != asoc->active_key_id) { in sctp_sf_authenticate()
4384 sh_key = sctp_auth_get_shkey(asoc, key_id); in sctp_sf_authenticate()
4414 sctp_auth_calculate_hmac(asoc, chunk->skb, in sctp_sf_authenticate()
4434 const struct sctp_association *asoc, in sctp_sf_eat_auth() argument
4444 if (!asoc->peer.auth_capable) in sctp_sf_eat_auth()
4445 return sctp_sf_unk_chunk(net, ep, asoc, type, arg, commands); in sctp_sf_eat_auth()
4447 if (!sctp_vtag_verify(chunk, asoc)) { in sctp_sf_eat_auth()
4450 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_auth()
4455 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_eat_auth()
4459 error = sctp_sf_authenticate(asoc, chunk); in sctp_sf_eat_auth()
4465 err_chunk = sctp_make_op_error(asoc, chunk, in sctp_sf_eat_auth()
4476 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_eat_auth()
4479 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_eat_auth()
4489 if (asoc->active_key_id != ntohs(auth_hdr->shkey_id)) { in sctp_sf_eat_auth()
4492 ev = sctp_ulpevent_make_authkey(asoc, ntohs(auth_hdr->shkey_id), in sctp_sf_eat_auth()
4530 const struct sctp_association *asoc, in sctp_sf_unk_chunk() argument
4541 if (!sctp_vtag_verify(unk_chunk, asoc)) in sctp_sf_unk_chunk()
4542 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_unk_chunk()
4549 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_unk_chunk()
4555 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_unk_chunk()
4559 err_chunk = sctp_make_op_error(asoc, unk_chunk, in sctp_sf_unk_chunk()
4569 sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_unk_chunk()
4577 err_chunk = sctp_make_op_error(asoc, unk_chunk, in sctp_sf_unk_chunk()
4610 const struct sctp_association *asoc, in sctp_sf_discard_chunk() argument
4617 if (asoc && !sctp_vtag_verify(chunk, asoc)) in sctp_sf_discard_chunk()
4618 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_discard_chunk()
4625 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_discard_chunk()
4653 const struct sctp_association *asoc, in sctp_sf_pdiscard() argument
4680 const struct sctp_association *asoc, in sctp_sf_violation() argument
4687 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_violation()
4688 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); in sctp_sf_violation()
4692 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, in sctp_sf_violation()
4704 const struct sctp_association *asoc, in sctp_sf_abort_violation() argument
4725 if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc)) in sctp_sf_abort_violation()
4729 abort = sctp_make_abort_violation(asoc, chunk, payload, paylen); in sctp_sf_abort_violation()
4733 if (asoc) { in sctp_sf_abort_violation()
4736 !asoc->peer.i.init_tag) { in sctp_sf_abort_violation()
4754 if (asoc->state <= SCTP_STATE_COOKIE_ECHOED) { in sctp_sf_abort_violation()
4769 packet = sctp_ootb_pkt_new(net, asoc, chunk); in sctp_sf_abort_violation()
4790 sctp_sf_pdiscard(net, ep, asoc, SCTP_ST_CHUNK(0), arg, commands); in sctp_sf_abort_violation()
4821 const struct sctp_association *asoc, in sctp_sf_violation_chunklen() argument
4828 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, in sctp_sf_violation_chunklen()
4841 const struct sctp_association *asoc, in sctp_sf_violation_paramlen() argument
4850 if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc)) in sctp_sf_violation_paramlen()
4854 abort = sctp_make_violation_paramlen(asoc, chunk, param); in sctp_sf_violation_paramlen()
4869 sctp_sf_pdiscard(net, ep, asoc, SCTP_ST_CHUNK(0), arg, commands); in sctp_sf_violation_paramlen()
4884 const struct sctp_association *asoc, in sctp_sf_violation_ctsn() argument
4891 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, in sctp_sf_violation_ctsn()
4904 const struct sctp_association *asoc, in sctp_sf_violation_chunk() argument
4911 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, in sctp_sf_violation_chunk()
4976 const struct sctp_association *asoc, in sctp_sf_do_prm_asoc() argument
4999 repl = sctp_make_init(asoc, &asoc->base.bind_addr, GFP_ATOMIC, 0); in sctp_sf_do_prm_asoc()
5010 my_asoc = (struct sctp_association *)asoc; in sctp_sf_do_prm_asoc()
5088 const struct sctp_association *asoc, in sctp_sf_do_prm_send() argument
5128 const struct sctp_association *asoc, in sctp_sf_do_9_2_prm_shutdown() argument
5147 if (sctp_outq_is_empty(&asoc->outqueue)) { in sctp_sf_do_9_2_prm_shutdown()
5148 disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type, in sctp_sf_do_9_2_prm_shutdown()
5185 const struct sctp_association *asoc, in sctp_sf_do_9_1_prm_abort() argument
5222 const struct sctp_association *asoc, in sctp_sf_error_closed() argument
5237 const struct sctp_association *asoc, in sctp_sf_error_shutdown() argument
5264 const struct sctp_association *asoc, in sctp_sf_cookie_wait_prm_shutdown() argument
5299 const struct sctp_association *asoc, in sctp_sf_cookie_echoed_prm_shutdown() argument
5307 return sctp_sf_cookie_wait_prm_shutdown(net, ep, asoc, type, arg, commands); in sctp_sf_cookie_echoed_prm_shutdown()
5327 const struct sctp_association *asoc, in sctp_sf_cookie_wait_prm_abort() argument
5376 const struct sctp_association *asoc, in sctp_sf_cookie_echoed_prm_abort() argument
5384 return sctp_sf_cookie_wait_prm_abort(net, ep, asoc, type, arg, commands); in sctp_sf_cookie_echoed_prm_abort()
5402 const struct sctp_association *asoc, in sctp_sf_shutdown_pending_prm_abort() argument
5411 return sctp_sf_do_9_1_prm_abort(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_pending_prm_abort()
5429 const struct sctp_association *asoc, in sctp_sf_shutdown_sent_prm_abort() argument
5442 return sctp_sf_do_9_1_prm_abort(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_sent_prm_abort()
5460 const struct sctp_association *asoc, in sctp_sf_shutdown_ack_sent_prm_abort() argument
5468 return sctp_sf_shutdown_sent_prm_abort(net, ep, asoc, type, arg, commands); in sctp_sf_shutdown_ack_sent_prm_abort()
5496 const struct sctp_association *asoc, in sctp_sf_do_prm_requestheartbeat() argument
5501 if (SCTP_DISPOSITION_NOMEM == sctp_sf_heartbeat(ep, asoc, type, in sctp_sf_do_prm_requestheartbeat()
5528 const struct sctp_association *asoc, in sctp_sf_do_prm_asconf() argument
5545 const struct sctp_association *asoc, in sctp_sf_do_prm_reconf() argument
5564 const struct sctp_association *asoc, in sctp_sf_ignore_primitive() argument
5588 const struct sctp_association *asoc, in sctp_sf_do_no_pending_tsn() argument
5595 event = sctp_ulpevent_make_sender_dry_event(asoc, GFP_ATOMIC); in sctp_sf_do_no_pending_tsn()
5620 const struct sctp_association *asoc, in sctp_sf_do_9_2_start_shutdown() argument
5632 reply = sctp_make_shutdown(asoc, arg); in sctp_sf_do_9_2_start_shutdown()
5652 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) in sctp_sf_do_9_2_start_shutdown()
5690 const struct sctp_association *asoc, in sctp_sf_do_9_2_shutdown_ack() argument
5706 if (!sctp_vtag_verify(chunk, asoc)) in sctp_sf_do_9_2_shutdown_ack()
5707 return sctp_sf_pdiscard(net, ep, asoc, type, arg, in sctp_sf_do_9_2_shutdown_ack()
5713 return sctp_sf_violation_chunklen(net, ep, asoc, type, in sctp_sf_do_9_2_shutdown_ack()
5720 reply = sctp_make_shutdown_ack(asoc, chunk); in sctp_sf_do_9_2_shutdown_ack()
5733 if (asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE]) in sctp_sf_do_9_2_shutdown_ack()
5763 const struct sctp_association *asoc, in sctp_sf_ignore_other() argument
5791 const struct sctp_association *asoc, in sctp_sf_do_6_3_3_rtx() argument
5800 if (asoc->overall_error_count >= asoc->max_retrans) { in sctp_sf_do_6_3_3_rtx()
5801 if (asoc->peer.zero_window_announced && in sctp_sf_do_6_3_3_rtx()
5802 asoc->state == SCTP_STATE_SHUTDOWN_PENDING) { in sctp_sf_do_6_3_3_rtx()
5879 const struct sctp_association *asoc, in sctp_sf_do_6_2_sack() argument
5911 const struct sctp_association *asoc, in sctp_sf_t1_init_timer_expire() argument
5916 int attempts = asoc->init_err_counter + 1; in sctp_sf_t1_init_timer_expire()
5924 if (attempts <= asoc->max_init_attempts) { in sctp_sf_t1_init_timer_expire()
5925 bp = (struct sctp_bind_addr *) &asoc->base.bind_addr; in sctp_sf_t1_init_timer_expire()
5926 repl = sctp_make_init(asoc, bp, GFP_ATOMIC, 0); in sctp_sf_t1_init_timer_expire()
5942 asoc->max_init_attempts); in sctp_sf_t1_init_timer_expire()
5976 const struct sctp_association *asoc, in sctp_sf_t1_cookie_timer_expire() argument
5981 int attempts = asoc->init_err_counter + 1; in sctp_sf_t1_cookie_timer_expire()
5988 if (attempts <= asoc->max_init_attempts) { in sctp_sf_t1_cookie_timer_expire()
5989 repl = sctp_make_cookie_echo(asoc, NULL); in sctp_sf_t1_cookie_timer_expire()
6027 const struct sctp_association *asoc, in sctp_sf_t2_timer_expire() argument
6038 ((struct sctp_association *)asoc)->shutdown_retries++; in sctp_sf_t2_timer_expire()
6040 if (asoc->overall_error_count >= asoc->max_retrans) { in sctp_sf_t2_timer_expire()
6051 switch (asoc->state) { in sctp_sf_t2_timer_expire()
6053 reply = sctp_make_shutdown(asoc, NULL); in sctp_sf_t2_timer_expire()
6057 reply = sctp_make_shutdown_ack(asoc, NULL); in sctp_sf_t2_timer_expire()
6072 if (asoc->shutdown_last_sent_to) in sctp_sf_t2_timer_expire()
6074 SCTP_TRANSPORT(asoc->shutdown_last_sent_to)); in sctp_sf_t2_timer_expire()
6098 const struct sctp_association *asoc, in sctp_sf_t4_timer_expire() argument
6103 struct sctp_chunk *chunk = asoc->addip_last_asconf; in sctp_sf_t4_timer_expire()
6124 if (asoc->overall_error_count >= asoc->max_retrans) { in sctp_sf_t4_timer_expire()
6147 sctp_chunk_hold(asoc->addip_last_asconf); in sctp_sf_t4_timer_expire()
6149 SCTP_CHUNK(asoc->addip_last_asconf)); in sctp_sf_t4_timer_expire()
6170 const struct sctp_association *asoc, in sctp_sf_t5_timer_expire() argument
6181 reply = sctp_make_abort(asoc, NULL, 0); in sctp_sf_t5_timer_expire()
6207 const struct sctp_association *asoc, in sctp_sf_autoclose_timer_expire() argument
6228 if (sctp_outq_is_empty(&asoc->outqueue)) { in sctp_sf_autoclose_timer_expire()
6229 disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type, in sctp_sf_autoclose_timer_expire()
6250 const struct sctp_association *asoc, in sctp_sf_not_impl() argument
6267 const struct sctp_association *asoc, in sctp_sf_bug() argument
6287 const struct sctp_association *asoc, in sctp_sf_timer_ignore() argument
6332 const struct sctp_association *asoc, in sctp_abort_pkt_new() argument
6339 packet = sctp_ootb_pkt_new(net, asoc, chunk); in sctp_abort_pkt_new()
6345 abort = sctp_make_abort(asoc, chunk, paylen); in sctp_abort_pkt_new()
6373 const struct sctp_association *asoc, in sctp_ootb_pkt_new() argument
6388 if (asoc) { in sctp_ootb_pkt_new()
6403 vtag = asoc->peer.i.init_tag; in sctp_ootb_pkt_new()
6457 const struct sctp_association *asoc, in sctp_send_stale_cookie_err() argument
6465 packet = sctp_ootb_pkt_new(net, asoc, chunk); in sctp_send_stale_cookie_err()
6486 static int sctp_eat_data(const struct sctp_association *asoc, in sctp_eat_data() argument
6490 struct sctp_tsnmap *map = (struct sctp_tsnmap *)&asoc->peer.tsn_map; in sctp_eat_data()
6491 struct sock *sk = asoc->base.sk; in sctp_eat_data()
6502 skb_pull(chunk->skb, sctp_datahdr_len(&asoc->stream)); in sctp_eat_data()
6519 if (asoc->peer.ecn_capable && !chunk->ecn_ce_done) { in sctp_eat_data()
6530 tmp = sctp_tsnmap_check(&asoc->peer.tsn_map, tsn); in sctp_eat_data()
6535 if (chunk->asoc) in sctp_eat_data()
6536 chunk->asoc->stats.outofseqtsns++; in sctp_eat_data()
6550 datalen -= sctp_datachk_len(&asoc->stream); in sctp_eat_data()
6555 if ((datalen >= asoc->rwnd) && (!asoc->ulpq.pd_mode)) { in sctp_eat_data()
6568 if ((!chunk->data_accepted) && (!asoc->rwnd || asoc->rwnd_over || in sctp_eat_data()
6569 (datalen > asoc->rwnd + asoc->frag_point))) { in sctp_eat_data()
6583 __func__, tsn, datalen, asoc->rwnd); in sctp_eat_data()
6614 err = sctp_make_abort_no_data(asoc, chunk, tsn); in sctp_eat_data()
6639 if (chunk->asoc) in sctp_eat_data()
6640 chunk->asoc->stats.iuodchunks++; in sctp_eat_data()
6643 if (chunk->asoc) in sctp_eat_data()
6644 chunk->asoc->stats.iodchunks++; in sctp_eat_data()
6655 if (ntohs(data_hdr->stream) >= asoc->stream.incnt) { in sctp_eat_data()
6659 err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM, in sctp_eat_data()
6676 if (!asoc->stream.si->validate_data(chunk)) in sctp_eat_data()