Commit 28bb1726 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

net: fib_rules: set family in fib_rule_hdr centrally

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: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d8a566be
...@@ -535,6 +535,7 @@ static int fib_nl_fill_rule(struct sk_buff *skb, struct fib_rule *rule, ...@@ -535,6 +535,7 @@ static int fib_nl_fill_rule(struct sk_buff *skb, struct fib_rule *rule,
return -EMSGSIZE; return -EMSGSIZE;
frh = nlmsg_data(nlh); frh = nlmsg_data(nlh);
frh->family = ops->family;
frh->table = rule->table; frh->table = rule->table;
NLA_PUT_U32(skb, FRA_TABLE, rule->table); NLA_PUT_U32(skb, FRA_TABLE, rule->table);
frh->res1 = 0; frh->res1 = 0;
......
...@@ -196,7 +196,6 @@ static int dn_fib_rule_fill(struct fib_rule *rule, struct sk_buff *skb, ...@@ -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; struct dn_fib_rule *r = (struct dn_fib_rule *)rule;
frh->family = AF_DECnet;
frh->dst_len = r->dst_len; frh->dst_len = r->dst_len;
frh->src_len = r->src_len; frh->src_len = r->src_len;
frh->tos = 0; frh->tos = 0;
......
...@@ -213,7 +213,6 @@ static int fib4_rule_fill(struct fib_rule *rule, struct sk_buff *skb, ...@@ -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; struct fib4_rule *rule4 = (struct fib4_rule *) rule;
frh->family = AF_INET;
frh->dst_len = rule4->dst_len; frh->dst_len = rule4->dst_len;
frh->src_len = rule4->src_len; frh->src_len = rule4->src_len;
frh->tos = rule4->tos; frh->tos = rule4->tos;
......
...@@ -208,7 +208,6 @@ static int fib6_rule_fill(struct fib_rule *rule, struct sk_buff *skb, ...@@ -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; struct fib6_rule *rule6 = (struct fib6_rule *) rule;
frh->family = AF_INET6;
frh->dst_len = rule6->dst.plen; frh->dst_len = rule6->dst.plen;
frh->src_len = rule6->src.plen; frh->src_len = rule6->src.plen;
frh->tos = rule6->tclass; frh->tos = rule6->tclass;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment