OSDN Git Service

rtnetlink: add helper to put master and link ifindexes
authorFlorian Westphal <fw@strlen.de>
Tue, 26 Sep 2017 11:58:40 +0000 (13:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Sep 2017 17:20:49 +0000 (10:20 -0700)
commit79110a0426d8179a51bf3cb698a84f6ec98ca60c
tree4b4e13116913a270002cd7d310049b3ef37c52be
parent61f26d92510ea1e30f9b69097b34b6a522daa1d2
rtnetlink: add helper to put master and link ifindexes

rtnl_fill_ifinfo currently requires caller to hold the rtnl mutex.
Unfortunately the function is quite large which makes it harder to see
which spots require the lock, which spots assume it and which ones could
do without.

Add helpers to factor out the ifindex dumping, one can use rcu to avoid
rtnl dependency.

Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c