Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5457753pxu; Tue, 22 Dec 2020 18:39:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZ6cjwdaslsKEDr0qOD2ycCSs7lsYcs+GmTSdndiXc3T0mEKQiMCqsdUlxfvQCyiW/XKCi X-Received: by 2002:a17:906:cc8c:: with SMTP id oq12mr22912728ejb.419.1608691158732; Tue, 22 Dec 2020 18:39:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608691158; cv=none; d=google.com; s=arc-20160816; b=Tk9Tt/Eofxvv/vvT5SYB9ovU/1w7tBTbTRtPZpt0g04ETob4d/Q1LYnINAnVHGity5 /MmpQCtp+wuyvrOi/tlYx1aA5rkDfHD6tn4tnH40v58N/Fuwd1eLKzNuduZlorEEQhes dYoQ2NzyOb4H7xxAgHV6ZELIfAGRYYs5rMl4KbBVEOz3vfJA4UNc2LDMLNeCyQlogHv1 tG7s2G3KjQlv86xM3+2O5xlXNvb+0wWvN44PeMP9wPPjWcmutE6V4F7j00u8RMAya1lO 8G+5z0LgdvPavhWJeYZYIl+febNsRptFUa8/YiwRChkfTd97BXl6/5AgsBXOgQc6ol5Y /rZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ij3I94MU7nmG0/d0n2YZxGsMjyAaljTXqYPGufyCG6Y=; b=DS6Pe9OdTzOjnQ5q3CJKLmunc8lz4Q4usvboI+6szVG70wieWz83znUQUcTXqPdBNM bLPExxWU6ZuyuuVYrwTV/6TQUGrst3VpEEnTacbTmQriI4BxsE4PfN8QAa5UTt6oWw2K egB1VAgoHBhasJY2kDMTmv1+9WOEe/6aP6QVDidSEb79fVFY5o4wuY7PSqxBcN4/Ao7Q aCgoAbJ0zzt6FQciH3GQSZPVsAlopOR4vVmuqzo/1psarYy3k2ZGXeZlX2G7XB0COjow 68F/J7oVLQBKRmKM3Dn0Z7/7hFw2zhBSZBjYCgdFGjfXI5+oiskQvnFoGh+dS2jpNz/5 /RMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YSVihZkZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si11611331ejd.577.2020.12.22.18.38.56; Tue, 22 Dec 2020 18:39:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YSVihZkZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730131AbgLWCik (ORCPT + 99 others); Tue, 22 Dec 2020 21:38:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:52234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730115AbgLWCYF (ORCPT ); Tue, 22 Dec 2020 21:24:05 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id F1C00225AA; Wed, 23 Dec 2020 02:23:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608690229; bh=/c4YffwbuflVEpdaKVkVhdpanUfzt8myrSXK6LvF4OI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YSVihZkZzyQWWNx6DK8R7U4lRJfAxXgtBk5ylUb/ANQBtaJRgFBfQvx5TCOVmgro1 uqgIaxWLfHTg9vdkdBANPex/6sqRfyMFesWNATDyIazC1gqNDlmeKl00fTCOet2Ma0 9DEO7xTgQtCGw7GEV9jkOow5lJkjCirJksZQT6bXLrX/WN4R86Mf356/1MYfby7BUO YePW4zK2HR6u+HTd0vNkR/V1uRoJGwF5hC4rAVSlcqjWUdp8a3Z8m0p4kX39pDEIQa Jl77AKddfKaUwhjYW7Qw6j3MaS0oI+jyGtULaAwa4B4plj4WFHYaXd7ouJYhLmBbxk qbi1UBQDsOYAw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Martin Schiller , Jakub Kicinski , Sasha Levin , linux-x25@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 45/66] net/lapb: fix t1 timer handling for LAPB_STATE_0 Date: Tue, 22 Dec 2020 21:22:31 -0500 Message-Id: <20201223022253.2793452-45-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201223022253.2793452-1-sashal@kernel.org> References: <20201223022253.2793452-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin Schiller [ Upstream commit 62480b992ba3fb1d7260b11293aed9d6557831c7 ] 1. DTE interface changes immediately to LAPB_STATE_1 and start sending SABM(E). 2. DCE interface sends N2-times DM and changes to LAPB_STATE_1 afterwards if there is no response in the meantime. Signed-off-by: Martin Schiller Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/lapb/lapb_timer.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/net/lapb/lapb_timer.c b/net/lapb/lapb_timer.c index 1a5535bc3b8d8..57882eb654c07 100644 --- a/net/lapb/lapb_timer.c +++ b/net/lapb/lapb_timer.c @@ -92,11 +92,18 @@ static void lapb_t1timer_expiry(unsigned long param) switch (lapb->state) { /* - * If we are a DCE, keep going DM .. DM .. DM + * If we are a DCE, send DM up to N2 times, then switch to + * STATE_1 and send SABM(E). */ case LAPB_STATE_0: - if (lapb->mode & LAPB_DCE) + if (lapb->mode & LAPB_DCE && + lapb->n2count != lapb->n2) { + lapb->n2count++; lapb_send_control(lapb, LAPB_DM, LAPB_POLLOFF, LAPB_RESPONSE); + } else { + lapb->state = LAPB_STATE_1; + lapb_establish_data_link(lapb); + } break; /* -- 2.27.0