From patchwork Fri Jan 5 13:17:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Ricardo Leitner X-Patchwork-Id: 856036 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fmQl4so8"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zClZz4KR8z9ryr for ; Sat, 6 Jan 2018 00:17:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752139AbeAENRq (ORCPT ); Fri, 5 Jan 2018 08:17:46 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:33302 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689AbeAENRc (ORCPT ); Fri, 5 Jan 2018 08:17:32 -0500 Received: by mail-qt0-f193.google.com with SMTP id e2so5644945qti.0; Fri, 05 Jan 2018 05:17:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HczqmKEXbiDqAiKpM1DQX3amjriJlp9yggpz8Y8hTL4=; b=fmQl4so8pwtwMKsYDiPOly0O5luR8gr03oBKl/UEsRHf0sRcj3RRA1yq27eONonCyS YIgvov66y4qC8O7Ttnwx1ROweP67/xEpAEszy/EB74BtM1PWbKuEOUU1ulejbI9phSHr JTJ3HglDdc/2mAAyQyYRYUoAXNTt3OvXUfGDLJdWm1rKc/sxvX++Q0wobQF7tQddXlno sfZe+YNL79tSNDrNX4MwKrayyWG1rKm4IL/PjJB0MGDSAG/agVyx0IBOwhQr9NFkgiC0 Z3olUXcaEuuvD238WOT0WUkgZNZzyNF2r6HfCPh/p8Uibm4OPt0VuL43EL/kwq5v6CMJ LGQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HczqmKEXbiDqAiKpM1DQX3amjriJlp9yggpz8Y8hTL4=; b=R3qx+M/Jpa+C8yCp2qoaOpveTn/VvzgYyu1CIOJBwO1sSAezyl55sRIFIUKBfTPEHo 7JA9ipeyR2xGEV4qKNVsz5/Jeehd1ivI5qvnv5gr/rEIrcHgN7/yiEgJMJMwbAtr4ZUV kwzD1vgktKB7YKeOVLZydsJkoeDvIv+GeClD3F3ZtiB2CS3F5ZZmHYhbK+Q8Y5Xh1y8d fA9Mu6CaGhjeFaZgx+0bfbQ8BMOGmk9Zmjq/ueXJpJnGJK8C0yGiwn0AwhNs9IHGPzVM GVp9L9+VFiIiMr3cae53s8U7CSX+0uBmvfjWyKHNfuEa8LAf87yYgg7kiDXeKTRcIMyZ 4Odg== X-Gm-Message-State: AKwxyteEYVxXh+DMhBS7StpNaO8URxwp1CfPX6qJMKzhgpwpeBsYn//h Wvx5Esj9N6ay841Ftsp3EIs1fg== X-Google-Smtp-Source: ACJfBouuETm6ZIbqtbuq0gPVNM7tahP6Rge7SRQt/dcDkSqfLJ1gZefYmwKpAhlCPnT9/EIvXLrifQ== X-Received: by 10.200.45.148 with SMTP id p20mr4003124qta.249.1515158251971; Fri, 05 Jan 2018 05:17:31 -0800 (PST) Received: from localhost.localdomain.com ([2001:1284:f013:23a9:9544:d086:4c8e:2344]) by smtp.gmail.com with ESMTPSA id u36sm3545562qtc.58.2018.01.05.05.17.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jan 2018 05:17:31 -0800 (PST) From: Marcelo Ricardo Leitner To: netdev@vger.kernel.org Cc: linux-sctp@vger.kernel.org, Xin Long , Vlad Yasevich , Neil Horman , marcelo.leitner@gmail.com Subject: [PATCH net v3 1/2] sctp: do not retransmit upon FragNeeded if PMTU discovery is disabled Date: Fri, 5 Jan 2018 11:17:17 -0200 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Currently, if PMTU discovery is disabled on a given transport, but the configured value is higher than the actual PMTU, it is likely that we will get some icmp Frag Needed. The issue is, if PMTU discovery is disabled, we won't update the information and will issue a retransmission immediately, which may very well trigger another ICMP, and another retransmission, leading to a loop. The fix is to simply not trigger immediate retransmissions if PMTU discovery is disabled on the given transport. Changes from v2: - updated stale comment, noticed by Xin Long Signed-off-by: Marcelo Ricardo Leitner --- net/sctp/input.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/net/sctp/input.c b/net/sctp/input.c index 621b5ca3fd1c17c3d7ef7bb1c7677ab98cebbe77..9320661cc41da0b280f69f379128ab7d062e5528 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c @@ -399,20 +399,20 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc, return; } - if (t->param_flags & SPP_PMTUD_ENABLE) { - /* Update transports view of the MTU */ - sctp_transport_update_pmtu(t, pmtu); + if (!(t->param_flags & SPP_PMTUD_ENABLE)) + /* We can't allow retransmitting in such case, as the + * retransmission would be sized just as before, and thus we + * would get another icmp, and retransmit again. + */ + return; - /* Update association pmtu. */ - sctp_assoc_sync_pmtu(asoc); - } + /* Update transports view of the MTU */ + sctp_transport_update_pmtu(t, pmtu); - /* Retransmit with the new pmtu setting. - * Normally, if PMTU discovery is disabled, an ICMP Fragmentation - * Needed will never be sent, but if a message was sent before - * PMTU discovery was disabled that was larger than the PMTU, it - * would not be fragmented, so it must be re-transmitted fragmented. - */ + /* Update association pmtu. */ + sctp_assoc_sync_pmtu(asoc); + + /* Retransmit with the new pmtu setting. */ sctp_retransmit(&asoc->outqueue, t, SCTP_RTXR_PMTUD); }