[IPv6] rules: Remove bogus tos validation check
[pandora-kernel.git] / net / ipv6 / fib6_rules.c
index 25804cb..0862809 100644 (file)
@@ -142,8 +142,7 @@ static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
        int err = -EINVAL;
        struct fib6_rule *rule6 = (struct fib6_rule *) rule;
 
-       if (frh->src_len > 128 || frh->dst_len > 128 ||
-           (frh->tos & ~IPV6_FLOWINFO_MASK))
+       if (frh->src_len > 128 || frh->dst_len > 128)
                goto errout;
 
        if (rule->action == FR_ACT_TO_TBL) {
@@ -232,6 +231,12 @@ static u32 fib6_rule_default_pref(void)
        return 0x3FFF;
 }
 
+static size_t fib6_rule_nlmsg_payload(struct fib_rule *rule)
+{
+       return nla_total_size(16) /* dst */
+              + nla_total_size(16); /* src */
+}
+
 static struct fib_rules_ops fib6_rules_ops = {
        .family                 = AF_INET6,
        .rule_size              = sizeof(struct fib6_rule),
@@ -241,6 +246,7 @@ static struct fib_rules_ops fib6_rules_ops = {
        .compare                = fib6_rule_compare,
        .fill                   = fib6_rule_fill,
        .default_pref           = fib6_rule_default_pref,
+       .nlmsg_payload          = fib6_rule_nlmsg_payload,
        .nlgroup                = RTNLGRP_IPV6_RULE,
        .policy                 = fib6_rule_policy,
        .rules_list             = &fib6_rules,