diff options
author | Christian Brauner <christianvanbrauner@gmail.com> | 2018-01-24 15:26:32 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-29 11:31:06 -0500 |
commit | 7c4f63ba824302492985553018881455982241d6 (patch) | |
tree | 94d7a309a8829fda7650cae81983a87dd9a5ad7c /net/dsa/master.c | |
parent | 3e3ab9ccca5b50b11bd4d16c2048b667343354bd (diff) | |
download | linux-7c4f63ba824302492985553018881455982241d6.tar.bz2 |
rtnetlink: enable IFLA_IF_NETNSID in do_setlink()
RTM_{NEW,SET}LINK already allow operations on other network namespaces
by identifying the target network namespace through IFLA_NET_NS_{FD,PID}
properties. This is done by looking for the corresponding properties in
do_setlink(). Extend do_setlink() to also look for the IFLA_IF_NETNSID
property. This introduces no functional changes since all callers of
do_setlink() currently block IFLA_IF_NETNSID by reporting an error before
they reach do_setlink().
This introduces the helpers:
static struct net *rtnl_link_get_net_by_nlattr(struct net *src_net, struct
nlattr *tb[])
static struct net *rtnl_link_get_net_capable(const struct sk_buff *skb,
struct net *src_net,
struct nlattr *tb[], int cap)
to simplify permission checks and target network namespace retrieval for
RTM_* requests that already support IFLA_NET_NS_{FD,PID} but get extended
to IFLA_IF_NETNSID. To perserve backwards compatibility the helpers look
for IFLA_NET_NS_{FD,PID} properties first before checking for
IFLA_IF_NETNSID.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/master.c')
0 files changed, 0 insertions, 0 deletions