diff options
author | Xin Long <lucien.xin@gmail.com> | 2023-06-12 11:55:34 -0400 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-06-14 22:34:13 -0700 |
commit | 89da780aa4c7667c8b1a144959206262aebdeabe (patch) | |
tree | ea242fe5a6946622ffeb6f8f44869de52c089afb /net/ipv6/route.c | |
parent | fa0e21fa44438a0e856d42224bfa24641d37b979 (diff) |
rtnetlink: move validate_linkmsg out of do_setlink
This patch moves validate_linkmsg() out of do_setlink() to its callers
and deletes the early validate_linkmsg() call in __rtnl_newlink(), so
that it will not call validate_linkmsg() twice in either of the paths:
- __rtnl_newlink() -> do_setlink()
- __rtnl_newlink() -> rtnl_newlink_create() -> rtnl_create_link()
Additionally, as validate_linkmsg() is now only called with a real
dev, we can remove the NULL check for dev in validate_linkmsg().
Note that we moved validate_linkmsg() check to the places where it has
not done any changes to the dev, as Jakub suggested.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/cf2ef061e08251faf9e8be25ff0d61150c030475.1686585334.git.lucien.xin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv6/route.c')
0 files changed, 0 insertions, 0 deletions