Lines Matching +full:aind +full:-

1 // SPDX-License-Identifier: GPL-2.0-or-later
4 * Copyright (c) 1999-2000 Cisco, Inc.
5 * Copyright (c) 1999-2001 Motorola, Inc.
6 * Copyright (c) 2001-2002 Intel Corp.
16 * lksctp developers <linux-sctp@vger.kernel.org>
73 struct sctp_chunk *chunk = skb_shinfo(skb)->destructor_arg;
75 if (chunk->shkey) {
76 struct sctp_shared_key *shkey = chunk->shkey;
77 struct sctp_association *asoc = chunk->asoc;
83 if (shkey->deactivated && !list_empty(&shkey->key_list) &&
84 refcount_read(&shkey->refcnt) == 2) {
87 ev = sctp_ulpevent_make_authkey(asoc, shkey->key_id,
91 asoc->stream.si->enqueue_event(&asoc->ulpq, ev);
93 sctp_auth_shkey_release(chunk->shkey);
99 struct sctp_association *asoc = chunk->asoc;
100 struct sk_buff *skb = chunk->skb;
109 if (chunk->auth) {
110 chunk->shkey = asoc->shkey;
111 sctp_auth_shkey_hold(chunk->shkey);
113 skb->sk = asoc ? asoc->base.sk : NULL;
114 skb_shinfo(skb)->destructor_arg = chunk;
115 skb->destructor = sctp_control_release_owner;
146 if (skb_tailroom(chunk->skb) < len)
147 return -ENOSPC;
149 chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(err), &err);
161 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
163 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
165 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
167 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
169 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
171 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
173 * / Optional/Variable-Length Parameters /
175 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
182 * ----------------------------------------------
190 * -------------------------------------------------------------
207 struct sctp_endpoint *ep = asoc->ep;
227 init.init_tag = htonl(asoc->c.my_vtag);
228 init.a_rwnd = htonl(asoc->rwnd);
229 init.num_outbound_streams = htons(asoc->c.sinit_num_ostreams);
230 init.num_inbound_streams = htons(asoc->c.sinit_max_instreams);
231 init.initial_tsn = htonl(asoc->c.initial_tsn);
234 sp = sctp_sk(asoc->base.sk);
235 num_types = sp->pf->supported_addrs(sp, types);
240 if (asoc->ep->ecn_enable)
243 if (asoc->ep->prsctp_enable)
248 * the ASCONF,the ASCONF-ACK, and the AUTH chunks in its INIT and
249 * INIT-ACK parameters.
251 if (asoc->ep->asconf_enable) {
257 if (asoc->ep->reconf_enable) {
262 if (sp->adaptation_ind)
265 if (asoc->ep->intl_enable) {
273 if (ep->auth_enable) {
275 chunksize += sizeof(asoc->c.auth_random);
278 auth_hmacs = (struct sctp_paramhdr *)asoc->c.auth_hmacs;
279 if (auth_hmacs->length)
280 chunksize += SCTP_PAD4(ntohs(auth_hmacs->length));
285 auth_chunks = (struct sctp_paramhdr *)asoc->c.auth_chunks;
286 if (auth_chunks->length)
287 chunksize += SCTP_PAD4(ntohs(auth_chunks->length));
315 retval->subh.init_hdr =
317 retval->param_hdr.v =
332 if (asoc->ep->ecn_enable)
345 if (asoc->ep->prsctp_enable)
348 if (sp->adaptation_ind) {
351 aiparam.adaptation_ind = htonl(sp->adaptation_ind);
355 /* Add SCTP-AUTH chunks to the parameter list */
356 if (ep->auth_enable) {
357 sctp_addto_chunk(retval, sizeof(asoc->c.auth_random),
358 asoc->c.auth_random);
360 sctp_addto_chunk(retval, ntohs(auth_hmacs->length),
363 sctp_addto_chunk(retval, ntohs(auth_chunks->length),
392 addrs = sctp_bind_addrs_to_raw(&asoc->base.bind_addr, &addrs_len, gfp);
394 initack.init_tag = htonl(asoc->c.my_vtag);
395 initack.a_rwnd = htonl(asoc->rwnd);
396 initack.num_outbound_streams = htons(asoc->c.sinit_num_ostreams);
397 initack.num_inbound_streams = htons(asoc->c.sinit_max_instreams);
398 initack.initial_tsn = htonl(asoc->c.initial_tsn);
403 cookie = sctp_pack_cookie(asoc->ep, asoc, chunk, &cookie_len,
411 sp = sctp_sk(asoc->base.sk);
415 if (asoc->peer.ecn_capable)
418 if (asoc->peer.prsctp_capable)
421 if (asoc->peer.asconf_capable) {
427 if (asoc->peer.reconf_capable) {
432 if (sp->adaptation_ind)
435 if (asoc->peer.intl_capable) {
440 if (asoc->peer.auth_capable) {
441 auth_random = (struct sctp_paramhdr *)asoc->c.auth_random;
442 chunksize += ntohs(auth_random->length);
444 auth_hmacs = (struct sctp_paramhdr *)asoc->c.auth_hmacs;
445 if (auth_hmacs->length)
446 chunksize += SCTP_PAD4(ntohs(auth_hmacs->length));
450 auth_chunks = (struct sctp_paramhdr *)asoc->c.auth_chunks;
451 if (auth_chunks->length)
452 chunksize += SCTP_PAD4(ntohs(auth_chunks->length));
468 /* RFC 2960 6.4 Multi-homed SCTP Endpoints
477 if (chunk->transport)
478 retval->transport =
480 &chunk->transport->ipaddr);
482 retval->subh.init_hdr =
484 retval->param_hdr.v = sctp_addto_chunk(retval, addrs_len, addrs.v);
486 if (asoc->peer.ecn_capable)
494 if (asoc->peer.prsctp_capable)
497 if (sp->adaptation_ind) {
500 aiparam.adaptation_ind = htonl(sp->adaptation_ind);
504 if (asoc->peer.auth_capable) {
505 sctp_addto_chunk(retval, ntohs(auth_random->length),
508 sctp_addto_chunk(retval, ntohs(auth_hmacs->length),
511 sctp_addto_chunk(retval, ntohs(auth_chunks->length),
516 retval->asoc = (struct sctp_association *) asoc;
535 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
537 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
540 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
566 cookie = asoc->peer.cookie;
567 cookie_len = asoc->peer.cookie_len;
574 retval->subh.cookie_hdr =
577 /* RFC 2960 6.4 Multi-homed SCTP Endpoints
587 retval->transport = chunk->transport;
603 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
605 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
618 /* RFC 2960 6.4 Multi-homed SCTP Endpoints
627 if (retval && chunk && chunk->transport)
628 retval->transport =
630 &chunk->transport->ipaddr);
650 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
652 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
654 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
672 retval->subh.ecn_cwr_hdr =
675 /* RFC 2960 6.4 Multi-homed SCTP Endpoints
686 retval->transport = chunk->transport;
704 retval->subh.ecne_hdr =
725 dp.ppid = sinfo->sinfo_ppid;
726 dp.stream = htons(sinfo->sinfo_stream);
729 if (sinfo->sinfo_flags & SCTP_UNORDERED)
736 retval->subh.data_hdr = sctp_addto_chunk(retval, sizeof(dp), &dp);
737 memcpy(&retval->sinfo, sinfo, sizeof(struct sctp_sndrcvinfo));
748 struct sctp_tsnmap *map = (struct sctp_tsnmap *)&asoc->peer.tsn_map;
768 sack.a_rwnd = htonl(asoc->a_rwnd);
781 /* RFC 2960 6.4 Multi-homed SCTP Endpoints
799 * duplicates. --piggy]
802 * multi- homed endpoint it MAY be beneficial to vary the
805 * from a multi-homed endpoint might indicate that the return
811 retval->transport = asoc->peer.last_data_from;
813 retval->subh.sack_hdr =
823 asoc->stats.idupchunks += num_dup_tsns;
835 if (++asoc->peer.sack_generation == 0) {
836 list_for_each_entry(trans, &asoc->peer.transport_addr_list,
838 trans->sack_generation = 0;
839 asoc->peer.sack_generation = 1;
853 ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map);
861 retval->subh.shutdown_hdr =
865 retval->transport = chunk->transport;
878 /* RFC 2960 6.4 Multi-homed SCTP Endpoints
888 retval->transport = chunk->transport;
900 /* Set the T-bit if we have no association (vtag will be
908 /* RFC 2960 6.4 Multi-homed SCTP Endpoints
919 retval->transport = chunk->transport;
934 /* Set the T-bit if we have no association and 'chunk' is not
938 if (chunk && chunk->chunk_hdr &&
939 chunk->chunk_hdr->type == SCTP_CID_INIT)
948 /* RFC 2960 6.4 Multi-homed SCTP Endpoints
958 retval->transport = chunk->transport;
983 /* RFC 2960 6.4 Multi-homed SCTP Endpoints
993 retval->transport = chunk->transport;
1047 int chunklen = ntohs(chunk->chunk_hdr->length);
1050 target = skb_put(chunk->skb, len);
1058 chunk->chunk_hdr->length = htons(chunklen + len);
1059 chunk->chunk_end = skb_tail_pointer(chunk->skb);
1082 phdr.type = htons(chunk->chunk_hdr->type);
1083 phdr.length = chunk->chunk_hdr->length;
1145 nep.cur_port = SCTP_INPUT_CB(chunk->skb)->encap_port;
1146 nep.new_port = chunk->transport->encap_port;
1169 hbinfo.daddr = transport->ipaddr;
1171 hbinfo.hb_nonce = transport->hb_nonce;
1177 retval->transport = (struct sctp_transport *) transport;
1178 retval->subh.hbs_hdr = sctp_addto_chunk(retval, sizeof(hbinfo),
1180 retval->pmtu_probe = !!probe_size;
1198 retval->subh.hbs_hdr = sctp_addto_chunk(retval, paylen, payload);
1200 /* RFC 2960 6.4 Multi-homed SCTP Endpoints
1210 retval->transport = chunk->transport;
1219 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1221 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1225 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1235 skb_put_zero(retval->skb, len);
1236 retval->chunk_hdr->length = htons(ntohs(retval->chunk_hdr->length) + len);
1237 retval->chunk_end = skb_tail_pointer(retval->skb);
1258 /* RFC 2960 6.4 Multi-homed SCTP Endpoints
1267 retval->transport = chunk->transport;
1274 * min(asoc->pathmtu, SCTP_DEFAULT_MAXSEGMENT) - overheads.
1288 size = min_t(size_t, size, asoc->pathmtu);
1289 sp = sctp_sk(asoc->base.sk);
1331 hmac_desc->hmac_len + sizeof(auth_hdr),
1336 auth_hdr.hmac_id = htons(hmac_desc->hmac_id);
1339 retval->subh.auth_hdr = sctp_addto_chunk(retval, sizeof(auth_hdr),
1342 skb_put_zero(retval->skb, hmac_desc->hmac_len);
1345 retval->chunk_hdr->length =
1346 htons(ntohs(retval->chunk_hdr->length) + hmac_desc->hmac_len);
1347 retval->chunk_end = skb_tail_pointer(retval->skb);
1358 * FIXME: Eventually move the structure directly inside the skb->cb[].
1360 * sctpimpguide-05.txt Section 2.8.2
1380 INIT_LIST_HEAD(&retval->list);
1381 retval->skb = skb;
1382 retval->asoc = (struct sctp_association *)asoc;
1383 retval->singleton = 1;
1385 retval->fast_retransmit = SCTP_CAN_FRTX;
1388 INIT_LIST_HEAD(&retval->transmitted_list);
1389 INIT_LIST_HEAD(&retval->frag_list);
1391 refcount_set(&retval->refcnt, 1);
1397 /* Set chunk->source and dest based on the IP header in chunk->skb. */
1401 memcpy(&chunk->source, src, sizeof(union sctp_addr));
1402 memcpy(&chunk->dest, dest, sizeof(union sctp_addr));
1409 if (chunk->transport) {
1410 return &chunk->transport->ipaddr;
1413 return &chunk->source;
1441 chunk_hdr->type = type;
1442 chunk_hdr->flags = flags;
1443 chunk_hdr->length = htons(sizeof(*chunk_hdr));
1445 sk = asoc ? asoc->base.sk : NULL;
1452 retval->chunk_hdr = chunk_hdr;
1453 retval->chunk_end = ((__u8 *)chunk_hdr) + sizeof(*chunk_hdr);
1457 retval->auth = 1;
1492 BUG_ON(!list_empty(&chunk->list));
1493 list_del_init(&chunk->transmitted_list);
1495 consume_skb(chunk->skb);
1496 consume_skb(chunk->auth_chunk);
1506 if (chunk->msg)
1507 sctp_datamsg_put(chunk->msg);
1515 refcount_inc(&ch->refcnt);
1521 if (refcount_dec_and_test(&ch->refcnt))
1530 int chunklen = ntohs(chunk->chunk_hdr->length);
1531 int padlen = SCTP_PAD4(chunklen) - chunklen;
1534 skb_put_zero(chunk->skb, padlen);
1535 target = skb_put_data(chunk->skb, data, len);
1538 chunk->chunk_hdr->length = htons(chunklen + padlen + len);
1539 chunk->chunk_end = skb_tail_pointer(chunk->skb);
1554 target = skb_put(chunk->skb, len);
1558 return -EFAULT;
1561 chunk->chunk_hdr->length =
1562 htons(ntohs(chunk->chunk_hdr->length) + len);
1563 chunk->chunk_end = skb_tail_pointer(chunk->skb);
1578 if (chunk->has_ssn)
1582 sid = ntohs(chunk->subh.data_hdr->stream);
1583 stream = &chunk->asoc->stream;
1588 msg = chunk->msg;
1589 list_for_each_entry(lchunk, &msg->chunks, frag_list) {
1590 if (lchunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) {
1593 if (lchunk->chunk_hdr->flags & SCTP_DATA_LAST_FRAG)
1599 lchunk->subh.data_hdr->ssn = htons(ssn);
1600 lchunk->has_ssn = 1;
1609 if (!chunk->has_tsn) {
1613 chunk->subh.data_hdr->tsn =
1614 htonl(sctp_association_get_next_tsn(chunk->asoc));
1615 chunk->has_tsn = 1;
1630 asoc = sctp_association_new(ep, ep->base.sk, scope, gfp);
1633 asoc->temp = 1;
1634 skb = chunk->skb;
1636 SCTP_INPUT_CB(skb)->af->from_skb(&asoc->c.peer_addr, skb, 1);
1660 (sizeof(struct sctp_signed_cookie) -
1663 + ntohs(init_chunk->chunk_hdr->length) + addrs_len;
1670 - (bodysize % SCTP_COOKIE_MULTIPLE);
1682 cookie = (struct sctp_signed_cookie *) retval->body;
1685 retval->p.type = SCTP_PARAM_STATE_COOKIE;
1686 retval->p.length = htons(*cookie_len);
1689 cookie->c = asoc->c;
1691 cookie->c.raw_addr_list_len = addrs_len;
1693 /* Remember PR-SCTP capability. */
1694 cookie->c.prsctp_capable = asoc->peer.prsctp_capable;
1697 cookie->c.adaptation_ind = asoc->peer.adaptation_ind;
1700 cookie->c.expiration = ktime_add(asoc->cookie_life,
1704 memcpy(cookie + 1, init_chunk->chunk_hdr,
1705 ntohs(init_chunk->chunk_hdr->length));
1709 ntohs(init_chunk->chunk_hdr->length), raw_addrs, addrs_len);
1712 if (sctp_sk(ep->base.sk)->cookie_auth_enable) {
1713 static_assert(sizeof(cookie->mac) == SHA256_DIGEST_SIZE);
1714 hmac_sha256(&ep->cookie_auth_key, (const u8 *)&cookie->c,
1715 bodysize, cookie->mac);
1731 struct sk_buff *skb = chunk->skb;
1741 (sizeof(struct sctp_signed_cookie) -
1743 bodysize = ntohs(chunk->chunk_hdr->length) - headersize;
1750 len = ntohs(chunk->chunk_hdr->length);
1759 cookie = chunk->subh.cookie_hdr;
1760 bear_cookie = &cookie->c;
1763 if (sctp_sk(ep->base.sk)->cookie_auth_enable) {
1766 hmac_sha256(&ep->cookie_auth_key, (const u8 *)bear_cookie,
1768 static_assert(sizeof(cookie->mac) == sizeof(mac));
1769 if (crypto_memneq(mac, cookie->mac, sizeof(mac))) {
1770 *error = -SCTP_IERROR_BAD_SIG;
1782 if (ntohl(chunk->sctp_hdr->vtag) != bear_cookie->my_vtag) {
1783 *error = -SCTP_IERROR_BAD_TAG;
1787 if (chunk->sctp_hdr->source != bear_cookie->peer_addr.v4.sin_port ||
1788 ntohs(chunk->sctp_hdr->dest) != bear_cookie->my_port) {
1789 *error = -SCTP_IERROR_BAD_PORTS;
1801 if (sock_flag(ep->base.sk, SOCK_TIMESTAMP))
1806 if (!asoc && ktime_before(bear_cookie->expiration, kt)) {
1807 suseconds_t usecs = ktime_to_us(ktime_sub(kt, bear_cookie->expiration));
1814 * ---------------
1822 *error = -SCTP_IERROR_STALE_COOKIE;
1824 *error = -SCTP_IERROR_NOMEM;
1831 retval = sctp_association_new(ep, ep->base.sk, scope, gfp);
1833 *error = -SCTP_IERROR_NOMEM;
1838 retval->peer.port = ntohs(chunk->sctp_hdr->source);
1841 memcpy(&retval->c, bear_cookie, sizeof(*bear_cookie));
1845 *error = -SCTP_IERROR_NOMEM;
1850 if (list_empty(&retval->base.bind_addr.address_list)) {
1851 sctp_add_bind_addr(&retval->base.bind_addr, &chunk->dest,
1852 sizeof(chunk->dest), SCTP_ADDR_SRC,
1856 retval->next_tsn = retval->c.initial_tsn;
1857 retval->ctsn_ack_point = retval->next_tsn - 1;
1858 retval->addip_serial = retval->c.initial_tsn;
1859 retval->strreset_outseq = retval->c.initial_tsn;
1860 retval->adv_peer_ack_point = retval->ctsn_ack_point;
1861 retval->peer.prsctp_capable = retval->c.prsctp_capable;
1862 retval->peer.adaptation_ind = retval->c.adaptation_ind;
1877 *error = -SCTP_IERROR_MALFORMED;
1943 /* This is a fatal error. Any accumulated non-fatal errors are
1964 __u16 len = ntohs(param.p->length);
1967 * ABORT. If we've accumulated any non-fatal errors, they
1985 __u16 num_ext = ntohs(param.p->length) - sizeof(struct sctp_paramhdr);
1991 switch (param.ext->chunks[i]) {
2002 /* ADD-IP Security: The draft requires us to ABORT or ignore the
2003 * INIT/INIT-ACK if ADD-IP is listed, but AUTH is not. Do this
2004 * only if ADD-IP is turned on and we are not backward-compatible
2007 if (net->sctp.addip_noauth)
2010 if (ep->asconf_enable && !have_auth && have_asconf)
2019 __u16 num_ext = ntohs(param.p->length) - sizeof(struct sctp_paramhdr);
2023 switch (param.ext->chunks[i]) {
2025 if (asoc->ep->reconf_enable)
2026 asoc->peer.reconf_capable = 1;
2029 if (asoc->ep->prsctp_enable)
2030 asoc->peer.prsctp_capable = 1;
2036 if (asoc->ep->auth_enable)
2037 asoc->peer.auth_capable = 1;
2041 if (asoc->ep->asconf_enable)
2042 asoc->peer.asconf_capable = 1;
2045 if (asoc->ep->intl_enable)
2046 asoc->peer.intl_capable = 1;
2057 * highest-order two bits specify the action that must be
2061 * 00 - Stop processing this parameter; do not process any further
2064 * 01 - Stop processing this parameter, do not process any further
2068 * 10 - Skip this parameter and continue processing.
2070 * 11 - Skip this parameter and continue processing but
2075 * SCTP_IERROR_NO_ERROR - continue with the chunk
2076 * SCTP_IERROR_ERROR - stop and report an error.
2077 * SCTP_IERROR_NOMEME - out of memory.
2087 switch (param.p->type & SCTP_PARAM_ACTION_MASK) {
2114 ntohs(param.p->length)))
2115 sctp_addto_chunk(*errp, ntohs(param.p->length),
2127 * SCTP_IERROR_ABORT - trigger an ABORT
2128 * SCTP_IERROR_NOMEM - out of memory (abort)
2129 * SCTP_IERROR_ERROR - stop processing, trigger an ERROR
2130 * SCTP_IERROR_NO_ERROR - continue with the chunk
2145 /* FIXME - This routine is not looking at each parameter per the
2150 switch (param.p->type) {
2168 if (!ep->asconf_enable)
2171 if (ntohs(param.p->length) < sizeof(struct sctp_addip_param) +
2186 if (ep->prsctp_enable)
2191 if (!ep->auth_enable)
2194 /* SCTP-AUTH: Secion 6.1
2199 if (SCTP_AUTH_RANDOM_LENGTH != ntohs(param.p->length) -
2208 if (!ep->auth_enable)
2211 /* SCTP-AUTH: Section 3.2
2213 * INIT-ACK chunk if the sender wants to receive authenticated
2216 if (260 < ntohs(param.p->length)) {
2224 if (!ep->auth_enable)
2228 n_elt = (ntohs(param.p->length) -
2231 /* SCTP-AUTH: Section 6.1
2232 * The HMAC algorithm based on SHA-1 MUST be supported and
2233 * included in the HMAC-ALGO parameter.
2236 id = ntohs(hmacs->hmac_ids[i]);
2251 __func__, ntohs(param.p->type), cid);
2271 * is 0..2**32-1. RFC4960, section 3.3.3.
2273 if (peer_init->init_hdr.num_outbound_streams == 0 ||
2274 peer_init->init_hdr.num_inbound_streams == 0 ||
2275 peer_init->init_hdr.init_tag == 0 ||
2276 ntohl(peer_init->init_hdr.a_rwnd) < SCTP_DEFAULT_MINWINDOW)
2280 if (param.p->type == SCTP_PARAM_STATE_COOKIE)
2291 if (param.v != (void *)chunk->chunk_end)
2295 * the state cookie for an INIT-ACK chunk.
2346 asoc->encap_port = SCTP_INPUT_CB(chunk->skb)->encap_port;
2356 (param.p->type == SCTP_PARAM_IPV4_ADDRESS ||
2357 param.p->type == SCTP_PARAM_IPV6_ADDRESS)) {
2358 af = sctp_get_af_specific(param_type2af(param.p->type));
2359 if (!af->from_addr_param(&addr, param.addr,
2360 chunk->sctp_hdr->source, 0))
2377 if (asoc->peer.auth_capable && (!asoc->peer.peer_random ||
2378 !asoc->peer.peer_hmacs))
2379 asoc->peer.auth_capable = 0;
2381 /* In a non-backward compatible mode, if the peer claims
2382 * support for ADD-IP but not AUTH, the ADD-IP spec states
2387 if (!asoc->base.net->sctp.addip_noauth &&
2388 (asoc->peer.asconf_capable && !asoc->peer.auth_capable)) {
2389 asoc->peer.addip_disabled_mask |= (SCTP_PARAM_ADD_IP |
2392 asoc->peer.asconf_capable = 0;
2397 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
2399 if (transport->state == SCTP_UNKNOWN) {
2407 asoc->peer.i.init_tag =
2408 ntohl(peer_init->init_hdr.init_tag);
2409 asoc->peer.i.a_rwnd =
2410 ntohl(peer_init->init_hdr.a_rwnd);
2411 asoc->peer.i.num_outbound_streams =
2412 ntohs(peer_init->init_hdr.num_outbound_streams);
2413 asoc->peer.i.num_inbound_streams =
2414 ntohs(peer_init->init_hdr.num_inbound_streams);
2415 asoc->peer.i.initial_tsn =
2416 ntohl(peer_init->init_hdr.initial_tsn);
2418 asoc->strreset_inseq = asoc->peer.i.initial_tsn;
2423 if (asoc->c.sinit_num_ostreams >
2424 ntohs(peer_init->init_hdr.num_inbound_streams)) {
2425 asoc->c.sinit_num_ostreams =
2426 ntohs(peer_init->init_hdr.num_inbound_streams);
2429 if (asoc->c.sinit_max_instreams >
2430 ntohs(peer_init->init_hdr.num_outbound_streams)) {
2431 asoc->c.sinit_max_instreams =
2432 ntohs(peer_init->init_hdr.num_outbound_streams);
2436 asoc->c.peer_vtag = asoc->peer.i.init_tag;
2439 asoc->peer.rwnd = asoc->peer.i.a_rwnd;
2445 list_for_each_entry(transport, &asoc->peer.transport_addr_list,
2447 transport->ssthresh = asoc->peer.i.a_rwnd;
2451 if (!sctp_tsnmap_init(&asoc->peer.tsn_map, SCTP_TSN_MAP_INITIAL,
2452 asoc->peer.i.initial_tsn, gfp))
2463 if (sctp_stream_init(&asoc->stream, asoc->c.sinit_num_ostreams,
2464 asoc->c.sinit_max_instreams, gfp))
2470 if (!asoc->temp && sctp_assoc_set_id(asoc, gfp))
2483 asoc->peer.addip_serial = asoc->peer.i.initial_tsn - 1;
2488 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
2490 if (transport->state != SCTP_ACTIVE)
2515 struct sctp_endpoint *ep = asoc->ep;
2517 struct net *net = asoc->base.net;
2530 switch (param.p->type) {
2532 if (PF_INET6 != asoc->base.sk->sk_family)
2537 /* v4 addresses are not allowed on v6-only socket */
2538 if (ipv6_only_sock(asoc->base.sk))
2541 af = sctp_get_af_specific(param_type2af(param.p->type));
2542 if (!af->from_addr_param(&addr, param.addr, htons(asoc->peer.port), 0))
2551 if (!net->sctp.cookie_preserve_enable)
2554 stale = ntohl(param.life->lifespan_increment);
2559 asoc->cookie_life = ktime_add_ms(asoc->cookie_life, stale);
2566 asoc->peer.ipv4_address = 0;
2567 asoc->peer.ipv6_address = 0;
2572 if (peer_addr->sa.sa_family == AF_INET6)
2573 asoc->peer.ipv6_address = 1;
2574 else if (peer_addr->sa.sa_family == AF_INET)
2575 asoc->peer.ipv4_address = 1;
2578 sat = ntohs(param.p->length) - sizeof(struct sctp_paramhdr);
2583 switch (param.sat->types[i]) {
2585 asoc->peer.ipv4_address = 1;
2589 if (PF_INET6 == asoc->base.sk->sk_family)
2590 asoc->peer.ipv6_address = 1;
2600 asoc->peer.cookie_len =
2601 ntohs(param.p->length) - sizeof(struct sctp_paramhdr);
2602 kfree(asoc->peer.cookie);
2603 asoc->peer.cookie = kmemdup(param.cookie->body, asoc->peer.cookie_len, gfp);
2604 if (!asoc->peer.cookie)
2617 if (asoc->ep->ecn_enable) {
2618 asoc->peer.ecn_capable = 1;
2626 asoc->peer.adaptation_ind = ntohl(param.aind->adaptation_ind);
2630 if (!ep->asconf_enable)
2635 af = sctp_get_af_specific(param_type2af(addr_param->p.type));
2639 if (!af->from_addr_param(&addr, addr_param,
2640 htons(asoc->peer.port), 0))
2643 if (!af->addr_valid(&addr, NULL, NULL))
2658 if (asoc->ep->prsctp_enable) {
2659 asoc->peer.prsctp_capable = 1;
2666 if (!ep->auth_enable)
2670 kfree(asoc->peer.peer_random);
2671 asoc->peer.peer_random = kmemdup(param.p,
2672 ntohs(param.p->length), gfp);
2673 if (!asoc->peer.peer_random) {
2680 if (!ep->auth_enable)
2684 kfree(asoc->peer.peer_hmacs);
2685 asoc->peer.peer_hmacs = kmemdup(param.p,
2686 ntohs(param.p->length), gfp);
2687 if (!asoc->peer.peer_hmacs) {
2697 if (!ep->auth_enable)
2700 kfree(asoc->peer.peer_chunks);
2701 asoc->peer.peer_chunks = kmemdup(param.p,
2702 ntohs(param.p->length), gfp);
2703 if (!asoc->peer.peer_chunks)
2714 __func__, ntohs(param.p->type), asoc);
2749 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2751 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2753 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2755 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2757 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2761 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2763 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2776 struct sctp_af *af = sctp_get_af_specific(addr->v4.sin_family);
2778 addrlen = af->to_addr_param(addr, &addrparam);
2789 asconf.serial = htonl(asoc->addip_serial++);
2791 retval->subh.addip_hdr =
2793 retval->param_hdr.v =
2803 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2805 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2806 * | ASCONF-Request Correlation ID |
2807 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2809 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2814 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2816 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2817 * | ASCONF-Request Correlation ID |
2818 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2820 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2843 af = sctp_get_af_specific(addr->v4.sin_family);
2844 addr_param_len = af->to_addr_param(addr, &addr_param);
2849 addr_buf += af->sockaddr_len;
2850 if (asoc->asconf_addr_del_pending && !del_pickup) {
2856 pr_debug("%s: picked same-scope del_pending addr, "
2871 af = sctp_get_af_specific(addr->v4.sin_family);
2872 addr_param_len = af->to_addr_param(addr, &addr_param);
2880 addr_buf += af->sockaddr_len;
2883 addr = asoc->asconf_addr_del_pending;
2884 af = sctp_get_af_specific(addr->v4.sin_family);
2885 addr_param_len = af->to_addr_param(addr, &addr_param);
2900 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2902 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2903 * | ASCONF-Request Correlation ID |
2904 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2906 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2913 struct sctp_af *af = sctp_get_af_specific(addr->v4.sin_family);
2920 addrlen = af->to_addr_param(addr, &addrparam);
2940 /* ADDIP 3.1.2 Address Configuration Acknowledgement Chunk (ASCONF-ACK)
2943 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2945 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2947 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2949 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2953 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2955 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2974 retval->subh.addip_hdr =
2998 ntohs(asconf_param->param_hdr.length);
3034 if (asconf_param->param_hdr.type != SCTP_PARAM_ADD_IP &&
3035 asconf_param->param_hdr.type != SCTP_PARAM_DEL_IP &&
3036 asconf_param->param_hdr.type != SCTP_PARAM_SET_PRIMARY)
3039 switch (addr_param->p.type) {
3041 if (!asoc->peer.ipv6_address)
3045 if (!asoc->peer.ipv4_address)
3052 af = sctp_get_af_specific(param_type2af(addr_param->p.type));
3056 if (!af->from_addr_param(&addr, addr_param, htons(asoc->peer.port), 0))
3064 if (!af->is_any(&addr) && !af->addr_valid(&addr, NULL, asconf->skb))
3067 switch (asconf_param->param_hdr.type) {
3073 if (af->is_any(&addr))
3074 memcpy(&addr, &asconf->source, sizeof(addr));
3076 if (security_sctp_bind_connect(asoc->ep->base.sk,
3079 af->sockaddr_len))
3095 asoc->new_transport = peer;
3103 if (asoc->peer.transport_count == 1)
3113 if (sctp_cmp_addr_exact(&asconf->source, &addr))
3121 if (af->is_any(&addr)) {
3122 sctp_assoc_set_primary(asoc, asconf->transport);
3124 asconf->transport);
3129 * ASCONF-ACK with Error Cause Indication Parameter
3145 if (af->is_any(&addr))
3148 if (security_sctp_bind_connect(asoc->ep->base.sk,
3151 af->sockaddr_len))
3174 addip = (struct sctp_addip_chunk *)chunk->chunk_hdr;
3176 size_t length = ntohs(param.p->length);
3179 switch (param.p->type) {
3205 length = ntohs(param.addip->param_hdr.length);
3226 if (param.v != chunk->chunk_end)
3248 addip = (struct sctp_addip_chunk *)asconf->chunk_hdr;
3249 chunk_len = ntohs(asconf->chunk_hdr->length) -
3251 hdr = (struct sctp_addiphdr *)asconf->skb->data;
3252 serial = ntohl(hdr->serial);
3256 addr_param = (union sctp_addr_param *)(asconf->skb->data + length);
3257 chunk_len -= length;
3262 length = ntohs(addr_param->p.length);
3263 chunk_len -= length;
3277 if (param.p->type == SCTP_PARAM_IPV4_ADDRESS ||
3278 param.p->type == SCTP_PARAM_IPV6_ADDRESS)
3293 sctp_add_asconf_response(asconf_ack, param.addip->crr_id,
3305 asoc->peer.addip_serial++;
3312 list_add_tail(&asconf_ack->transmitted_list,
3313 &asoc->asconf_ack_list);
3323 struct sctp_bind_addr *bp = &asoc->base.bind_addr;
3333 af = sctp_get_af_specific(param_type2af(addr_param->p.type));
3334 if (!af->from_addr_param(&addr, addr_param, htons(bp->port), 0))
3337 switch (asconf_param->param_hdr.type) {
3343 list_for_each_entry(saddr, &bp->address_list, list) {
3344 if (sctp_cmp_addr_exact(&saddr->a, &addr))
3345 saddr->state = SCTP_ADDR_SRC;
3348 list_for_each_entry(transport, &asoc->peer.transport_addr_list,
3356 if (asoc->asconf_addr_del_pending != NULL &&
3357 sctp_cmp_addr_exact(asoc->asconf_addr_del_pending, &addr)) {
3358 kfree(asoc->asconf_addr_del_pending);
3359 asoc->asconf_addr_del_pending = NULL;
3362 list_for_each_entry(transport, &asoc->peer.transport_addr_list,
3396 asconf_ack_len = ntohs(asconf_ack->chunk_hdr->length) -
3403 asconf_ack_param = (struct sctp_addip_param *)(asconf_ack->skb->data +
3405 asconf_ack_len -= length;
3408 if (asconf_ack_param->crr_id == asconf_param->crr_id) {
3409 switch (asconf_ack_param->param_hdr.type) {
3415 asconf_ack_len -= length;
3417 return err_param->cause;
3426 length = ntohs(asconf_ack_param->param_hdr.length);
3428 asconf_ack_len -= length;
3438 struct sctp_chunk *asconf = asoc->addip_last_asconf;
3442 int asconf_len = asconf->skb->len;
3452 addr_param = (union sctp_addr_param *)(asconf->skb->data + length);
3453 asconf_len -= length;
3458 length = ntohs(addr_param->p.length);
3460 asconf_len -= length;
3467 if (asconf_ack->skb->len == sizeof(struct sctp_addiphdr))
3495 asoc->peer.addip_disabled_mask |=
3496 asconf_param->param_hdr.type;
3509 length = ntohs(asconf_param->param_hdr.length);
3511 asconf_len -= length;
3514 if (no_err && asoc->src_out_of_asoc_ok) {
3515 asoc->src_out_of_asoc_ok = 0;
3516 sctp_transport_immediate_rtx(asoc->peer.primary_path);
3520 list_del_init(&asconf->transmitted_list);
3522 asoc->addip_last_asconf = NULL;
3546 retval->subh.fwdtsn_hdr =
3574 retval->subh.ifwdtsn_hdr =
3582 /* RE-CONFIG 3.1 (RE-CONFIG chunk)
3585 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3587 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3589 * / Re-configuration Parameter /
3591 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3593 * / Re-configuration Parameter (optional) /
3595 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3608 reconf = (struct sctp_reconf_chunk *)retval->chunk_hdr;
3609 retval->param_hdr.v = (u8 *)(reconf + 1);
3614 /* RE-CONFIG 4.1 (STREAM OUT RESET)
3617 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3619 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3620 * | Re-configuration Request Sequence Number |
3621 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3622 * | Re-configuration Response Sequence Number |
3623 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3625 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3627 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3629 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3630 * | Stream Number N-1 (optional) | Stream Number N (optional) |
3631 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3633 * RE-CONFIG 4.2 (STREAM IN RESET)
3636 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3638 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3639 * | Re-configuration Request Sequence Number |
3640 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3642 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3644 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3645 * | Stream Number N-1 (optional) | Stream Number N (optional) |
3646 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3669 outreq.request_seq = htonl(asoc->strreset_outseq);
3670 outreq.response_seq = htonl(asoc->strreset_inseq - 1);
3671 outreq.send_reset_at_tsn = htonl(asoc->next_tsn - 1);
3682 inreq.request_seq = htonl(asoc->strreset_outseq + out);
3693 /* RE-CONFIG 4.3 (SSN/TSN RESET ALL)
3696 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3698 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3699 * | Re-configuration Request Sequence Number |
3700 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3715 tsnreq.request_seq = htonl(asoc->strreset_outseq);
3722 /* RE-CONFIG 4.5/4.6 (ADD STREAM)
3725 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3727 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3728 * | Re-configuration Request Sequence Number |
3729 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3731 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3749 addstrm.request_seq = htonl(asoc->strreset_outseq);
3759 addstrm.request_seq = htonl(asoc->strreset_outseq + !!out);
3768 /* RE-CONFIG 4.4 (RESP)
3771 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3773 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3774 * | Re-configuration Response Sequence Number |
3775 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3777 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3800 /* RE-CONFIG 4.4 OPTIONAL (TSNRESP)
3803 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3805 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3806 * | Re-configuration Response Sequence Number |
3807 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3809 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3811 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3813 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
3850 hdr = (struct sctp_reconf_chunk *)chunk->chunk_hdr;
3852 __u16 length = ntohs(param.p->length);
3857 switch (param.p->type) {
3895 last = param.p->type;