Thread (5 messages) 5 messages, 3 authors, 2020-11-09

Re: [PATCH] sctp: Fix sending when PMTU is less than SCTP_DEFAULT_MINSEGMENT

From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: 2020-11-06 08:46:40
Also in: linux-sctp, lkml

On Thu, Nov 05, 2020 at 11:39:47AM +0100, Petr Malat wrote:
Function sctp_dst_mtu() never returns lower MTU than
SCTP_TRUNC4(SCTP_DEFAULT_MINSEGMENT) even when the actual MTU is less,
in which case we rely on the IP fragmentation and must enable it.
This should be being handled at sctp_packet_will_fit():

          psize = packet->size;
          if (packet->transport->asoc)
                  pmtu = packet->transport->asoc->pathmtu;
          else
                  pmtu = packet->transport->pathmtu;

          /* Decide if we need to fragment or resubmit later. */
          if (psize + chunk_len > pmtu) {
                  /* It's OK to fragment at IP level if any one of the following
                   * is true:
                   *      1. The packet is empty (meaning this chunk is greater
                   *         the MTU)
                   *      2. The packet doesn't have any data in it yet and data
                   *         requires authentication.
                   */
                  if (sctp_packet_empty(packet) ||
                      (!packet->has_data && chunk->auth)) {
                          /* We no longer do re-fragmentation.
                           * Just fragment at the IP layer, if we
                           * actually hit this condition
                           */
                          packet->ipfragok = 1;
                          goto out;
                  }

Why the above doesn't handle it already?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help