Thread (20 messages) 20 messages, 4 authors, 2025-02-11

Re: [PATCH v2 net-next 5/8] net: fib_rules: Factorise fib_newrule() and fib_delrule().

flat view

From: Eric Dumazet <hidden>
Date: 2025-02-07 08:34:52

On Fri, Feb 7, 2025 at 8:27 AM Kuniyuki Iwashima [off-list ref] wrote:
fib_nl_newrule() / fib_nl_delrule() is the doit() handler for
RTM_NEWRULE / RTM_DELRULE but also called from vrf_newlink().

Currently, we hold RTNL on both paths but will not on the former.

Also, we set dev_net(dev)->rtnl to skb->sk in vrf_fib_rule() because
fib_nl_newrule() / fib_nl_delrule() fetch net as sock_net(skb->sk).

Let's Factorise the two functions and pass net and rtnl_held flag.

Signed-off-by: Kuniyuki Iwashima <redacted>
Much nicer, thanks !

Reviewed-by: Eric Dumazet <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help