]> err.no Git - linux-2.6/blobdiff - net/ipv4/fib_rules.c
Merge branch 'upstream' into upstream-jgarzik
[linux-2.6] / net / ipv4 / fib_rules.c
index d2a190a35d65f962147e67e78d926aa44167e442..b837c33e0404fc09a8e54ea7798d8e8b698657af 100644 (file)
@@ -170,14 +170,10 @@ static struct fib_table *fib_empty_table(void)
 }
 
 static struct nla_policy fib4_rule_policy[FRA_MAX+1] __read_mostly = {
-       [FRA_IFNAME]    = { .type = NLA_STRING, .len = IFNAMSIZ - 1 },
-       [FRA_PRIORITY]  = { .type = NLA_U32 },
+       FRA_GENERIC_POLICY,
        [FRA_SRC]       = { .type = NLA_U32 },
        [FRA_DST]       = { .type = NLA_U32 },
-       [FRA_FWMARK]    = { .type = NLA_U32 },
-       [FRA_FWMASK]    = { .type = NLA_U32 },
        [FRA_FLOW]      = { .type = NLA_U32 },
-       [FRA_TABLE]     = { .type = NLA_U32 },
 };
 
 static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
@@ -303,6 +299,13 @@ static u32 fib4_rule_default_pref(void)
        return 0;
 }
 
+static size_t fib4_rule_nlmsg_payload(struct fib_rule *rule)
+{
+       return nla_total_size(4) /* dst */
+              + nla_total_size(4) /* src */
+              + nla_total_size(4); /* flow */
+}
+
 static struct fib_rules_ops fib4_rules_ops = {
        .family         = AF_INET,
        .rule_size      = sizeof(struct fib4_rule),
@@ -312,6 +315,7 @@ static struct fib_rules_ops fib4_rules_ops = {
        .compare        = fib4_rule_compare,
        .fill           = fib4_rule_fill,
        .default_pref   = fib4_rule_default_pref,
+       .nlmsg_payload  = fib4_rule_nlmsg_payload,
        .nlgroup        = RTNLGRP_IPV4_RULE,
        .policy         = fib4_rule_policy,
        .rules_list     = &fib4_rules,