From: Joseph Hwang Date: Thu, 10 Sep 2020 06:04:02 +0000 (+0800) Subject: Bluetooth: sco: new getsockopt options BT_SNDMTU/BT_RCVMTU X-Git-Tag: v5.10-rc1~107^2~113^2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fc1a726f897acfa774b17eeb62b38480d1c9ea0;p=thirdparty%2Flinux.git Bluetooth: sco: new getsockopt options BT_SNDMTU/BT_RCVMTU This patch defines new getsockopt options BT_SNDMTU/BT_RCVMTU for SCO socket to be compatible with other bluetooth sockets. These new options return the same value as option SCO_OPTIONS which is already present on existing kernels. Signed-off-by: Joseph Hwang Reviewed-by: Alain Michaud Reviewed-by: Abhishek Pandit-Subedi Reviewed-by: Pali Rohár Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index dcf7f96ff417e..79ffcdef0b7ad 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -1001,6 +1001,12 @@ static int sco_sock_getsockopt(struct socket *sock, int level, int optname, err = -EFAULT; break; + case BT_SNDMTU: + case BT_RCVMTU: + if (put_user(sco_pi(sk)->conn->mtu, (u32 __user *)optval)) + err = -EFAULT; + break; + default: err = -ENOPROTOOPT; break;