]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
net: fib_rules: set family in fib_rule_hdr centrally
authorPatrick McHardy <kaber@trash.net>
Tue, 13 Apr 2010 05:03:16 +0000 (05:03 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Apr 2010 21:49:30 +0000 (14:49 -0700)
All fib_rules implementations need to set the family in their ->fill()
functions. Since the value is available to the generic fib_nl_fill_rule()
function, set it there.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/fib_rules.c
net/decnet/dn_rules.c
net/ipv4/fib_rules.c
net/ipv6/fib6_rules.c

index 1eb32276be773c61c4dbb83ba0752ded6dac8ead..1bc66592453ca5cdffb71179a8c69eae7c2265c3 100644 (file)
@@ -535,6 +535,7 @@ static int fib_nl_fill_rule(struct sk_buff *skb, struct fib_rule *rule,
                return -EMSGSIZE;
 
        frh = nlmsg_data(nlh);
+       frh->family = ops->family;
        frh->table = rule->table;
        NLA_PUT_U32(skb, FRA_TABLE, rule->table);
        frh->res1 = 0;
index 2d14093a2c3aea31ef58bd7d661700ee2ccb653d..1c8cc6d5b645b5ef16da1d9ccd14a4536e24a3ab 100644 (file)
@@ -196,7 +196,6 @@ static int dn_fib_rule_fill(struct fib_rule *rule, struct sk_buff *skb,
 {
        struct dn_fib_rule *r = (struct dn_fib_rule *)rule;
 
-       frh->family = AF_DECnet;
        frh->dst_len = r->dst_len;
        frh->src_len = r->src_len;
        frh->tos = 0;
index 73b67849c5b95280ef8187ef5f38bc64ad1c9dc5..a18355e1511105804f800a59b5f4c3b5eac77abc 100644 (file)
@@ -213,7 +213,6 @@ static int fib4_rule_fill(struct fib_rule *rule, struct sk_buff *skb,
 {
        struct fib4_rule *rule4 = (struct fib4_rule *) rule;
 
-       frh->family = AF_INET;
        frh->dst_len = rule4->dst_len;
        frh->src_len = rule4->src_len;
        frh->tos = rule4->tos;
index 5e463c43fcc27a3abdfaf257a0bae134819154ae..92b2b7fb6c3d91131c2790113ab24240f32fc90d 100644 (file)
@@ -208,7 +208,6 @@ static int fib6_rule_fill(struct fib_rule *rule, struct sk_buff *skb,
 {
        struct fib6_rule *rule6 = (struct fib6_rule *) rule;
 
-       frh->family = AF_INET6;
        frh->dst_len = rule6->dst.plen;
        frh->src_len = rule6->src.plen;
        frh->tos = rule6->tclass;