[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHmME9oTdm2NaFYKdx-=Ax2v=jDPLp3EGvyFMk0CPLt-ZdXMnA@mail.gmail.com>
Date: Wed, 3 Feb 2016 18:40:53 +0100
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: David Ahern <dsa@...ulusnetworks.com>
Cc: Netdev <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>,
"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: Re: [RFC] Inverse of flowi{4,6}_oif: flowi{4,6}_not_oif
On Wed, Feb 3, 2016 at 5:28 PM, David Ahern <dsa@...ulusnetworks.com> wrote:
>
> For IPv6 start with ip6_pol_route_lookup and modifying rt6_device_match
>
If that's all it takes, then that turns out to be ridiculously easy
too. I'll get a patch together for this.
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -467,6 +467,7 @@ static inline struct rt6_info
*rt6_device_match(struct net *net,
struct rt6_info *rt,
const struct
in6_addr *saddr,
int oif,
+ int not_oif,
int flags)
{
struct rt6_info *local = NULL;
@@ -478,6 +479,9 @@ static inline struct rt6_info
*rt6_device_match(struct net *net,
for (sprt = rt; sprt; sprt = sprt->dst.rt6_next) {
struct net_device *dev = sprt->dst.dev;
+ if (not_oif && dev->ifindex == not_oif)
+ continue;
+
if (oif) {
if (dev->ifindex == oif)
return sprt;
@@ -856,7 +860,7 @@ static struct rt6_info
*ip6_pol_route_lookup(struct net *net,
fn = fib6_lookup(&table->tb6_root, &fl6->daddr, &fl6->saddr);
restart:
rt = fn->leaf;
- rt = rt6_device_match(net, rt, &fl6->saddr, fl6->flowi6_oif, flags);
+ rt = rt6_device_match(net, rt, &fl6->saddr, fl6->flowi6_oif,
fl6->flowi6_not_oif, flags);
if (rt->rt6i_nsiblings && fl6->flowi6_oif == 0)
rt = rt6_multipath_select(rt, fl6, fl6->flowi6_oif, flags);
if (rt == net->ipv6.ip6_null_entry) {
Powered by blists - more mailing lists