* [PATCH net-next (V4) 08/11] ipv6: Introduce rt6_nexthop() to select nexthop address.
@ 2013-01-17 22:53 YOSHIFUJI Hideaki
0 siblings, 0 replies; only message in thread
From: YOSHIFUJI Hideaki @ 2013-01-17 22:53 UTC (permalink / raw)
To: davem, netdev; +Cc: yoshfuji, xiyou.wangcong
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>
---
include/net/ip6_route.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 27d8318..30cbb15 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -23,6 +23,7 @@ struct route_info {
#include <net/sock.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
+#include <linux/route.h>
#define RT6_LOOKUP_F_IFACE 0x00000001
#define RT6_LOOKUP_F_REACHABLE 0x00000002
@@ -194,4 +195,11 @@ static inline int ip6_skb_dst_mtu(struct sk_buff *skb)
skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb));
}
+static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt, struct in6_addr *dest)
+{
+ if (rt->rt6i_flags & RTF_GATEWAY)
+ return &rt->rt6i_gateway;
+ return dest;
+}
+
#endif
--
1.7.9.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-01-17 22:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-17 22:53 [PATCH net-next (V4) 08/11] ipv6: Introduce rt6_nexthop() to select nexthop address YOSHIFUJI Hideaki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.