• Home
  • Raw
  • Download

Lines Matching refs:asoc

49 static struct sctp_chunk *sctp_make_control(const struct sctp_association *asoc,
52 static struct sctp_chunk *sctp_make_data(const struct sctp_association *asoc,
54 static struct sctp_chunk *_sctp_make_chunk(const struct sctp_association *asoc,
59 const struct sctp_association *asoc,
63 static int sctp_process_param(struct sctp_association *asoc,
77 struct sctp_association *asoc = chunk->asoc; in sctp_control_release_owner() local
87 ev = sctp_ulpevent_make_authkey(asoc, shkey->key_id, in sctp_control_release_owner()
91 asoc->stream.si->enqueue_event(&asoc->ulpq, ev); in sctp_control_release_owner()
99 struct sctp_association *asoc = chunk->asoc; in sctp_control_set_owner_w() local
110 chunk->shkey = asoc->shkey; in sctp_control_set_owner_w()
113 skb->sk = asoc ? asoc->base.sk : NULL; in sctp_control_set_owner_w()
206 struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, in sctp_make_init() argument
215 struct sctp_endpoint *ep = asoc->ep; in sctp_make_init()
235 init.init_tag = htonl(asoc->c.my_vtag); in sctp_make_init()
236 init.a_rwnd = htonl(asoc->rwnd); in sctp_make_init()
237 init.num_outbound_streams = htons(asoc->c.sinit_num_ostreams); in sctp_make_init()
238 init.num_inbound_streams = htons(asoc->c.sinit_max_instreams); in sctp_make_init()
239 init.initial_tsn = htonl(asoc->c.initial_tsn); in sctp_make_init()
242 sp = sctp_sk(asoc->base.sk); in sctp_make_init()
248 if (asoc->ep->ecn_enable) in sctp_make_init()
251 if (asoc->ep->prsctp_enable) in sctp_make_init()
259 if (asoc->ep->asconf_enable) { in sctp_make_init()
265 if (asoc->ep->reconf_enable) { in sctp_make_init()
273 if (asoc->ep->intl_enable) { in sctp_make_init()
283 chunksize += sizeof(asoc->c.auth_random); in sctp_make_init()
286 auth_hmacs = (struct sctp_paramhdr *)asoc->c.auth_hmacs; in sctp_make_init()
293 auth_chunks = (struct sctp_paramhdr *)asoc->c.auth_chunks; in sctp_make_init()
319 retval = sctp_make_control(asoc, SCTP_CID_INIT, 0, chunksize, gfp); in sctp_make_init()
340 if (asoc->ep->ecn_enable) in sctp_make_init()
353 if (asoc->ep->prsctp_enable) in sctp_make_init()
365 sctp_addto_chunk(retval, sizeof(asoc->c.auth_random), in sctp_make_init()
366 asoc->c.auth_random); in sctp_make_init()
379 struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, in sctp_make_init_ack() argument
400 addrs = sctp_bind_addrs_to_raw(&asoc->base.bind_addr, &addrs_len, gfp); in sctp_make_init_ack()
402 initack.init_tag = htonl(asoc->c.my_vtag); in sctp_make_init_ack()
403 initack.a_rwnd = htonl(asoc->rwnd); in sctp_make_init_ack()
404 initack.num_outbound_streams = htons(asoc->c.sinit_num_ostreams); in sctp_make_init_ack()
405 initack.num_inbound_streams = htons(asoc->c.sinit_max_instreams); in sctp_make_init_ack()
406 initack.initial_tsn = htonl(asoc->c.initial_tsn); in sctp_make_init_ack()
411 cookie = sctp_pack_cookie(asoc->ep, asoc, chunk, &cookie_len, in sctp_make_init_ack()
419 sp = sctp_sk(asoc->base.sk); in sctp_make_init_ack()
423 if (asoc->peer.ecn_capable) in sctp_make_init_ack()
426 if (asoc->peer.prsctp_capable) in sctp_make_init_ack()
429 if (asoc->peer.asconf_capable) { in sctp_make_init_ack()
435 if (asoc->peer.reconf_capable) { in sctp_make_init_ack()
443 if (asoc->peer.intl_capable) { in sctp_make_init_ack()
448 if (asoc->peer.auth_capable) { in sctp_make_init_ack()
449 auth_random = (struct sctp_paramhdr *)asoc->c.auth_random; in sctp_make_init_ack()
452 auth_hmacs = (struct sctp_paramhdr *)asoc->c.auth_hmacs; in sctp_make_init_ack()
458 auth_chunks = (struct sctp_paramhdr *)asoc->c.auth_chunks; in sctp_make_init_ack()
472 retval = sctp_make_control(asoc, SCTP_CID_INIT_ACK, 0, chunksize, gfp); in sctp_make_init_ack()
487 sctp_assoc_lookup_paddr(asoc, in sctp_make_init_ack()
494 if (asoc->peer.ecn_capable) in sctp_make_init_ack()
502 if (asoc->peer.prsctp_capable) in sctp_make_init_ack()
512 if (asoc->peer.auth_capable) { in sctp_make_init_ack()
524 retval->asoc = (struct sctp_association *) asoc; in sctp_make_init_ack()
567 struct sctp_chunk *sctp_make_cookie_echo(const struct sctp_association *asoc, in sctp_make_cookie_echo() argument
574 cookie = asoc->peer.cookie; in sctp_make_cookie_echo()
575 cookie_len = asoc->peer.cookie_len; in sctp_make_cookie_echo()
578 retval = sctp_make_control(asoc, SCTP_CID_COOKIE_ECHO, 0, in sctp_make_cookie_echo()
619 struct sctp_chunk *sctp_make_cookie_ack(const struct sctp_association *asoc, in sctp_make_cookie_ack() argument
624 retval = sctp_make_control(asoc, SCTP_CID_COOKIE_ACK, 0, 0, GFP_ATOMIC); in sctp_make_cookie_ack()
637 sctp_assoc_lookup_paddr(asoc, in sctp_make_cookie_ack()
666 struct sctp_chunk *sctp_make_cwr(const struct sctp_association *asoc, in sctp_make_cwr() argument
674 retval = sctp_make_control(asoc, SCTP_CID_ECN_CWR, 0, in sctp_make_cwr()
701 struct sctp_chunk *sctp_make_ecne(const struct sctp_association *asoc, in sctp_make_ecne() argument
708 retval = sctp_make_control(asoc, SCTP_CID_ECN_ECNE, 0, in sctp_make_ecne()
722 struct sctp_chunk *sctp_make_datafrag_empty(const struct sctp_association *asoc, in sctp_make_datafrag_empty() argument
740 retval = sctp_make_data(asoc, flags, sizeof(dp) + len, gfp); in sctp_make_datafrag_empty()
754 struct sctp_chunk *sctp_make_sack(struct sctp_association *asoc) in sctp_make_sack() argument
756 struct sctp_tsnmap *map = (struct sctp_tsnmap *)&asoc->peer.tsn_map; in sctp_make_sack()
776 sack.a_rwnd = htonl(asoc->a_rwnd); in sctp_make_sack()
785 retval = sctp_make_control(asoc, SCTP_CID_SACK, 0, len, GFP_ATOMIC); in sctp_make_sack()
819 retval->transport = asoc->peer.last_data_from; in sctp_make_sack()
831 asoc->stats.idupchunks += num_dup_tsns; in sctp_make_sack()
843 if (++asoc->peer.sack_generation == 0) { in sctp_make_sack()
844 list_for_each_entry(trans, &asoc->peer.transport_addr_list, in sctp_make_sack()
847 asoc->peer.sack_generation = 1; in sctp_make_sack()
854 struct sctp_chunk *sctp_make_shutdown(const struct sctp_association *asoc, in sctp_make_shutdown() argument
861 ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); in sctp_make_shutdown()
864 retval = sctp_make_control(asoc, SCTP_CID_SHUTDOWN, 0, in sctp_make_shutdown()
878 struct sctp_chunk *sctp_make_shutdown_ack(const struct sctp_association *asoc, in sctp_make_shutdown_ack() argument
883 retval = sctp_make_control(asoc, SCTP_CID_SHUTDOWN_ACK, 0, 0, in sctp_make_shutdown_ack()
902 const struct sctp_association *asoc, in sctp_make_shutdown_complete() argument
911 flags |= asoc ? 0 : SCTP_CHUNK_FLAG_T; in sctp_make_shutdown_complete()
913 retval = sctp_make_control(asoc, SCTP_CID_SHUTDOWN_COMPLETE, flags, in sctp_make_shutdown_complete()
935 struct sctp_chunk *sctp_make_abort(const struct sctp_association *asoc, in sctp_make_abort() argument
945 if (!asoc) { in sctp_make_abort()
953 retval = sctp_make_control(asoc, SCTP_CID_ABORT, flags, hint, in sctp_make_abort()
973 const struct sctp_association *asoc, in sctp_make_abort_no_data() argument
980 retval = sctp_make_abort(asoc, chunk, in sctp_make_abort_no_data()
1008 struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *asoc, in sctp_make_abort_user() argument
1016 retval = sctp_make_abort(asoc, NULL, in sctp_make_abort_user()
1074 const struct sctp_association *asoc, in sctp_make_abort_violation() argument
1082 retval = sctp_make_abort(asoc, chunk, sizeof(struct sctp_errhdr) + in sctp_make_abort_violation()
1100 const struct sctp_association *asoc, in sctp_make_violation_paramlen() argument
1109 retval = sctp_make_abort(asoc, chunk, payload_len); in sctp_make_violation_paramlen()
1123 const struct sctp_association *asoc, in sctp_make_violation_max_retrans() argument
1130 retval = sctp_make_abort(asoc, chunk, payload_len); in sctp_make_violation_max_retrans()
1141 struct sctp_chunk *sctp_make_new_encap_port(const struct sctp_association *asoc, in sctp_make_new_encap_port() argument
1147 retval = sctp_make_abort(asoc, chunk, in sctp_make_new_encap_port()
1162 struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *asoc, in sctp_make_heartbeat() argument
1169 retval = sctp_make_control(asoc, SCTP_CID_HEARTBEAT, 0, in sctp_make_heartbeat()
1194 struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *asoc, in sctp_make_heartbeat_ack() argument
1201 retval = sctp_make_control(asoc, SCTP_CID_HEARTBEAT_ACK, 0, paylen, in sctp_make_heartbeat_ack()
1235 struct sctp_chunk *sctp_make_pad(const struct sctp_association *asoc, int len) in sctp_make_pad() argument
1239 retval = sctp_make_control(asoc, SCTP_CID_PAD, 0, len, GFP_ATOMIC); in sctp_make_pad()
1254 const struct sctp_association *asoc, in sctp_make_op_error_space() argument
1260 retval = sctp_make_control(asoc, SCTP_CID_ERROR, 0, in sctp_make_op_error_space()
1289 const struct sctp_association *asoc, in sctp_make_op_error_limited() argument
1295 if (asoc) { in sctp_make_op_error_limited()
1296 size = min_t(size_t, size, asoc->pathmtu); in sctp_make_op_error_limited()
1297 sp = sctp_sk(asoc->base.sk); in sctp_make_op_error_limited()
1302 return sctp_make_op_error_space(asoc, chunk, size); in sctp_make_op_error_limited()
1306 struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc, in sctp_make_op_error() argument
1313 retval = sctp_make_op_error_space(asoc, chunk, paylen + reserve_tail); in sctp_make_op_error()
1326 struct sctp_chunk *sctp_make_auth(const struct sctp_association *asoc, in sctp_make_auth() argument
1334 hmac_desc = sctp_auth_asoc_get_hmac(asoc); in sctp_make_auth()
1338 retval = sctp_make_control(asoc, SCTP_CID_AUTH, 0, in sctp_make_auth()
1376 const struct sctp_association *asoc, in sctp_chunkify() argument
1390 retval->asoc = (struct sctp_association *)asoc; in sctp_chunkify()
1428 static struct sctp_chunk *_sctp_make_chunk(const struct sctp_association *asoc, in _sctp_make_chunk() argument
1453 sk = asoc ? asoc->base.sk : NULL; in _sctp_make_chunk()
1454 retval = sctp_chunkify(skb, asoc, sk, gfp); in _sctp_make_chunk()
1464 if (sctp_auth_send_cid(type, asoc)) in _sctp_make_chunk()
1472 static struct sctp_chunk *sctp_make_data(const struct sctp_association *asoc, in sctp_make_data() argument
1475 return _sctp_make_chunk(asoc, SCTP_CID_DATA, flags, paylen, gfp); in sctp_make_data()
1478 struct sctp_chunk *sctp_make_idata(const struct sctp_association *asoc, in sctp_make_idata() argument
1481 return _sctp_make_chunk(asoc, SCTP_CID_I_DATA, flags, paylen, gfp); in sctp_make_idata()
1484 static struct sctp_chunk *sctp_make_control(const struct sctp_association *asoc, in sctp_make_control() argument
1490 chunk = _sctp_make_chunk(asoc, type, flags, paylen, gfp); in sctp_make_control()
1591 stream = &chunk->asoc->stream; in sctp_chunk_assign_ssn()
1622 htonl(sctp_association_get_next_tsn(chunk->asoc)); in sctp_chunk_assign_tsn()
1632 struct sctp_association *asoc; in sctp_make_temp_asoc() local
1638 asoc = sctp_association_new(ep, ep->base.sk, scope, gfp); in sctp_make_temp_asoc()
1639 if (!asoc) in sctp_make_temp_asoc()
1641 asoc->temp = 1; in sctp_make_temp_asoc()
1644 SCTP_INPUT_CB(skb)->af->from_skb(&asoc->c.peer_addr, skb, 1); in sctp_make_temp_asoc()
1647 return asoc; in sctp_make_temp_asoc()
1655 const struct sctp_association *asoc, in sctp_pack_cookie() argument
1695 cookie->c = asoc->c; in sctp_pack_cookie()
1700 cookie->c.prsctp_capable = asoc->peer.prsctp_capable; in sctp_pack_cookie()
1703 cookie->c.adaptation_ind = asoc->peer.adaptation_ind; in sctp_pack_cookie()
1706 cookie->c.expiration = ktime_add(asoc->cookie_life, in sctp_pack_cookie()
1742 const struct sctp_association *asoc, in sctp_unpack_cookie() argument
1836 if (!asoc && ktime_before(bear_cookie->expiration, kt)) { in sctp_unpack_cookie()
1848 *errp = sctp_make_op_error(asoc, chunk, in sctp_unpack_cookie()
1923 static int sctp_process_missing_param(const struct sctp_association *asoc, in sctp_process_missing_param() argument
1937 *errp = sctp_make_op_error_space(asoc, chunk, len); in sctp_process_missing_param()
1952 static int sctp_process_inv_mandatory(const struct sctp_association *asoc, in sctp_process_inv_mandatory() argument
1959 *errp = sctp_make_op_error_space(asoc, chunk, 0); in sctp_process_inv_mandatory()
1968 static int sctp_process_inv_paramlength(const struct sctp_association *asoc, in sctp_process_inv_paramlength() argument
1980 *errp = sctp_make_violation_paramlen(asoc, chunk, param); in sctp_process_inv_paramlength()
1989 static int sctp_process_hn_param(const struct sctp_association *asoc, in sctp_process_hn_param() argument
2004 *errp = sctp_make_op_error(asoc, chunk, SCTP_ERROR_DNS_FAILED, in sctp_process_hn_param()
2046 static void sctp_process_ext_param(struct sctp_association *asoc, in sctp_process_ext_param() argument
2055 if (asoc->ep->reconf_enable) in sctp_process_ext_param()
2056 asoc->peer.reconf_capable = 1; in sctp_process_ext_param()
2059 if (asoc->ep->prsctp_enable) in sctp_process_ext_param()
2060 asoc->peer.prsctp_capable = 1; in sctp_process_ext_param()
2066 if (asoc->ep->auth_enable) in sctp_process_ext_param()
2067 asoc->peer.auth_capable = 1; in sctp_process_ext_param()
2071 if (asoc->ep->asconf_enable) in sctp_process_ext_param()
2072 asoc->peer.asconf_capable = 1; in sctp_process_ext_param()
2075 if (asoc->ep->intl_enable) in sctp_process_ext_param()
2076 asoc->peer.intl_capable = 1; in sctp_process_ext_param()
2110 const struct sctp_association *asoc, in sctp_process_unk_param() argument
2131 *errp = sctp_make_op_error_limited(asoc, chunk); in sctp_process_unk_param()
2164 const struct sctp_association *asoc, in sctp_verify_param() argument
2203 sctp_process_inv_paramlength(asoc, param.p, in sctp_verify_param()
2211 sctp_process_hn_param(asoc, param, chunk, err_chunk); in sctp_verify_param()
2231 sctp_process_inv_paramlength(asoc, param.p, in sctp_verify_param()
2247 sctp_process_inv_paramlength(asoc, param.p, in sctp_verify_param()
2273 sctp_process_inv_paramlength(asoc, param.p, chunk, in sctp_verify_param()
2283 retval = sctp_process_unk_param(asoc, param, chunk, err_chunk); in sctp_verify_param()
2291 const struct sctp_association *asoc, enum sctp_cid cid, in sctp_verify_init() argument
2307 return sctp_process_inv_mandatory(asoc, chunk, errp); in sctp_verify_init()
2322 return sctp_process_inv_paramlength(asoc, param.p, chunk, errp); in sctp_verify_init()
2328 return sctp_process_missing_param(asoc, SCTP_PARAM_STATE_COOKIE, in sctp_verify_init()
2333 result = sctp_verify_param(net, ep, asoc, param, cid, in sctp_verify_init()
2355 int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk, in sctp_process_init() argument
2376 asoc->encap_port = SCTP_INPUT_CB(chunk->skb)->encap_port; in sctp_process_init()
2377 if (!sctp_assoc_add_peer(asoc, peer_addr, gfp, SCTP_ACTIVE)) in sctp_process_init()
2396 if (!sctp_process_param(asoc, param, peer_addr, gfp)) in sctp_process_init()
2407 if (asoc->peer.auth_capable && (!asoc->peer.peer_random || in sctp_process_init()
2408 !asoc->peer.peer_hmacs)) in sctp_process_init()
2409 asoc->peer.auth_capable = 0; in sctp_process_init()
2417 if (!asoc->base.net->sctp.addip_noauth && in sctp_process_init()
2418 (asoc->peer.asconf_capable && !asoc->peer.auth_capable)) { in sctp_process_init()
2419 asoc->peer.addip_disabled_mask |= (SCTP_PARAM_ADD_IP | in sctp_process_init()
2422 asoc->peer.asconf_capable = 0; in sctp_process_init()
2427 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { in sctp_process_init()
2430 sctp_assoc_rm_peer(asoc, transport); in sctp_process_init()
2437 asoc->peer.i.init_tag = in sctp_process_init()
2439 asoc->peer.i.a_rwnd = in sctp_process_init()
2441 asoc->peer.i.num_outbound_streams = in sctp_process_init()
2443 asoc->peer.i.num_inbound_streams = in sctp_process_init()
2445 asoc->peer.i.initial_tsn = in sctp_process_init()
2448 asoc->strreset_inseq = asoc->peer.i.initial_tsn; in sctp_process_init()
2453 if (asoc->c.sinit_num_ostreams > in sctp_process_init()
2455 asoc->c.sinit_num_ostreams = in sctp_process_init()
2459 if (asoc->c.sinit_max_instreams > in sctp_process_init()
2461 asoc->c.sinit_max_instreams = in sctp_process_init()
2466 asoc->c.peer_vtag = asoc->peer.i.init_tag; in sctp_process_init()
2469 asoc->peer.rwnd = asoc->peer.i.a_rwnd; in sctp_process_init()
2475 list_for_each_entry(transport, &asoc->peer.transport_addr_list, in sctp_process_init()
2477 transport->ssthresh = asoc->peer.i.a_rwnd; in sctp_process_init()
2481 if (!sctp_tsnmap_init(&asoc->peer.tsn_map, SCTP_TSN_MAP_INITIAL, in sctp_process_init()
2482 asoc->peer.i.initial_tsn, gfp)) in sctp_process_init()
2493 if (sctp_stream_init(&asoc->stream, asoc->c.sinit_num_ostreams, in sctp_process_init()
2494 asoc->c.sinit_max_instreams, gfp)) in sctp_process_init()
2498 sctp_assoc_update_frag_point(asoc); in sctp_process_init()
2500 if (!asoc->temp && sctp_assoc_set_id(asoc, gfp)) in sctp_process_init()
2513 asoc->peer.addip_serial = asoc->peer.i.initial_tsn - 1; in sctp_process_init()
2518 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { in sctp_process_init()
2521 sctp_assoc_rm_peer(asoc, transport); in sctp_process_init()
2540 static int sctp_process_param(struct sctp_association *asoc, in sctp_process_param() argument
2545 struct sctp_endpoint *ep = asoc->ep; in sctp_process_param()
2547 struct net *net = asoc->base.net; in sctp_process_param()
2562 if (PF_INET6 != asoc->base.sk->sk_family) in sctp_process_param()
2568 if (ipv6_only_sock(asoc->base.sk)) in sctp_process_param()
2572 if (!af->from_addr_param(&addr, param.addr, htons(asoc->peer.port), 0)) in sctp_process_param()
2576 if (!sctp_assoc_add_peer(asoc, &addr, gfp, SCTP_UNCONFIRMED)) in sctp_process_param()
2589 asoc->cookie_life = ktime_add_ms(asoc->cookie_life, stale); in sctp_process_param()
2600 asoc->peer.ipv4_address = 0; in sctp_process_param()
2601 asoc->peer.ipv6_address = 0; in sctp_process_param()
2607 asoc->peer.ipv6_address = 1; in sctp_process_param()
2609 asoc->peer.ipv4_address = 1; in sctp_process_param()
2619 asoc->peer.ipv4_address = 1; in sctp_process_param()
2623 if (PF_INET6 == asoc->base.sk->sk_family) in sctp_process_param()
2624 asoc->peer.ipv6_address = 1; in sctp_process_param()
2628 asoc->peer.hostname_address = 1; in sctp_process_param()
2638 asoc->peer.cookie_len = in sctp_process_param()
2640 kfree(asoc->peer.cookie); in sctp_process_param()
2641 asoc->peer.cookie = kmemdup(param.cookie->body, asoc->peer.cookie_len, gfp); in sctp_process_param()
2642 if (!asoc->peer.cookie) in sctp_process_param()
2655 if (asoc->ep->ecn_enable) { in sctp_process_param()
2656 asoc->peer.ecn_capable = 1; in sctp_process_param()
2664 asoc->peer.adaptation_ind = ntohl(param.aind->adaptation_ind); in sctp_process_param()
2678 htons(asoc->peer.port), 0)) in sctp_process_param()
2684 t = sctp_assoc_lookup_paddr(asoc, &addr); in sctp_process_param()
2688 sctp_assoc_set_primary(asoc, t); in sctp_process_param()
2692 sctp_process_ext_param(asoc, param); in sctp_process_param()
2696 if (asoc->ep->prsctp_enable) { in sctp_process_param()
2697 asoc->peer.prsctp_capable = 1; in sctp_process_param()
2708 kfree(asoc->peer.peer_random); in sctp_process_param()
2709 asoc->peer.peer_random = kmemdup(param.p, in sctp_process_param()
2711 if (!asoc->peer.peer_random) { in sctp_process_param()
2722 kfree(asoc->peer.peer_hmacs); in sctp_process_param()
2723 asoc->peer.peer_hmacs = kmemdup(param.p, in sctp_process_param()
2725 if (!asoc->peer.peer_hmacs) { in sctp_process_param()
2731 sctp_auth_asoc_set_default_hmac(asoc, param.hmac_algo); in sctp_process_param()
2738 kfree(asoc->peer.peer_chunks); in sctp_process_param()
2739 asoc->peer.peer_chunks = kmemdup(param.p, in sctp_process_param()
2741 if (!asoc->peer.peer_chunks) in sctp_process_param()
2752 __func__, ntohs(param.p->type), asoc); in sctp_process_param()
2805 static struct sctp_chunk *sctp_make_asconf(struct sctp_association *asoc, in sctp_make_asconf() argument
2822 retval = sctp_make_control(asoc, SCTP_CID_ASCONF, 0, length, in sctp_make_asconf()
2827 asconf.serial = htonl(asoc->addip_serial++); in sctp_make_asconf()
2861 struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc, in sctp_make_asconf_update_ip() argument
2888 if (asoc->asconf_addr_del_pending && !del_pickup) { in sctp_make_asconf_update_ip()
2901 retval = sctp_make_asconf(asoc, laddr, totallen); in sctp_make_asconf_update_ip()
2921 addr = asoc->asconf_addr_del_pending; in sctp_make_asconf_update_ip()
2948 struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc, in sctp_make_asconf_set_prim() argument
2964 retval = sctp_make_asconf(asoc, addr, len); in sctp_make_asconf_set_prim()
2997 static struct sctp_chunk *sctp_make_asconf_ack(const struct sctp_association *asoc, in sctp_make_asconf_ack() argument
3005 retval = sctp_make_control(asoc, SCTP_CID_ASCONF_ACK, 0, length, in sctp_make_asconf_ack()
3061 static __be16 sctp_process_asconf_param(struct sctp_association *asoc, in sctp_process_asconf_param() argument
3079 if (!asoc->peer.ipv6_address) in sctp_process_asconf_param()
3083 if (!asoc->peer.ipv4_address) in sctp_process_asconf_param()
3094 if (!af->from_addr_param(&addr, addr_param, htons(asoc->peer.port), 0)) in sctp_process_asconf_param()
3114 if (security_sctp_bind_connect(asoc->ep->base.sk, in sctp_process_asconf_param()
3127 peer = sctp_assoc_add_peer(asoc, &addr, GFP_ATOMIC, SCTP_UNCONFIRMED); in sctp_process_asconf_param()
3133 asoc->new_transport = peer; in sctp_process_asconf_param()
3141 if (asoc->peer.transport_count == 1) in sctp_process_asconf_param()
3160 sctp_assoc_set_primary(asoc, asconf->transport); in sctp_process_asconf_param()
3161 sctp_assoc_del_nonprimary_peers(asoc, in sctp_process_asconf_param()
3171 peer = sctp_assoc_lookup_paddr(asoc, &addr); in sctp_process_asconf_param()
3175 sctp_assoc_rm_peer(asoc, peer); in sctp_process_asconf_param()
3186 if (security_sctp_bind_connect(asoc->ep->base.sk, in sctp_process_asconf_param()
3192 peer = sctp_assoc_lookup_paddr(asoc, &addr); in sctp_process_asconf_param()
3196 sctp_assoc_set_primary(asoc, peer); in sctp_process_asconf_param()
3204 bool sctp_verify_asconf(const struct sctp_association *asoc, in sctp_verify_asconf() argument
3273 struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, in sctp_process_asconf() argument
3308 asconf_ack = sctp_make_asconf_ack(asoc, serial, chunk_len * 4); in sctp_process_asconf()
3319 err_code = sctp_process_asconf_param(asoc, asconf, in sctp_process_asconf()
3343 asoc->peer.addip_serial++; in sctp_process_asconf()
3351 &asoc->asconf_ack_list); in sctp_process_asconf()
3358 static void sctp_asconf_param_success(struct sctp_association *asoc, in sctp_asconf_param_success() argument
3361 struct sctp_bind_addr *bp = &asoc->base.bind_addr; in sctp_asconf_param_success()
3386 list_for_each_entry(transport, &asoc->peer.transport_addr_list, in sctp_asconf_param_success()
3394 if (asoc->asconf_addr_del_pending != NULL && in sctp_asconf_param_success()
3395 sctp_cmp_addr_exact(asoc->asconf_addr_del_pending, &addr)) { in sctp_asconf_param_success()
3396 kfree(asoc->asconf_addr_del_pending); in sctp_asconf_param_success()
3397 asoc->asconf_addr_del_pending = NULL; in sctp_asconf_param_success()
3400 list_for_each_entry(transport, &asoc->peer.transport_addr_list, in sctp_asconf_param_success()
3473 int sctp_process_asconf_ack(struct sctp_association *asoc, in sctp_process_asconf_ack() argument
3476 struct sctp_chunk *asconf = asoc->addip_last_asconf; in sctp_process_asconf_ack()
3522 sctp_asconf_param_success(asoc, asconf_param); in sctp_process_asconf_ack()
3533 asoc->peer.addip_disabled_mask |= in sctp_process_asconf_ack()
3552 if (no_err && asoc->src_out_of_asoc_ok) { in sctp_process_asconf_ack()
3553 asoc->src_out_of_asoc_ok = 0; in sctp_process_asconf_ack()
3554 sctp_transport_immediate_rtx(asoc->peer.primary_path); in sctp_process_asconf_ack()
3560 asoc->addip_last_asconf = NULL; in sctp_process_asconf_ack()
3566 struct sctp_chunk *sctp_make_fwdtsn(const struct sctp_association *asoc, in sctp_make_fwdtsn() argument
3578 retval = sctp_make_control(asoc, SCTP_CID_FWD_TSN, 0, hint, GFP_ATOMIC); in sctp_make_fwdtsn()
3596 struct sctp_chunk *sctp_make_ifwdtsn(const struct sctp_association *asoc, in sctp_make_ifwdtsn() argument
3606 retval = sctp_make_control(asoc, SCTP_CID_I_FWD_TSN, 0, hint, in sctp_make_ifwdtsn()
3635 static struct sctp_chunk *sctp_make_reconf(const struct sctp_association *asoc, in sctp_make_reconf() argument
3641 retval = sctp_make_control(asoc, SCTP_CID_RECONF, 0, length, in sctp_make_reconf()
3687 const struct sctp_association *asoc, in sctp_make_strreset_req() argument
3700 retval = sctp_make_reconf(asoc, SCTP_PAD4(outlen) + SCTP_PAD4(inlen)); in sctp_make_strreset_req()
3707 outreq.request_seq = htonl(asoc->strreset_outseq); in sctp_make_strreset_req()
3708 outreq.response_seq = htonl(asoc->strreset_inseq - 1); in sctp_make_strreset_req()
3709 outreq.send_reset_at_tsn = htonl(asoc->next_tsn - 1); in sctp_make_strreset_req()
3720 inreq.request_seq = htonl(asoc->strreset_outseq + out); in sctp_make_strreset_req()
3741 const struct sctp_association *asoc) in sctp_make_strreset_tsnreq() argument
3747 retval = sctp_make_reconf(asoc, length); in sctp_make_strreset_tsnreq()
3753 tsnreq.request_seq = htonl(asoc->strreset_outseq); in sctp_make_strreset_tsnreq()
3772 const struct sctp_association *asoc, in sctp_make_strreset_addstrm() argument
3779 retval = sctp_make_reconf(asoc, (!!out + !!in) * size); in sctp_make_strreset_addstrm()
3787 addstrm.request_seq = htonl(asoc->strreset_outseq); in sctp_make_strreset_addstrm()
3797 addstrm.request_seq = htonl(asoc->strreset_outseq + !!out); in sctp_make_strreset_addstrm()
3817 struct sctp_chunk *sctp_make_strreset_resp(const struct sctp_association *asoc, in sctp_make_strreset_resp() argument
3824 retval = sctp_make_reconf(asoc, length); in sctp_make_strreset_resp()
3853 struct sctp_chunk *sctp_make_strreset_tsnresp(struct sctp_association *asoc, in sctp_make_strreset_tsnresp() argument
3862 retval = sctp_make_reconf(asoc, length); in sctp_make_strreset_tsnresp()
3879 bool sctp_verify_reconf(const struct sctp_association *asoc, in sctp_verify_reconf() argument