Message ID | CAKP4w2Q_5V=2CdyUpeXrHg=dTv1LNynp87gy6nrQYWYyBuA39A@mail.gmail.com |
---|---|
State | RFC, archived |
Delegated to: | David Miller |
Headers | show |
Hello! On Mon, Jul 22, 2013 at 06:20:18PM -0700, JP Abgrall wrote: > The following sequence fails when adding the default route: > (wlan0 is up, nothing is trying to manage,...) > > ip route flush dev wlan0 table all > ip route flush table 60 > ip route add 1.1.1.1/32 dev wlan0 table 60 I am not sure but would have expected that you needed to add a rule e.g. ip rule add oif wlan0 table 60 to successfully match the next route insertion. > ip route add default via 1.1.1.1 dev wlan0 table 60 Otherwise another rule lookup could alter the fib_lookup in such a way that the nexthop is not resolveable and the routing table in its entirty could have unresolveable holes. I did not check the code, this is just my intuition. Greetings, Hannes -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Jul 23, 2013 at 6:47 AM, Hannes Frederic Sowa <hannes@stressinduktion.org> wrote: > On Mon, Jul 22, 2013 at 06:20:18PM -0700, JP Abgrall wrote: >> ip route add 1.1.1.1/32 dev wlan0 table 60 > > I am not sure but would have expected that you needed to add a rule e.g. ip > rule add oif wlan0 table 60 to successfully match the next route insertion. Works. Thanks. Shows how much more I need to learn. Will go dig into the code to understand it better. -- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -567,6 +567,14 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi, if (fl4.flowi4_scope < RT_SCOPE_LINK) fl4.flowi4_scope = RT_SCOPE_LINK; err = fib_lookup(net, &fl4, &res); + if (err && cfg->fc_table != RT_TABLE_UNSPEC) { + struct fib_table *table; + table = fib_get_table(net, cfg->fc_table); + if (table && + !fib_table_lookup(table, &fl4, &res, + FIB_LOOKUP_NOREF)) + err = 0; + } if (err) { rcu_read_unlock();