mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: fupan.li@windriver.com
Cc: "Gustavo F. Padovan" <gustavo@padovan.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/bluetooth: make bluetooth socket can be created in net namespace
Date: Mon, 14 Aug 2017 11:30:02 +0200	[thread overview]
Message-ID: <6EC96C1E-CE98-4CF1-B1B2-1CEC9DBC36EA@holtmann.org> (raw)
In-Reply-To: <20170814071640.289327-1-fupan.li@windriver.com>

Hi Fupan,

> By now kernel only supported creating bluetooth socket in init_net
> net namespace, which made bluetooth device cannot be accessed in
> containers, this patch made bluetooth socket can be created in
> net namespaces to fix this issue.
> 
> Signed-off-by: Fupan Li <fupan.li@windriver.com>
> ---
> net/bluetooth/af_bluetooth.c | 2 +-
> net/bluetooth/bnep/sock.c    | 4 ++--
> net/bluetooth/cmtp/sock.c    | 4 ++--
> net/bluetooth/hci_sock.c     | 4 ++--
> net/bluetooth/hidp/sock.c    | 4 ++--
> net/bluetooth/l2cap_sock.c   | 4 ++--
> net/bluetooth/rfcomm/core.c  | 2 +-
> net/bluetooth/rfcomm/sock.c  | 4 ++--
> net/bluetooth/sco.c          | 4 ++--
> 9 files changed, 16 insertions(+), 16 deletions(-)
> 
> diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
> index 91e3ba280706..eec5ac17faee 100644
> --- a/net/bluetooth/af_bluetooth.c
> +++ b/net/bluetooth/af_bluetooth.c
> @@ -113,7 +113,7 @@ static int bt_sock_create(struct net *net, struct socket *sock, int proto,
> {
> 	int err;
> 
> -	if (net != &init_net)
> +	if (!net_eq(net, current->nsproxy->net_ns)) 
> 		return -EAFNOSUPPORT;

before I apply such a patch, what is the actual change here. What impact does this have? Are things like Bluetooth mgmt sockets still operating correctly after this? We have no support for move a Bluetooth controller into a container. The Bluetooth hardware is global.

Regards

Marcel

  reply	other threads:[~2017-08-14  9:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14  7:16 fupan.li
2017-08-14  9:30 ` Marcel Holtmann [this message]
2017-08-14  9:45   ` fupan
2017-08-14 12:46     ` Szymon Janc
2017-08-14 15:59       ` Marcel Holtmann
2017-08-15  1:12         ` fupan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6EC96C1E-CE98-4CF1-B1B2-1CEC9DBC36EA@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=fupan.li@windriver.com \
    --cc=gustavo@padovan.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®