Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a8891a0 authored by Benjamin Thery's avatar Benjamin Thery Committed by David S. Miller
Browse files

[IPv6]: use container_of() macro in fib6_clean_node()



In ip6_fib.c, fib6_clean_node() casts a fib6_walker_t pointer to
a fib6_cleaner_t pointer assuming a struct fib6_walker_t (field 'w')
is the first field in struct fib6_walker_t.

To prevent any future problems that may occur if one day a field
is inadvertently inserted before the 'w' field in struct fib6_cleaner_t,
(and to improve readability), this patch uses the container_of() macro.

Signed-off-by: default avatarBenjamin Thery <benjamin.thery@bull.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4665079c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1313,7 +1313,7 @@ static int fib6_clean_node(struct fib6_walker_t *w)
{
	int res;
	struct rt6_info *rt;
	struct fib6_cleaner_t *c = (struct fib6_cleaner_t*)w;
	struct fib6_cleaner_t *c = container_of(w, struct fib6_cleaner_t, w);

	for (rt = w->leaf; rt; rt = rt->u.dst.rt6_next) {
		res = c->func(rt, c->arg);