Re: Bluetooth with Linux network namespace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(Resending because I had HTML turned on)

On Thu, Dec 28, 2023 at 8:44 PM Hayden James <hayden.james@xxxxxxxxx> wrote:
>
> Any reason why this patch can't be merged so that Bluetooth sockets can be created in network namespaces?
>
> https://lore.kernel.org/lkml/20170814071640.289327-1-fupan.li@xxxxxxxxxxxxx/
>
> As of the latest dev kernel on 12/28/2023 (6.7-rc7), this still doesn't work.
>
> Socket with AF_BLUETOOTH:
> int main() {
>     auto fd = socket(AF_BLUETOOTH, SOCK_RAW|SOCK_CLOEXEC, BTPROTO_HCI);
>     if (fd == -1) {
>         std::cerr << strerror(errno) << std::endl;
>         return EXIT_FAILURE;
>     }
>     else {
>         std::cout << "Successfully opened bluetooth socket" << std::endl;
>         close(fd);
>         return EXIT_SUCCESS;
>     }
> }
>
> Failure with network namespace:
> hjames@ubuntu:~$ docker run --rm -it --net=bridge hjames/bluetest bluetest
> Address family not supported by protocol
>
> Success with network without network namespace:
> hjames@ubuntu:~$ docker run --rm -it --net=host hjames/bluetest bluetest
> Successfully opened Bluetooth socket





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux