Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[linux-2.6-block.git] / net / ipv4 / fib_rules.c
index f2bda9e89c61b251b66ed1201c14e568bd5078b3..6e9ea69e5f751bd39d0cebb26b3b0b0e73877913 100644 (file)
@@ -76,6 +76,7 @@ static int fib4_rule_action(struct fib_rule *rule, struct flowi *flp,
 {
        int err = -EAGAIN;
        struct fib_table *tbl;
+       u32 tb_id;
 
        switch (rule->action) {
        case FR_ACT_TO_TBL:
@@ -94,7 +95,8 @@ static int fib4_rule_action(struct fib_rule *rule, struct flowi *flp,
 
        rcu_read_lock();
 
-       tbl = fib_get_table(rule->fr_net, rule->table);
+       tb_id = fib_rule_get_table(rule, arg);
+       tbl = fib_get_table(rule->fr_net, tb_id);
        if (tbl)
                err = fib_table_lookup(tbl, &flp->u.ip4,
                                       (struct fib_result *)arg->result,
@@ -180,7 +182,7 @@ static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
        if (err)
                goto errout;
 
-       if (rule->table == RT_TABLE_UNSPEC) {
+       if (rule->table == RT_TABLE_UNSPEC && !rule->l3mdev) {
                if (rule->action == FR_ACT_TO_TBL) {
                        struct fib_table *table;