44 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
46 #include <linux/types.h>
47 #include <linux/kernel.h>
48 #include <linux/wait.h>
49 #include <linux/time.h>
51 #include <linux/ipv6.h>
53 #include <linux/slab.h>
59 #include <linux/socket.h>
101 if (ecn_capable && sctp_packet_empty(packet)) {
131 overhead = sp->
pf->af->net_header_len;
133 overhead =
sizeof(
struct ipv6hdr);
135 overhead +=
sizeof(
struct sctphdr);
137 sctp_packet_reset(packet);
151 list_del_init(&chunk->
list);
229 retval = __sctp_packet_append_chunk(pkt, auth);
254 if (timer_pending(timer)) {
258 pkt->
transport->asoc->peer.sack_generation)
264 retval = __sctp_packet_append_chunk(pkt, sack);
269 asoc->
peer.sack_needed = 0;
290 retval = sctp_packet_will_fit(packet, chunk, chunk_len);
298 sctp_packet_append_data(packet, chunk);
324 packet->
size += chunk_len;
346 retval = sctp_packet_can_append_data(packet, chunk);
352 retval = sctp_packet_bundle_auth(packet, chunk);
357 retval = sctp_packet_bundle_sack(packet, chunk);
361 retval = __sctp_packet_append_chunk(packet, chunk);
367 static void sctp_packet_release_owner(
struct sk_buff *
skb)
403 unsigned char *auth =
NULL;
427 sctp_packet_set_owner_w(nskb, sk);
429 if (!sctp_transport_dst_check(tp)) {
435 dst = dst_clone(tp->
dst);
436 skb_dst_set(nskb, dst);
442 skb_reset_transport_header(nskb);
478 list_del_init(&chunk->
list);
502 if (chunk == packet->
auth)
503 auth = skb_tail_pointer(nskb);
505 cksum_buf_len += chunk->
skb->len;
507 chunk->
skb->data, chunk->
skb->len);
513 chunk->
has_tsn ?
"TSN" :
"No TSN",
517 "chunk->skb->len", chunk->
skb->len,
557 sh->
checksum = sctp_end_cksum(crc32);
561 nskb->
csum_start = (skb_transport_header(nskb) -
587 if (asoc && asoc->
peer.last_sent_to != tp) {
591 asoc->
peer.last_sent_to = tp;
615 sctp_packet_reset(packet);
635 list_del_init(&chunk->
list);
654 size_t datasize, rwnd, inflight, flight_size;
672 rwnd = asoc->
peer.rwnd;
676 datasize = sctp_data_size(chunk);
678 if (datasize > rwnd) {
701 if (flight_size >= transport->
cwnd) {
711 if (!sctp_sk(asoc->
base.sk)->nodelay && sctp_packet_empty(packet) &&
722 if ((len < max) && chunk->
msg->can_delay) {
733 static void sctp_packet_append_data(
struct sctp_packet *packet,
737 size_t datasize = sctp_data_size(chunk);
745 asoc->
outqueue.outstanding_bytes += datasize;
755 if (!asoc->
peer.prsctp_capable)
756 chunk->
msg->can_abandon = 0;
770 psize = packet->
size;
775 too_big = (psize + chunk_len >
pmtu);