[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <8B552C8E-08D7-4536-92CD-130AF58B1E9D@holtmann.org>
Date: Thu, 17 Jul 2014 12:16:53 +0200
From: Marcel Holtmann <marcel@...tmann.org>
To: Vladimir Davydov <vdavydov@...allels.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Network Development <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
"Gustavo F. Padovan" <gustavo@...ovan.org>,
Johan Hedberg <johan.hedberg@...il.com>,
Linux Bluetooth mailing list
<linux-bluetooth@...r.kernel.org>
Subject: Re: [PATCH] bluetooth: never linger on process exit
Hi Vladimir,
> If the current process is exiting, lingering on socket close will make
> it unkillable, so we should avoid it.
>
> Reproducer:
>
> #include <sys/types.h>
> #include <sys/socket.h>
>
> #define BTPROTO_L2CAP 0
> #define BTPROTO_SCO 2
> #define BTPROTO_RFCOMM 3
>
> int main()
> {
> int fd;
> struct linger ling;
>
> fd = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
> //or: fd = socket(PF_BLUETOOTH, SOCK_DGRAM, BTPROTO_L2CAP);
> //or: fd = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_SCO);
>
> ling.l_onoff = 1;
> ling.l_linger = 1000000000;
> setsockopt(fd, SOL_SOCKET, SO_LINGER, &ling, sizeof(ling));
>
> return 0;
> }
>
> Signed-off-by: Vladimir Davydov <vdavydov@...allels.com>
> Cc: Marcel Holtmann <marcel@...tmann.org>
> Cc: Gustavo Padovan <gustavo@...ovan.org>
> Cc: Johan Hedberg <johan.hedberg@...il.com>
> ---
> net/bluetooth/l2cap_sock.c | 3 ++-
> net/bluetooth/rfcomm/sock.c | 3 ++-
> net/bluetooth/sco.c | 6 ++++--
> 3 files changed, 8 insertions(+), 4 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists