ipv6: move IPV6_TCLASS_SHIFT into ipv6.h and define a helper
[deliverable/linux.git] / net / ipv6 / fib6_rules.c
index e27591635f92c45306a33cb9513628751e93dd16..b4d5e1d97c1b2576fc02a15b7a05a773197bb8e0 100644 (file)
@@ -122,7 +122,11 @@ out:
 static bool fib6_rule_suppress(struct fib_rule *rule, struct fib_lookup_arg *arg)
 {
        struct rt6_info *rt = (struct rt6_info *) arg->result;
-       struct net_device *dev = rt->rt6i_idev->dev;
+       struct net_device *dev = NULL;
+
+       if (rt->rt6i_idev)
+               dev = rt->rt6i_idev->dev;
+
        /* do not accept result if the route does
         * not meet the required prefix length
         */
@@ -165,7 +169,7 @@ static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
                        return 0;
        }
 
-       if (r->tclass && r->tclass != ((ntohl(fl6->flowlabel) >> 20) & 0xff))
+       if (r->tclass && r->tclass != ip6_tclass(fl6->flowlabel))
                return 0;
 
        return 1;
This page took 0.030107 seconds and 5 git commands to generate.