Commit 98d3a6f
net: fib_rules: Convert RTM_NEWRULE to per-netns RTNL.
fib_nl_newrule() is the doit() handler for RTM_NEWRULE but also called
from vrf_newlink().
In the latter case, RTNL is already held and the 4th arg is true.
Let's hold per-netns RTNL in fib_newrule() if rtnl_held is false.
Note that we call fib_rule_get() before releasing per-netns RTNL to call
notify_rule_change() without RTNL and prevent freeing the new rule.
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20250207072502.87775-7-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent a0596c2 commit 98d3a6f
1 file changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
816 | 816 | | |
817 | 817 | | |
818 | 818 | | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
819 | 822 | | |
820 | 823 | | |
821 | 824 | | |
| |||
881 | 884 | | |
882 | 885 | | |
883 | 886 | | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
884 | 892 | | |
| 893 | + | |
885 | 894 | | |
886 | 895 | | |
887 | 896 | | |
888 | 897 | | |
889 | 898 | | |
| 899 | + | |
| 900 | + | |
890 | 901 | | |
891 | 902 | | |
892 | 903 | | |
| |||
897 | 908 | | |
898 | 909 | | |
899 | 910 | | |
900 | | - | |
| 911 | + | |
901 | 912 | | |
902 | 913 | | |
903 | 914 | | |
| |||
1320 | 1331 | | |
1321 | 1332 | | |
1322 | 1333 | | |
1323 | | - | |
| 1334 | + | |
| 1335 | + | |
1324 | 1336 | | |
1325 | 1337 | | |
1326 | 1338 | | |
| |||
0 commit comments