From patchwork Tue Apr 15 14:43:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Copeland X-Patchwork-Id: 3993521 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1090CBFF02 for ; Tue, 15 Apr 2014 14:44:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 20A082021A for ; Tue, 15 Apr 2014 14:44:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3E12420219 for ; Tue, 15 Apr 2014 14:44:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753942AbaDOOoU (ORCPT ); Tue, 15 Apr 2014 10:44:20 -0400 Received: from mail-oa0-f54.google.com ([209.85.219.54]:37106 "EHLO mail-oa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754408AbaDOOoR (ORCPT ); Tue, 15 Apr 2014 10:44:17 -0400 Received: by mail-oa0-f54.google.com with SMTP id n16so11024187oag.27 for ; Tue, 15 Apr 2014 07:44:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7QGKfZAbT5WBA/M6SoAl1i8MA1UD6YiDZiLveLpg6dA=; b=bvBXwMRP/v1MHBUTB6ILY3lOkxOfP6Irhs50UOMvOkpbDQoa/nTf7uKKQo3zmqEuHQ qt7aaCjvwf7dekeWe8wWhOMhum+ZB7kS3ZQ+nh4iVpHRTvH/KDduuJXeU2rp0LuoZqFR j8USZUZ69BjQyNjAa+ZcoL8NN8T2JzwRIg8GUfJhnAoDckqbc2seQPWfTIBrhDccpWBp HNtlovkjoxtPaus6kNVFNMKaxydv7vFxqRxODEc4rKYYtbxHBBGQ3Fs3j1ncLHXCFPmA P7yZ+jDSiwbQTw4yGL+OKDuKHS2ogUpaoZB47muyCAQPS96a7923G5w89pcv6C2HIS0E 52Rg== X-Gm-Message-State: ALoCoQktS9K0apNxM1qmawYauB/z223qQn0YG587ta3rAkvfzqBcDzNLPWBX9g4j8XZsy/2iWkS/ X-Received: by 10.60.176.9 with SMTP id ce9mr1703290oec.55.1397573056780; Tue, 15 Apr 2014 07:44:16 -0700 (PDT) Received: from hash ([2001:470:1d:6db:230:48ff:fe9d:9c89]) by mx.google.com with ESMTPSA id f1sm86326574oej.5.2014.04.15.07.44.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 15 Apr 2014 07:44:15 -0700 (PDT) Received: from bob by hash with local (Exim 4.80) (envelope-from ) id 1Wa4aV-0000qn-AL; Tue, 15 Apr 2014 10:43:51 -0400 From: Bob Copeland To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, devel@lists.open80211s.org, Bob Copeland , Bob Copeland Subject: [PATCH 3/3] mac80211: mesh: always use the latest target_sn Date: Tue, 15 Apr 2014 10:43:08 -0400 Message-Id: <1397572988-3181-3-git-send-email-me@bobcopeland.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1397572988-3181-1-git-send-email-me@bobcopeland.com> References: <1397572988-3181-1-git-send-email-me@bobcopeland.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When a path target responds to a path request, its response always contains the most up-to-date information; accordingly, it should use the latest target_sn, regardless of net_traversal_jiffies(). Otherwise, only the first path response is considered when constructing a path, as it will have the highest target_sn of all replies during that period. Signed-off-by: Bob Copeland --- net/mac80211/mesh_hwmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 03ff5ea..94758b9 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -544,9 +544,10 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, if (time_after(jiffies, ifmsh->last_sn_update + net_traversal_jiffies(sdata)) || time_before(jiffies, ifmsh->last_sn_update)) { - target_sn = ++ifmsh->sn; + ++ifmsh->sn; ifmsh->last_sn_update = jiffies; } + target_sn = ifmsh->sn; } else if (is_broadcast_ether_addr(target_addr) && (target_flags & IEEE80211_PREQ_TO_FLAG)) { rcu_read_lock();