From patchwork Tue Aug 30 09:22:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mi Jinlong X-Patchwork-Id: 1112552 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7U9JCH7031427 for ; Tue, 30 Aug 2011 09:19:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753034Ab1H3JS6 (ORCPT ); Tue, 30 Aug 2011 05:18:58 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:52496 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752937Ab1H3JS4 (ORCPT ); Tue, 30 Aug 2011 05:18:56 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 923C817008E; Tue, 30 Aug 2011 17:18:49 +0800 (CST) Received: from mailserver.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id p7U9IlW9002027; Tue, 30 Aug 2011 17:18:48 +0800 Received: from [127.0.0.1] ([10.167.225.24]) by mailserver.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.1FP4) with ESMTP id 2011083017174979-39424 ; Tue, 30 Aug 2011 17:17:49 +0800 Message-ID: <4E5CABE9.5090401@cn.fujitsu.com> Date: Tue, 30 Aug 2011 17:22:49 +0800 From: Mi Jinlong User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: NFS CC: "J. Bruce Fields" , Jeff Layton , Chuck Lever , Steve Dickson Subject: [PATCH 2/2] SUNRPC: compare scopeid for link-local addresses X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2011-08-30 17:17:49, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2011-08-30 17:17:51, Serialize complete at 2011-08-30 17:17:51 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 30 Aug 2011 09:19:12 +0000 (UTC) For ipv6 link-local addresses, sunrpc do not compare those scope id. This patch let sunrpc compares scope id only on link-local addresses. Signed-off-by: Mi Jinlong Reviewed-by: Reviewed-by: Jeff Layton Reviewed-by: Chuck Lever --- include/linux/sunrpc/clnt.h | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index db7bcaf..ee1bb67 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h @@ -218,7 +218,13 @@ static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, { const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; - return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr); + + if (!ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr)) + return false; + else if (ipv6_addr_type(&sin1->sin6_addr) & IPV6_ADDR_LINKLOCAL) + return sin1->sin6_scope_id == sin2->sin6_scope_id; + + return true; } static inline bool __rpc_copy_addr6(struct sockaddr *dst,