Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipv6: reuse rt6_need_strict

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>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Wang Yufen and committed by
David S. Miller
60ea37f7 4aa956d8

+5 -6
+5
include/net/ip6_route.h
··· 51 51 return (flags >> 3) & 7; 52 52 } 53 53 54 + static inline bool rt6_need_strict(const struct in6_addr *daddr) 55 + { 56 + return ipv6_addr_type(daddr) & 57 + (IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK); 58 + } 54 59 55 60 void ip6_route_input(struct sk_buff *skb); 56 61
-6
net/ipv6/route.c
··· 374 374 return false; 375 375 } 376 376 377 - static bool rt6_need_strict(const struct in6_addr *daddr) 378 - { 379 - return ipv6_addr_type(daddr) & 380 - (IPV6_ADDR_MULTICAST | IPV6_ADDR_LINKLOCAL | IPV6_ADDR_LOOPBACK); 381 - } 382 - 383 377 /* Multipath route selection: 384 378 * Hash based function using packet header and flowlabel. 385 379 * Adapted from fib_info_hashfn()