From patchwork Fri Mar 28 09:20:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Yufen X-Patchwork-Id: 334622 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4D94A140081 for ; Fri, 28 Mar 2014 20:20:58 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751073AbaC1JUy (ORCPT ); Fri, 28 Mar 2014 05:20:54 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:30959 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750962AbaC1JUu (ORCPT ); Fri, 28 Mar 2014 05:20:50 -0400 Received: from 172.24.2.119 (EHLO szxeml205-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BTH54952; Fri, 28 Mar 2014 17:20:48 +0800 (CST) Received: from SZXEML404-HUB.china.huawei.com (10.82.67.59) by szxeml205-edg.china.huawei.com (172.24.2.58) with Microsoft SMTP Server (TLS) id 14.3.158.1; Fri, 28 Mar 2014 17:20:44 +0800 Received: from localhost (10.177.25.231) by szxeml404-hub.china.huawei.com (10.82.67.59) with Microsoft SMTP Server id 14.3.158.1; Fri, 28 Mar 2014 17:20:37 +0800 From: Wangyufen To: , CC: , Wang Yufen Subject: [PATCH net-next v5 2/3] ipv6: reuse rt6_need_strict Date: Fri, 28 Mar 2014 17:20:26 +0800 Message-ID: <1395998427-7532-3-git-send-email-wangyufen@huawei.com> X-Mailer: git-send-email 1.8.1.msysgit.1 In-Reply-To: <1395998427-7532-1-git-send-email-wangyufen@huawei.com> References: <1395998427-7532-1-git-send-email-wangyufen@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.25.231] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Wang Yufen Move the whole rt6_need_strict as static inline into ip6_route.h, so that it can be reused Signed-off-by: Wang Yufen --- include/net/ip6_route.h | 5 +++++ net/ipv6/route.c | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 00e3f12..33e8694 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h @@ -51,6 +51,11 @@ static inline unsigned int rt6_flags2srcprefs(int flags) return (flags >> 3) & 7; } +static inline bool rt6_need_strict(const struct in6_addr *daddr) +{ + return ipv6_addr_type(daddr) & + IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK); +} void ip6_route_input(struct sk_buff *skb); diff --git a/net/ipv6/route.c b/net/ipv6/route.c index b93ae6a..5015c50 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -374,12 +374,6 @@ static bool rt6_check_expired(const struct rt6_info *rt) return false; } -static bool rt6_need_strict(const struct in6_addr *daddr) -{ - return ipv6_addr_type(daddr) & - (IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK); -} - /* Multipath route selection: * Hash based function using packet header and flowlabel. * Adapted from fib_info_hashfn()