From: wangyufen <wangyufen@huawei•com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded•com>
Cc: <davem@davemloft•net>, <netdev@vger•kernel.org>, <kuznet@ms2•inr.ac.ru>
Subject: Re: [PATCH net-next v5 2/3] ipv6: reuse rt6_need_strict
Date: Sat, 29 Mar 2014 09:25:09 +0800 [thread overview]
Message-ID: <533620F5.6050103@huawei.com> (raw)
In-Reply-To: <53357BD3.1060105@cogentembedded.com>
On 2014/3/28 21:40, Sergei Shtylyov wrote:
> Hello.
>
> On 28-03-2014 13:20, Wangyufen wrote:
>
>> From: Wang Yufen <wangyufen@huawei•com>
>
>> Move the whole rt6_need_strict as static inline into ip6_route.h,
>> so that it can be reused
>
>> Signed-off-by: Wang Yufen <wangyufen@huawei•com>
>> ---
>> 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);
>
> I don't think removing parens was correct here: & should have more priority than |.
Oh, fogive me for my carelessness, there missed a '('
sorry for that, and thanks
>
>> +}
>>
>> 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()
>
> WBR, Sergei
>
>
>
next prev parent reply other threads:[~2014-03-29 1:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-28 9:20 [PATCH net-next v5 0/3] ipv6: tcp_ipv6 policy route issue Wangyufen
2014-03-28 9:20 ` [PATCH net-next v5 1/3] ipv6: tcp_ipv6 do some cleanup Wangyufen
2014-03-28 9:20 ` [PATCH net-next v5 2/3] ipv6: reuse rt6_need_strict Wangyufen
2014-03-28 13:40 ` Sergei Shtylyov
2014-03-29 1:25 ` wangyufen [this message]
2014-03-28 9:20 ` [PATCH net-next v5 3/3] ipv6: tcp_ipv6 policy route issue Wangyufen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=533620F5.6050103@huawei.com \
--to=wangyufen@huawei$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=kuznet@ms2$(echo .)inr.ac.ru \
--cc=netdev@vger$(echo .)kernel.org \
--cc=sergei.shtylyov@cogentembedded$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox