提交 9225b230 编写于 作者: F fan.du 提交者: David S. Miller

net: ipv6 eliminate parameter "int addrlen" in function fib6_add_1

The "int addrlen" in fib6_add_1 is rebundant, as we can get it from
parameter "struct in6_addr *addr" once we modified its type.
And also fix some coding style issues in fib6_add_1
Signed-off-by: NFan Du <fan.du@windriver.com>
Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 86a37def
...@@ -425,8 +425,8 @@ static int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -425,8 +425,8 @@ static int inet6_dump_fib(struct sk_buff *skb, struct netlink_callback *cb)
* node. * node.
*/ */
static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr, static struct fib6_node *fib6_add_1(struct fib6_node *root,
int addrlen, int plen, struct in6_addr *addr, int plen,
int offset, int allow_create, int offset, int allow_create,
int replace_required) int replace_required)
{ {
...@@ -543,7 +543,7 @@ static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr, ...@@ -543,7 +543,7 @@ static struct fib6_node * fib6_add_1(struct fib6_node *root, void *addr,
but if it is >= plen, the value is ignored in any case. but if it is >= plen, the value is ignored in any case.
*/ */
bit = __ipv6_addr_diff(addr, &key->addr, addrlen); bit = __ipv6_addr_diff(addr, &key->addr, sizeof(*addr));
/* /*
* (intermediate)[in] * (intermediate)[in]
...@@ -822,9 +822,9 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info) ...@@ -822,9 +822,9 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info)
if (!allow_create && !replace_required) if (!allow_create && !replace_required)
pr_warn("RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE\n"); pr_warn("RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE\n");
fn = fib6_add_1(root, &rt->rt6i_dst.addr, sizeof(struct in6_addr), fn = fib6_add_1(root, &rt->rt6i_dst.addr, rt->rt6i_dst.plen,
rt->rt6i_dst.plen, offsetof(struct rt6_info, rt6i_dst), offsetof(struct rt6_info, rt6i_dst), allow_create,
allow_create, replace_required); replace_required);
if (IS_ERR(fn)) { if (IS_ERR(fn)) {
err = PTR_ERR(fn); err = PTR_ERR(fn);
...@@ -863,7 +863,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info) ...@@ -863,7 +863,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info)
/* Now add the first leaf node to new subtree */ /* Now add the first leaf node to new subtree */
sn = fib6_add_1(sfn, &rt->rt6i_src.addr, sn = fib6_add_1(sfn, &rt->rt6i_src.addr,
sizeof(struct in6_addr), rt->rt6i_src.plen, rt->rt6i_src.plen,
offsetof(struct rt6_info, rt6i_src), offsetof(struct rt6_info, rt6i_src),
allow_create, replace_required); allow_create, replace_required);
...@@ -882,7 +882,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info) ...@@ -882,7 +882,7 @@ int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info)
fn->subtree = sfn; fn->subtree = sfn;
} else { } else {
sn = fib6_add_1(fn->subtree, &rt->rt6i_src.addr, sn = fib6_add_1(fn->subtree, &rt->rt6i_src.addr,
sizeof(struct in6_addr), rt->rt6i_src.plen, rt->rt6i_src.plen,
offsetof(struct rt6_info, rt6i_src), offsetof(struct rt6_info, rt6i_src),
allow_create, replace_required); allow_create, replace_required);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册