diff options
Diffstat (limited to 'net/ipv4/fib_rules.c')
-rw-r--r-- | net/ipv4/fib_rules.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c index 2d043f71ef70..b23fd952c84f 100644 --- a/net/ipv4/fib_rules.c +++ b/net/ipv4/fib_rules.c | |||
@@ -169,8 +169,11 @@ static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb, | |||
169 | rule4->dst = nla_get_be32(tb[FRA_DST]); | 169 | rule4->dst = nla_get_be32(tb[FRA_DST]); |
170 | 170 | ||
171 | #ifdef CONFIG_IP_ROUTE_CLASSID | 171 | #ifdef CONFIG_IP_ROUTE_CLASSID |
172 | if (tb[FRA_FLOW]) | 172 | if (tb[FRA_FLOW]) { |
173 | rule4->tclassid = nla_get_u32(tb[FRA_FLOW]); | 173 | rule4->tclassid = nla_get_u32(tb[FRA_FLOW]); |
174 | if (rule4->tclassid) | ||
175 | fib_num_tclassid_users++; | ||
176 | } | ||
174 | #endif | 177 | #endif |
175 | 178 | ||
176 | rule4->src_len = frh->src_len; | 179 | rule4->src_len = frh->src_len; |
@@ -184,6 +187,16 @@ errout: | |||
184 | return err; | 187 | return err; |
185 | } | 188 | } |
186 | 189 | ||
190 | static void fib4_rule_delete(struct fib_rule *rule) | ||
191 | { | ||
192 | #ifdef CONFIG_IP_ROUTE_CLASSID | ||
193 | struct fib4_rule *rule4 = (struct fib4_rule *) rule; | ||
194 | |||
195 | if (rule4->tclassid) | ||
196 | fib_num_tclassid_users--; | ||
197 | #endif | ||
198 | } | ||
199 | |||
187 | static int fib4_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh, | 200 | static int fib4_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh, |
188 | struct nlattr **tb) | 201 | struct nlattr **tb) |
189 | { | 202 | { |
@@ -256,6 +269,7 @@ static const struct fib_rules_ops __net_initdata fib4_rules_ops_template = { | |||
256 | .action = fib4_rule_action, | 269 | .action = fib4_rule_action, |
257 | .match = fib4_rule_match, | 270 | .match = fib4_rule_match, |
258 | .configure = fib4_rule_configure, | 271 | .configure = fib4_rule_configure, |
272 | .delete = fib4_rule_delete, | ||
259 | .compare = fib4_rule_compare, | 273 | .compare = fib4_rule_compare, |
260 | .fill = fib4_rule_fill, | 274 | .fill = fib4_rule_fill, |
261 | .default_pref = fib_default_rule_pref, | 275 | .default_pref = fib_default_rule_pref, |