lkml.org 
[lkml]   [2020]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] sctp: Fix sending when PMTU is less than SCTP_DEFAULT_MINSEGMENT
Date
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.

Signed-off-by: Petr Malat <oss@malat.biz>
---
net/sctp/output.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/net/sctp/output.c b/net/sctp/output.c
index 1441eaf460bb..87a96cf6bfa4 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -552,6 +552,7 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp)
struct sk_buff *head;
struct sctphdr *sh;
struct sock *sk;
+ u32 pmtu;

pr_debug("%s: packet:%p\n", __func__, packet);
if (list_empty(&packet->chunk_list))
@@ -559,6 +560,13 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp)
chunk = list_entry(packet->chunk_list.next, struct sctp_chunk, list);
sk = chunk->skb->sk;

+ /* Fragmentation on the IP level if the actual PMTU could be less
+ * than SCTP_DEFAULT_MINSEGMENT. See sctp_dst_mtu().
+ */
+ pmtu = tp->asoc ? tp->asoc->pathmtu : tp->pathmtu;
+ if (pmtu <= SCTP_DEFAULT_MINSEGMENT)
+ packet->ipfragok = 1;
+
/* check gso */
if (packet->size > tp->pathmtu && !packet->ipfragok) {
if (!sk_can_gso(sk)) {
--
2.20.1
\
 
 \ /
  Last update: 2020-11-05 11:43    [W:0.061 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site