From patchwork Wed Jun 10 18:02: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: 6583971 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 2E7AC9F326 for ; Wed, 10 Jun 2015 18:02:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A7DE02055C for ; Wed, 10 Jun 2015 18:02:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 946EC20558 for ; Wed, 10 Jun 2015 18:02:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754250AbbFJSCp (ORCPT ); Wed, 10 Jun 2015 14:02:45 -0400 Received: from mail-ie0-f182.google.com ([209.85.223.182]:32996 "EHLO mail-ie0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754185AbbFJSCo (ORCPT ); Wed, 10 Jun 2015 14:02:44 -0400 Received: by iebgx4 with SMTP id gx4so39842076ieb.0 for ; Wed, 10 Jun 2015 11:02:43 -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=6cU2CNgEMwrVH1EpJwT5JlbBqrmwU2ZjaG4YCo5btwk=; b=PrUWs5t8g16Y6i/o0RA4MJTnS3REzq41AOrE9toT/zgMErjUhAWOhnKZ2UZLNyL9j4 cpOcDwjiEX5ZUZmIGvWMV8dBTnZ61WlB/AUetiNsyVPuBPpZsJBrhKBuF5enu7fv3wSk 5lGK46RdoaJ8PEC6EztC7ZzF1kEqCRseX4ZMIzPywkRNQaLFnt+au371fuI9aQo1gOFE beQ/iUXfSwuN/4Q9Tuqq7dQLV8nEu3ZOXZWFdefeVxqmobbXmyaCv84pyT5xE+C07Q9c +gw+rPh1u4MF4OLk40g2Pl9j7J4TYkwaDvVeT3g2xJPcGJMBgdF3mqn+Q80Bf5OmVoVR sk/w== X-Gm-Message-State: ALoCoQnDuVFWpEr0aF3MKVLzLpS78XsYkbagutBZqgLk6Thcu7SD96RK3emtAEG4Sbt/SFxrgOeX X-Received: by 10.50.56.104 with SMTP id z8mr7520071igp.45.1433959363387; Wed, 10 Jun 2015 11:02:43 -0700 (PDT) Received: from [10.4.0.237] ([67.137.71.162]) by mx.google.com with ESMTPSA id j5sm6458791ioo.8.2015.06.10.11.02.42 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Jun 2015 11:02:42 -0700 (PDT) Message-ID: <55787BA1.9030807@cococorp.com> Date: Wed, 10 Jun 2015 11:02: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: Add missing case to PERR processing 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 When the nexthop is unable to resolve its own nexthop it will send back a PERR with a zero target_sn. According to section 13.10.11.4.3 step b in the 2012 standard that perr should be forwarded and the associated mpath->sn should be incremented. Neither one of those was happening whichis rather bad because the originator was not told that packets are black holing. Signed-off-by: Alexis Green CC: Jesse Jones --- -- 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 3c7cf3c..28c18cb 100755 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -736,9 +736,12 @@ static void hwmp_perr_frame_process(struct ieee80211_sub_if_data *sdata, if (mpath->flags & MESH_PATH_ACTIVE && ether_addr_equal(ta, sta->sta.addr) && (!(mpath->flags & MESH_PATH_SN_VALID) || - SN_GT(target_sn, mpath->sn))) { + SN_GT(target_sn, mpath->sn) || target_sn == 0)) { mpath->flags &= ~MESH_PATH_ACTIVE; - mpath->sn = target_sn; + if (target_sn != 0) + mpath->sn = target_sn; + else + mpath->sn += 1; spin_unlock_bh(&mpath->state_lock); if (!ifmsh->mshcfg.dot11MeshForwarding) goto endperr;