* [PATCH] net: Allow DCBnl to use other namespaces besides init_net
@ 2012-12-10 6:48 John Fastabend
2012-12-10 19:09 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: John Fastabend @ 2012-12-10 6:48 UTC (permalink / raw)
To: netdev; +Cc: ebiederm
Allow DCB and net namespace to work together. This is useful if you
have containers that are bound to 'phys' interfaces that want to
also manage their DCB attributes.
The net namespace is taken from sock_net(skb->sk) of the netlink skb.
CC: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
---
net/dcb/dcbnl.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index b07c75d..1b588e2 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -1665,9 +1665,6 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
if ((nlh->nlmsg_type == RTM_SETDCB) && !capable(CAP_NET_ADMIN))
return -EPERM;
- if (!net_eq(net, &init_net))
- return -EINVAL;
-
ret = nlmsg_parse(nlh, sizeof(*dcb), tb, DCB_ATTR_MAX,
dcbnl_rtnl_policy);
if (ret < 0)
@@ -1684,7 +1681,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
if (!tb[DCB_ATTR_IFNAME])
return -EINVAL;
- netdev = dev_get_by_name(&init_net, nla_data(tb[DCB_ATTR_IFNAME]));
+ netdev = dev_get_by_name(net, nla_data(tb[DCB_ATTR_IFNAME]));
if (!netdev)
return -ENODEV;
@@ -1708,7 +1705,7 @@ static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
nlmsg_end(reply_skb, reply_nlh);
- ret = rtnl_unicast(reply_skb, &init_net, portid);
+ ret = rtnl_unicast(reply_skb, net, portid);
out:
dev_put(netdev);
return ret;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: Allow DCBnl to use other namespaces besides init_net
2012-12-10 6:48 [PATCH] net: Allow DCBnl to use other namespaces besides init_net John Fastabend
@ 2012-12-10 19:09 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-12-10 19:09 UTC (permalink / raw)
To: john.fastabend; +Cc: netdev, ebiederm
From: John Fastabend <john.fastabend@gmail.com>
Date: Sun, 09 Dec 2012 22:48:13 -0800
> Allow DCB and net namespace to work together. This is useful if you
> have containers that are bound to 'phys' interfaces that want to
> also manage their DCB attributes.
>
> The net namespace is taken from sock_net(skb->sk) of the netlink skb.
>
> CC: "Eric W. Biederman" <ebiederm@xmission.com>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-10 19:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-10 6:48 [PATCH] net: Allow DCBnl to use other namespaces besides init_net John Fastabend
2012-12-10 19:09 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).