diff options
author | Florian Westphal <fw@strlen.de> | 2015-01-05 23:57:44 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-06 04:55:24 +0100 |
commit | e715b6d3a5ef55834778d49224e60e8ccb5bf45f (patch) | |
tree | 61b0e9a29119fbe6062956f9429711f21eb1cefb /include/net/ip6_fib.h | |
parent | net: fib6: fib6_commit_metrics: fix potential NULL pointer dereference (diff) | |
download | linux-e715b6d3a5ef55834778d49224e60e8ccb5bf45f.tar.xz linux-e715b6d3a5ef55834778d49224e60e8ccb5bf45f.zip |
net: fib6: convert cfg metric to u32 outside of table write lock
Do the nla validation earlier, outside the write lock.
This is needed by followup patch which needs to be able to call
request_module (which can sleep) if needed.
Joint work with Daniel Borkmann.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip6_fib.h')
-rw-r--r-- | include/net/ip6_fib.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 8eea35d32a75..20e80fa7bbdd 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h @@ -74,6 +74,11 @@ struct fib6_node { #define FIB6_SUBTREE(fn) ((fn)->subtree) #endif +struct mx6_config { + const u32 *mx; + DECLARE_BITMAP(mx_valid, RTAX_MAX); +}; + /* * routing information * @@ -291,9 +296,8 @@ struct fib6_node *fib6_locate(struct fib6_node *root, void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg), void *arg); -int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info, - struct nlattr *mx, int mx_len); - +int fib6_add(struct fib6_node *root, struct rt6_info *rt, + struct nl_info *info, struct mx6_config *mxc); int fib6_del(struct rt6_info *rt, struct nl_info *info); void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info); |