mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-07 06:52:07 +00:00
switchdev: pass pointer to fib_info instead of copy
The problem is that fib_info->nh is [0] so the struct fib_info
allocation size depends on number of nexthops. If we just copy fib_info,
we do not copy the nexthops info and driver accesses memory which is not
ours.
Given the fact that fib4 does not defer operations and therefore it does
not need copy, just pass the pointer down to drivers as it was done
before.
Fixes: 850d0cbc91
("switchdev: remove pointers from switchdev objects")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
dc327f8931
commit
da4ed55165
3 changed files with 5 additions and 7 deletions
|
@ -97,7 +97,7 @@ struct switchdev_obj_ipv4_fib {
|
|||
struct switchdev_obj obj;
|
||||
u32 dst;
|
||||
int dst_len;
|
||||
struct fib_info fi;
|
||||
struct fib_info *fi;
|
||||
u8 tos;
|
||||
u8 type;
|
||||
u32 nlflags;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue