From patchwork Wed Jan 16 21:30:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 14114 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5AB1F23F02 for ; Fri, 18 Jan 2013 11:43:39 +0000 (UTC) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by fiordland.canonical.com (Postfix) with ESMTP id EFBB1A18202 for ; Fri, 18 Jan 2013 11:43:38 +0000 (UTC) Received: by mail-vb0-f45.google.com with SMTP id p1so272122vbi.32 for ; Fri, 18 Jan 2013 03:43:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:resent-from:resent-date:resent-message-id :resent-to:delivered-to:x-received:received-spf:x-received:from:to :cc:subject:date:message-id:x-mailer:precedence:list-id :x-mailing-list:x-gm-message-state; bh=Afsbs7DWl1WFjYPHs0NHDIOyoIYlEpiG60adtravEHY=; b=NWBxpTDuCVpfFo91ZiSZNpJbhLHxh1ENJjf8B9Y6xHJAVhshykb7lzP7XfzMCzfFCA Vp3nC9UFPPIS+n/AvRP9ptoDYwGqzitwOMr0C4VdTrma5+pLxirpnC2Bs+pzMl28AA4l 9XtPfiEPnKQhbX8l3cbdFNd+HIiViIhR+xiMzoHUcFZcVObmvWOtvVpJ0PYp284InmVI Gwz51RNH2X/XHwiOyJqKcOOjk4U5y4uvbDilYgTf5spVklTt8NTPBvCyiJsFeaMMX1+8 0zhZbDGqkidaewgdCgCLkChMDjMtNn1U2Bu8tavnlIXoYoC88O2h6P6wqyGpZGVJN/P1 etUw== X-Received: by 10.220.218.197 with SMTP id hr5mr9045731vcb.8.1358509418524; Fri, 18 Jan 2013 03:43:38 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp79457veb; Fri, 18 Jan 2013 03:43:37 -0800 (PST) X-Received: by 10.181.13.75 with SMTP id ew11mr3178125wid.9.1358509417570; Fri, 18 Jan 2013 03:43:37 -0800 (PST) Received: from mail-ee0-f45.google.com (mail-ee0-f45.google.com [74.125.83.45]) by mx.google.com with ESMTPS id k48si8071440een.2.2013.01.18.03.43.37 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Jan 2013 03:43:37 -0800 (PST) Received-SPF: pass (google.com: domain of fabio.baltieri@gmail.com designates 74.125.83.45 as permitted sender) client-ip=74.125.83.45; Authentication-Results: mx.google.com; spf=pass (google.com: domain of fabio.baltieri@gmail.com designates 74.125.83.45 as permitted sender) smtp.mail=fabio.baltieri@gmail.com Received: by mail-ee0-f45.google.com with SMTP id b57so1680371eek.18 for ; Fri, 18 Jan 2013 03:43:37 -0800 (PST) X-Received: by 10.14.203.2 with SMTP id e2mr25258587eeo.20.1358509416979; Fri, 18 Jan 2013 03:43:36 -0800 (PST) Received: from localhost ([2a01:2029:1:1653:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPS id a2sm6979109eeo.1.2013.01.18.03.43.34 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Jan 2013 03:43:36 -0800 (PST) Resent-From: Fabio Baltieri Resent-Date: Fri, 18 Jan 2013 12:43:30 +0100 Resent-Message-ID: <20130118114330.GA22976@balto.lan> Resent-To: patches@linaro.org Delivered-To: baltoo@gmail.com Received: by 10.58.205.197 with SMTP id li5csp179372vec; Wed, 16 Jan 2013 13:31:51 -0800 (PST) X-Received: by 10.68.241.232 with SMTP id wl8mr6454469pbc.144.1358371910589; Wed, 16 Jan 2013 13:31:50 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wk7si22350391pbc.259.2013.01.16.13.31.42; Wed, 16 Jan 2013 13:31:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757245Ab3APVah (ORCPT + 99 others); Wed, 16 Jan 2013 16:30:37 -0500 Received: from mail-ea0-f174.google.com ([209.85.215.174]:34107 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756500Ab3APVag (ORCPT ); Wed, 16 Jan 2013 16:30:36 -0500 Received: by mail-ea0-f174.google.com with SMTP id 1so709323eaa.5 for ; Wed, 16 Jan 2013 13:30:35 -0800 (PST) X-Received: by 10.14.219.3 with SMTP id l3mr6042736eep.5.1358371834845; Wed, 16 Jan 2013 13:30:34 -0800 (PST) Received: from localhost ([2a01:2029:1:1653:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPS id 46sm31132559eeg.4.2013.01.16.13.30.30 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 16 Jan 2013 13:30:34 -0800 (PST) From: Fabio Baltieri To: netdev@vger.kernel.org, "David S. Miller" , Hideaki YOSHIFUJI Cc: linux-kernel@vger.kernel.org, Alexey Kuznetsov , James Morris , Patrick McHardy , Fabio Baltieri Subject: [PATCH net-next] ipv6: fix ipv6_prefix_equal64_half mask conversion Date: Wed, 16 Jan 2013 22:30:17 +0100 Message-Id: <1358371817-15378-1-git-send-email-fabio.baltieri@linaro.org> X-Mailer: git-send-email 1.7.12.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Gm-Message-State: ALoCoQmCqBe23Ywjs77/uwxChyEBwfyOL+2ymTTLjhjfXQEckfXzwlLomGQ5NV9wCLKEKG7LYQKx Fix the 64bit optimized version of ipv6_prefix_equal to convert the bitmask to network byte order only after the bit-shift. The bug was introduced in: 3867517 ipv6: 64bit version of ipv6_prefix_equal(). Signed-off-by: Fabio Baltieri --- include/net/ipv6.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/ipv6.h b/include/net/ipv6.h index dfc1363..459a5a4 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h @@ -404,7 +404,7 @@ static inline bool __ipv6_prefix_equal64_half(const __be64 *a1, const __be64 *a2, unsigned int len) { - if (len && ((*a1 ^ *a2) & cpu_to_be64(~0UL) << (64 - len))) + if (len && ((*a1 ^ *a2) & cpu_to_be64((~0UL) << (64 - len)))) return false; return true; }