diff options
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_sock.c | 9 | ||||
-rw-r--r-- | net/bluetooth/l2cap.c | 6 |
2 files changed, 15 insertions, 0 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 832b5f44be5c..bfc9a35bad33 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -499,6 +499,15 @@ static int hci_sock_setsockopt(struct socket *sock, int level, int optname, char | |||
499 | break; | 499 | break; |
500 | 500 | ||
501 | case HCI_FILTER: | 501 | case HCI_FILTER: |
502 | { | ||
503 | struct hci_filter *f = &hci_pi(sk)->filter; | ||
504 | |||
505 | uf.type_mask = f->type_mask; | ||
506 | uf.opcode = f->opcode; | ||
507 | uf.event_mask[0] = *((u32 *) f->event_mask + 0); | ||
508 | uf.event_mask[1] = *((u32 *) f->event_mask + 1); | ||
509 | } | ||
510 | |||
502 | len = min_t(unsigned int, len, sizeof(uf)); | 511 | len = min_t(unsigned int, len, sizeof(uf)); |
503 | if (copy_from_user(&uf, optval, len)) { | 512 | if (copy_from_user(&uf, optval, len)) { |
504 | err = -EFAULT; | 513 | err = -EFAULT; |
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index a5867879b615..a59b1fb63b76 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -954,11 +954,17 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch | |||
954 | 954 | ||
955 | switch (optname) { | 955 | switch (optname) { |
956 | case L2CAP_OPTIONS: | 956 | case L2CAP_OPTIONS: |
957 | opts.imtu = l2cap_pi(sk)->imtu; | ||
958 | opts.omtu = l2cap_pi(sk)->omtu; | ||
959 | opts.flush_to = l2cap_pi(sk)->flush_to; | ||
960 | opts.mode = 0x00; | ||
961 | |||
957 | len = min_t(unsigned int, sizeof(opts), optlen); | 962 | len = min_t(unsigned int, sizeof(opts), optlen); |
958 | if (copy_from_user((char *) &opts, optval, len)) { | 963 | if (copy_from_user((char *) &opts, optval, len)) { |
959 | err = -EFAULT; | 964 | err = -EFAULT; |
960 | break; | 965 | break; |
961 | } | 966 | } |
967 | |||
962 | l2cap_pi(sk)->imtu = opts.imtu; | 968 | l2cap_pi(sk)->imtu = opts.imtu; |
963 | l2cap_pi(sk)->omtu = opts.omtu; | 969 | l2cap_pi(sk)->omtu = opts.omtu; |
964 | break; | 970 | break; |