diff options
-rw-r--r-- | include/net/fib_rules.h | 7 | ||||
-rw-r--r-- | net/decnet/dn_rules.c | 6 | ||||
-rw-r--r-- | net/ipv4/fib_rules.c | 6 | ||||
-rw-r--r-- | net/ipv6/fib6_rules.c | 6 |
4 files changed, 10 insertions, 15 deletions
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index 68542b565cf7..e4ba781d289f 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
@@ -59,6 +59,13 @@ struct fib_rules_ops | |||
59 | struct module *owner; | 59 | struct module *owner; |
60 | }; | 60 | }; |
61 | 61 | ||
62 | #define FRA_GENERIC_POLICY \ | ||
63 | [FRA_IFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \ | ||
64 | [FRA_PRIORITY] = { .type = NLA_U32 }, \ | ||
65 | [FRA_FWMARK] = { .type = NLA_U32 }, \ | ||
66 | [FRA_FWMASK] = { .type = NLA_U32 }, \ | ||
67 | [FRA_TABLE] = { .type = NLA_U32 } | ||
68 | |||
62 | static inline void fib_rule_get(struct fib_rule *rule) | 69 | static inline void fib_rule_get(struct fib_rule *rule) |
63 | { | 70 | { |
64 | atomic_inc(&rule->refcnt); | 71 | atomic_inc(&rule->refcnt); |
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c index 1f5d23c96681..e32d0c3d5a96 100644 --- a/net/decnet/dn_rules.c +++ b/net/decnet/dn_rules.c | |||
@@ -108,13 +108,9 @@ errout: | |||
108 | } | 108 | } |
109 | 109 | ||
110 | static struct nla_policy dn_fib_rule_policy[FRA_MAX+1] __read_mostly = { | 110 | static struct nla_policy dn_fib_rule_policy[FRA_MAX+1] __read_mostly = { |
111 | [FRA_IFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, | 111 | FRA_GENERIC_POLICY, |
112 | [FRA_PRIORITY] = { .type = NLA_U32 }, | ||
113 | [FRA_SRC] = { .type = NLA_U16 }, | 112 | [FRA_SRC] = { .type = NLA_U16 }, |
114 | [FRA_DST] = { .type = NLA_U16 }, | 113 | [FRA_DST] = { .type = NLA_U16 }, |
115 | [FRA_FWMARK] = { .type = NLA_U32 }, | ||
116 | [FRA_FWMASK] = { .type = NLA_U32 }, | ||
117 | [FRA_TABLE] = { .type = NLA_U32 }, | ||
118 | }; | 114 | }; |
119 | 115 | ||
120 | static int dn_fib_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) | 116 | static int dn_fib_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) |
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index d2a190a35d65..fd4a8cd4c06e 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c | |||
@@ -170,14 +170,10 @@ static struct fib_table *fib_empty_table(void) | |||
170 | } | 170 | } |
171 | 171 | ||
172 | static struct nla_policy fib4_rule_policy[FRA_MAX+1] __read_mostly = { | 172 | static struct nla_policy fib4_rule_policy[FRA_MAX+1] __read_mostly = { |
173 | [FRA_IFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, | 173 | FRA_GENERIC_POLICY, |
174 | [FRA_PRIORITY] = { .type = NLA_U32 }, | ||
175 | [FRA_SRC] = { .type = NLA_U32 }, | 174 | [FRA_SRC] = { .type = NLA_U32 }, |
176 | [FRA_DST] = { .type = NLA_U32 }, | 175 | [FRA_DST] = { .type = NLA_U32 }, |
177 | [FRA_FWMARK] = { .type = NLA_U32 }, | ||
178 | [FRA_FWMASK] = { .type = NLA_U32 }, | ||
179 | [FRA_FLOW] = { .type = NLA_U32 }, | 176 | [FRA_FLOW] = { .type = NLA_U32 }, |
180 | [FRA_TABLE] = { .type = NLA_U32 }, | ||
181 | }; | 177 | }; |
182 | 178 | ||
183 | static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb, | 179 | static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb, |
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c index 26374cbe2bc2..8377477b2c19 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c | |||
@@ -130,13 +130,9 @@ static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) | |||
130 | } | 130 | } |
131 | 131 | ||
132 | static struct nla_policy fib6_rule_policy[FRA_MAX+1] __read_mostly = { | 132 | static struct nla_policy fib6_rule_policy[FRA_MAX+1] __read_mostly = { |
133 | [FRA_IFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, | 133 | FRA_GENERIC_POLICY, |
134 | [FRA_PRIORITY] = { .type = NLA_U32 }, | ||
135 | [FRA_SRC] = { .len = sizeof(struct in6_addr) }, | 134 | [FRA_SRC] = { .len = sizeof(struct in6_addr) }, |
136 | [FRA_DST] = { .len = sizeof(struct in6_addr) }, | 135 | [FRA_DST] = { .len = sizeof(struct in6_addr) }, |
137 | [FRA_FWMARK] = { .type = NLA_U32 }, | ||
138 | [FRA_FWMASK] = { .type = NLA_U32 }, | ||
139 | [FRA_TABLE] = { .type = NLA_U32 }, | ||
140 | }; | 136 | }; |
141 | 137 | ||
142 | static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb, | 138 | static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb, |