ipv6: add ip6_route_lookup
authorFlorian Westphal <fw@strlen.de>
Mon, 5 Sep 2011 14:05:44 +0000 (16:05 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 4 Dec 2011 21:44:07 +0000 (22:44 +0100)
like rt6_lookup, but allows caller to pass in flowi6 structure.
Will be used by the upcoming ipv6 netfilter reverse path filter
match.

Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/net/ip6_route.h
net/ipv6/route.c

index 5e91b72fc7183092bbba1ba367206b2cff1cf2b1..9c9399c986162e1664ffe0dbb0696d10ddfb5d76 100644 (file)
@@ -70,6 +70,8 @@ extern void                   ip6_route_input(struct sk_buff *skb);
 extern struct dst_entry *      ip6_route_output(struct net *net,
                                                 const struct sock *sk,
                                                 struct flowi6 *fl6);
+extern struct dst_entry *      ip6_route_lookup(struct net *net,
+                                                struct flowi6 *fl6, int flags);
 
 extern int                     ip6_route_init(void);
 extern void                    ip6_route_cleanup(void);
index 1138b0a5566d47c16070488a6e29421254119f81..ab48b02eb56a7c96c5723a658820ba1dec993d38 100644 (file)
@@ -658,6 +658,13 @@ out:
 
 }
 
+struct dst_entry * ip6_route_lookup(struct net *net, struct flowi6 *fl6,
+                                   int flags)
+{
+       return fib6_rule_lookup(net, fl6, flags, ip6_pol_route_lookup);
+}
+EXPORT_SYMBOL_GPL(ip6_route_lookup);
+
 struct rt6_info *rt6_lookup(struct net *net, const struct in6_addr *daddr,
                            const struct in6_addr *saddr, int oif, int strict)
 {