diff options
author | YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org> | 2013-01-17 07:53:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-17 18:38:19 -0500 |
commit | 9bb5a14813f502b867a45075c88bc1f2b78381df (patch) | |
tree | ad847b21e5891498947b270a483c78693779d4e1 /include/net/ip6_route.h | |
parent | 2152caea719657579daa3a1a57a5425a3db6d612 (diff) |
ipv6: Introduce rt6_nexthop() to select nexthop address.
For RTF_GATEWAY route, return rt->rt6i_gateway.
Otherwise, return 2nd argument (destination address).
This will be used by following patches which remove rt->n
dependency patches in ip6_dst_lookup_tail() and ip6_finish_output2().
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip6_route.h')
-rw-r--r-- | include/net/ip6_route.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 27d83183e615..30cbb15f6279 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -23,6 +23,7 @@ struct route_info { | |||
23 | #include <net/sock.h> | 23 | #include <net/sock.h> |
24 | #include <linux/ip.h> | 24 | #include <linux/ip.h> |
25 | #include <linux/ipv6.h> | 25 | #include <linux/ipv6.h> |
26 | #include <linux/route.h> | ||
26 | 27 | ||
27 | #define RT6_LOOKUP_F_IFACE 0x00000001 | 28 | #define RT6_LOOKUP_F_IFACE 0x00000001 |
28 | #define RT6_LOOKUP_F_REACHABLE 0x00000002 | 29 | #define RT6_LOOKUP_F_REACHABLE 0x00000002 |
@@ -194,4 +195,11 @@ static inline int ip6_skb_dst_mtu(struct sk_buff *skb) | |||
194 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); | 195 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); |
195 | } | 196 | } |
196 | 197 | ||
198 | static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt, struct in6_addr *dest) | ||
199 | { | ||
200 | if (rt->rt6i_flags & RTF_GATEWAY) | ||
201 | return &rt->rt6i_gateway; | ||
202 | return dest; | ||
203 | } | ||
204 | |||
197 | #endif | 205 | #endif |