From patchwork Fri Jun 12 21:13:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexis Green X-Patchwork-Id: 6600891 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 521189F1C1 for ; Fri, 12 Jun 2015 21:13:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 576472045B for ; Fri, 12 Jun 2015 21:13:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28DF320437 for ; Fri, 12 Jun 2015 21:13:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753396AbbFLVNT (ORCPT ); Fri, 12 Jun 2015 17:13:19 -0400 Received: from mail-ie0-f171.google.com ([209.85.223.171]:34734 "EHLO mail-ie0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750840AbbFLVNS (ORCPT ); Fri, 12 Jun 2015 17:13:18 -0400 Received: by iebmu5 with SMTP id mu5so31675188ieb.1 for ; Fri, 12 Jun 2015 14:13:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:reply-to:user-agent :mime-version:to:cc:subject:content-type:content-transfer-encoding; bh=wF6Jl00K2NI3qbOH9pFS49EK9X88yQjyBxwPRxPXicc=; b=KR5gOl4bOM608zCxRI9H4nJ4jG50y5o/UsJzyMhkfyYmHbNF7JZ5/AxP3okCkJetgG IBFmIGlpoTPlQxR526F7HuGKohasEXKMoWFgWfcVm5J2ghUSIamcVkeOL+ofawL7xnJR BUYkS5r8W+uLgy4ue2ZIBuxGseYqTCWQXMlkD6+alAsU5zT1jqM4XSIeTpLTB8gGVPHy s4p7S2txJXr1ekwq7bhgf4ZU+M60PRcKgbOIOsdDn9yXxyd5KFV0peF7pMKWkDi4O2Q3 cqUXlv9FnskT2s5cMksKs6krefVEBa7hgWWoA4sslM0HKRxzyXFntgwCl8dAhhCZQcts HDUw== X-Gm-Message-State: ALoCoQnAWvQFa+zIrwjvk/F020wnqCNQFcwKjgUzM9HjOzM2/cGJROyZyT+rj8pZUrfoFlvS4oN4 X-Received: by 10.50.13.10 with SMTP id d10mr7067674igc.20.1434143597864; Fri, 12 Jun 2015 14:13:17 -0700 (PDT) Received: from [10.4.0.237] ([67.137.71.162]) by mx.google.com with ESMTPSA id 69sm3239674ioz.10.2015.06.12.14.13.16 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Jun 2015 14:13:17 -0700 (PDT) Message-ID: <557B4B65.60001@cococorp.com> Date: Fri, 12 Jun 2015 14:13:09 -0700 From: Alexis Green Reply-To: agreen@cococorp.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Johannes Berg CC: linux-wireless@vger.kernel.org, Jesse Jones Subject: [PATCH] mac80211: don't invalidate SN on discovery failure Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 From: Jesse Jones The 2012 spec mentions that path SNs can be invalid when created (see section 13.10.8.4 table 13-9) but AFAICT never talks about invalidating SNs. Which makes sense: if we have figured out the path to a target at a certain SN then we want to remember that fact. Failing to do so can lead to routing loops because if we don't have a valid SN then we have no way of knowing whether an incoming path message leads to or away from the target. However currently when discovery fails we zero out mpath->flags which clears MESH_PATH_SN_VALID. This patch fixes that so that only the discovery relevant flags are cleared. Signed-off-by: Alexis Green --- -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 085edc1..1d849be --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -1176,7 +1176,8 @@ void mesh_path_timer(unsigned long data) spin_unlock_bh(&mpath->state_lock); mesh_queue_preq(mpath, 0); } else { - mpath->flags = 0; + mpath->flags &= ~(MESH_PATH_RESOLVING | + MESH_PATH_RESOLVED | MESH_PATH_REQ_QUEUED); mpath->exp_time = jiffies; spin_unlock_bh(&mpath->state_lock); if (!mpath->is_gate && mesh_gate_num(sdata) > 0) {