diff mbox

[net-next,v4,2/3] ipv6: reuse rt6_need_strict

Message ID 1395979303-7668-3-git-send-email-wangyufen@huawei.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Wang Yufen March 28, 2014, 4:01 a.m. UTC
From: Wang Yufen <wangyufen@huawei.com>

Modify the rt6_need_strict, so that it can be reused

Signed-off-by: Wang Yufen <wangyufen@huawei.com>
---
 include/net/ip6_route.h | 1 +
 net/ipv6/route.c        | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Hannes Frederic Sowa March 28, 2014, 7:41 a.m. UTC | #1
On Fri, Mar 28, 2014 at 12:01:42PM +0800, Wangyufen wrote:
> From: Wang Yufen <wangyufen@huawei.com>
> 
> Modify the rt6_need_strict, so that it can be reused
> 
> Signed-off-by: Wang Yufen <wangyufen@huawei.com>
> ---
>  include/net/ip6_route.h | 1 +
>  net/ipv6/route.c        | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
> index 00e3f12..d9c316e 100644
> --- a/include/net/ip6_route.h
> +++ b/include/net/ip6_route.h
> @@ -51,6 +51,7 @@ static inline unsigned int rt6_flags2srcprefs(int flags)
>  	return (flags >> 3) & 7;
>  }
>  
> +bool rt6_need_strict(const struct in6_addr *daddr);
>  
>  void ip6_route_input(struct sk_buff *skb);
>  
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index fba54a4..f5fdccc 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -373,7 +373,7 @@ static bool rt6_check_expired(const struct rt6_info *rt)
>  	return false;
>  }
>  
> -static bool rt6_need_strict(const struct in6_addr *daddr)
> +bool rt6_need_strict(const struct in6_addr *daddr)
>  {
>  	return ipv6_addr_type(daddr) &
>  		(IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK);

Just a small suggestion:
I think we can move the whole function as static inline into the header.

Thanks,

  Hannes

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wang Yufen March 28, 2014, 9:04 a.m. UTC | #2
On 2014/3/28 15:41, Hannes Frederic Sowa wrote:
> On Fri, Mar 28, 2014 at 12:01:42PM +0800, Wangyufen wrote:
>> From: Wang Yufen <wangyufen@huawei.com>
>>
>> Modify the rt6_need_strict, so that it can be reused
>>
>> Signed-off-by: Wang Yufen <wangyufen@huawei.com>
>> ---
>>  include/net/ip6_route.h | 1 +
>>  net/ipv6/route.c        | 2 +-
>>  2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
>> index 00e3f12..d9c316e 100644
>> --- a/include/net/ip6_route.h
>> +++ b/include/net/ip6_route.h
>> @@ -51,6 +51,7 @@ static inline unsigned int rt6_flags2srcprefs(int flags)
>>  	return (flags >> 3) & 7;
>>  }
>>  
>> +bool rt6_need_strict(const struct in6_addr *daddr);
>>  
>>  void ip6_route_input(struct sk_buff *skb);
>>  
>> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
>> index fba54a4..f5fdccc 100644
>> --- a/net/ipv6/route.c
>> +++ b/net/ipv6/route.c
>> @@ -373,7 +373,7 @@ static bool rt6_check_expired(const struct rt6_info *rt)
>>  	return false;
>>  }
>>  
>> -static bool rt6_need_strict(const struct in6_addr *daddr)
>> +bool rt6_need_strict(const struct in6_addr *daddr)
>>  {
>>  	return ipv6_addr_type(daddr) &
>>  		(IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK);
> 
> Just a small suggestion:
> I think we can move the whole function as static inline into the header.
> 

Yes, thanks a lot!
I'll modify the patch.

> Thanks,
> 
>   Hannes
> 
> 
> 


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 00e3f12..d9c316e 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -51,6 +51,7 @@  static inline unsigned int rt6_flags2srcprefs(int flags)
 	return (flags >> 3) & 7;
 }
 
+bool rt6_need_strict(const struct in6_addr *daddr);
 
 void ip6_route_input(struct sk_buff *skb);
 
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index fba54a4..f5fdccc 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -373,7 +373,7 @@  static bool rt6_check_expired(const struct rt6_info *rt)
 	return false;
 }
 
-static bool rt6_need_strict(const struct in6_addr *daddr)
+bool rt6_need_strict(const struct in6_addr *daddr)
 {
 	return ipv6_addr_type(daddr) &
 		(IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK);