Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: add fib_rules_ops to flush_cache method

This is required to pass namespace context into rt_cache_flush called from
->flush_cache.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Denis V. Lunev and committed by
David S. Miller
ae299fc0 76e6ebfb

+5 -5
+1 -1
include/net/fib_rules.h
··· 62 62 63 63 /* Called after modifications to the rules set, must flush 64 64 * the route cache if one exists. */ 65 - void (*flush_cache)(void); 65 + void (*flush_cache)(struct fib_rules_ops *ops); 66 66 67 67 int nlgroup; 68 68 const struct nla_policy *policy;
+1 -1
net/core/fib_rules.c
··· 69 69 static void flush_route_cache(struct fib_rules_ops *ops) 70 70 { 71 71 if (ops->flush_cache) 72 - ops->flush_cache(); 72 + ops->flush_cache(ops); 73 73 } 74 74 75 75 int fib_rules_register(struct fib_rules_ops *ops)
+1 -1
net/decnet/dn_rules.c
··· 229 229 return 0; 230 230 } 231 231 232 - static void dn_fib_rule_flush_cache(void) 232 + static void dn_fib_rule_flush_cache(struct fib_rules_ops *ops) 233 233 { 234 234 dn_rt_cache_flush(-1); 235 235 }
+2 -2
net/ipv4/fib_rules.c
··· 258 258 + nla_total_size(4); /* flow */ 259 259 } 260 260 261 - static void fib4_rule_flush_cache(void) 261 + static void fib4_rule_flush_cache(struct fib_rules_ops *ops) 262 262 { 263 - rt_cache_flush(&init_net, -1); 263 + rt_cache_flush(ops->fro_net, -1); 264 264 } 265 265 266 266 static struct fib_rules_ops fib4_rules_ops_template = {