From patchwork Thu Oct 31 08:40:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Hugne X-Patchwork-Id: 287423 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 983CC2C034C for ; Thu, 31 Oct 2013 19:41:26 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753427Ab3JaIlV (ORCPT ); Thu, 31 Oct 2013 04:41:21 -0400 Received: from mailgw1.ericsson.se ([193.180.251.45]:42660 "EHLO mailgw1.ericsson.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752450Ab3JaIlR (ORCPT ); Thu, 31 Oct 2013 04:41:17 -0400 X-AuditID: c1b4fb2d-b7f1c8e000005ceb-81-527217ab796a Received: from ESESSHC011.ericsson.se (Unknown_Domain [153.88.253.124]) by mailgw1.ericsson.se (Symantec Mail Security) with SMTP id 30.3C.23787.BA712725; Thu, 31 Oct 2013 09:41:16 +0100 (CET) Received: from eerihug-hybrid.rnd.ki.sw.ericsson.se (147.214.213.166) by ESESSHC011.ericsson.se (153.88.183.51) with Microsoft SMTP Server (TLS) id 14.2.328.9; Thu, 31 Oct 2013 09:41:15 +0100 From: To: , , , CC: , Erik Hugne Subject: [PATCH net-next v2 3/3] tipc: reassembly failures should cause link reset Date: Thu, 31 Oct 2013 09:40:14 +0100 Message-ID: <1383208814-23476-4-git-send-email-erik.hugne@ericsson.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1383208814-23476-1-git-send-email-erik.hugne@ericsson.com> References: <1383208814-23476-1-git-send-email-erik.hugne@ericsson.com> MIME-Version: 1.0 X-Originating-IP: [147.214.213.166] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpiluLIzCtJLcpLzFFi42KZGfG3RneNeFGQwcELXBaLFh1msji2QMzi 2t7jzBaPr19ndmDxeN9zhcnj8yY5j/VbtjIFMEdx2aSk5mSWpRbp2yVwZVy9F13wjKuicW1O A+Ntji5GTg4JAROJT2sOMELYYhIX7q1n62Lk4hASOMQo8e7tL2YI5zCjxNLzS9hBqtgE5CXO L7rNBGKLCORKXP5+lQXEZhZwkniw+gCYLSwQJLFj9UFWEJtFQFWireETWJxXwF1iwuUvQNs4 gLYpSMyZZAMS5hTwkOh+s5sZJCwEVDLvmylEtaDEyZlPoKZLSBx88YIZxBYSUJG4/3I2O8TN yhKfL79kmsAoOAtJyywkLQsYmVYxsucmZuaklxtuYgSG48Etv3V3MJ46J3KIUZqDRUmc98Nb 5yAhgfTEktTs1NSC1KL4otKc1OJDjEwcnFINjMVb9WfsqHBYvWBfw8u0VZwMeosFzh1f4Hh9 kapUmMYkzs0mf72DNm1YXsYqxnms/W00v9Avx4qFAbrVBwt79LfIPJKZwvbo0JYdZzZs2PP8 wQ5nfsuy2NfHP2z0cbwnuKhJZPm0b1ZGy+KkL1+95fn+fE/R29ILV+ZNt7iV/U3o3lfrdgO/ pkNKLMUZiYZazEXFiQDbQFjoFQIAAA== Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Erik Hugne If appending a received fragment to the pending fragment chain in a unicast link fails, the current code tries to force a retransmission of the fragment by decrementing the 'next received sequence number' field in the link. This is done under the assumption that the failure is caused by an out-of-memory situation, an assumption that does not hold true after the previous patch in this series. A failure to append a fragment can now only be caused by a protocol violation by the sending peer, and it must hence be assumed that it is either malicious or buggy. Either way, the correct behavior is now to reset the link instead of trying to revert its sequence number. So, this is what we do in this commit. Signed-off-by: Erik Hugne Reviewed-by: Paul Gortmaker Signed-off-by: Jon Maloy --- net/tipc/link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tipc/link.c b/net/tipc/link.c index e2b347a..a6c4981 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -1652,7 +1652,7 @@ deliver: goto deliver; } if (ret == LINK_REASM_ERROR) - l_ptr->next_in_no--; + tipc_link_reset(l_ptr); tipc_node_unlock(n_ptr); continue; case CHANGEOVER_PROTOCOL: