summaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorChristian Brauner <christianvanbrauner@gmail.com>2018-01-24 15:26:32 +0100
committerDavid S. Miller <davem@davemloft.net>2018-01-29 11:31:06 -0500
commit7c4f63ba824302492985553018881455982241d6 (patch)
tree94d7a309a8829fda7650cae81983a87dd9a5ad7c /drivers/isdn
parent3e3ab9ccca5b50b11bd4d16c2048b667343354bd (diff)
downloadop-kernel-dev-7c4f63ba824302492985553018881455982241d6.zip
op-kernel-dev-7c4f63ba824302492985553018881455982241d6.tar.gz
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 'drivers/isdn')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud