Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
39ae691d
Commit
39ae691d
authored
Jan 08, 2004
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BLUETOOTH]: Use size_t for size in {send,recv}msg.
parent
c97ddec1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
14 deletions
+20
-14
include/net/bluetooth/bluetooth.h
include/net/bluetooth/bluetooth.h
+1
-1
net/bluetooth/af_bluetooth.c
net/bluetooth/af_bluetooth.c
+3
-2
net/bluetooth/hci_sock.c
net/bluetooth/hci_sock.c
+6
-4
net/bluetooth/l2cap.c
net/bluetooth/l2cap.c
+2
-1
net/bluetooth/rfcomm/sock.c
net/bluetooth/rfcomm/sock.c
+6
-5
net/bluetooth/sco.c
net/bluetooth/sco.c
+2
-1
No files found.
include/net/bluetooth/bluetooth.h
View file @
39ae691d
...
@@ -129,7 +129,7 @@ int bt_sock_unregister(int proto);
...
@@ -129,7 +129,7 @@ int bt_sock_unregister(int proto);
struct
sock
*
bt_sock_alloc
(
struct
socket
*
sock
,
int
proto
,
int
pi_size
,
int
prio
);
struct
sock
*
bt_sock_alloc
(
struct
socket
*
sock
,
int
proto
,
int
pi_size
,
int
prio
);
void
bt_sock_link
(
struct
bt_sock_list
*
l
,
struct
sock
*
s
);
void
bt_sock_link
(
struct
bt_sock_list
*
l
,
struct
sock
*
s
);
void
bt_sock_unlink
(
struct
bt_sock_list
*
l
,
struct
sock
*
s
);
void
bt_sock_unlink
(
struct
bt_sock_list
*
l
,
struct
sock
*
s
);
int
bt_sock_recvmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
in
t
len
,
int
flags
);
int
bt_sock_recvmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
size_
t
len
,
int
flags
);
uint
bt_sock_poll
(
struct
file
*
file
,
struct
socket
*
sock
,
poll_table
*
wait
);
uint
bt_sock_poll
(
struct
file
*
file
,
struct
socket
*
sock
,
poll_table
*
wait
);
int
bt_sock_wait_state
(
struct
sock
*
sk
,
int
state
,
unsigned
long
timeo
);
int
bt_sock_wait_state
(
struct
sock
*
sk
,
int
state
,
unsigned
long
timeo
);
...
...
net/bluetooth/af_bluetooth.c
View file @
39ae691d
...
@@ -201,12 +201,13 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
...
@@ -201,12 +201,13 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
}
}
int
bt_sock_recvmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
int
bt_sock_recvmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
in
t
len
,
int
flags
)
struct
msghdr
*
msg
,
size_
t
len
,
int
flags
)
{
{
int
noblock
=
flags
&
MSG_DONTWAIT
;
int
noblock
=
flags
&
MSG_DONTWAIT
;
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
int
copied
,
err
;
size_t
copied
;
int
err
;
BT_DBG
(
"sock %p sk %p len %d"
,
sock
,
sk
,
len
);
BT_DBG
(
"sock %p sk %p len %d"
,
sock
,
sk
,
len
);
...
...
net/bluetooth/hci_sock.c
View file @
39ae691d
...
@@ -319,7 +319,8 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
...
@@ -319,7 +319,8 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
put_cmsg
(
msg
,
SOL_HCI
,
HCI_CMSG_TSTAMP
,
sizeof
(
skb
->
stamp
),
&
skb
->
stamp
);
put_cmsg
(
msg
,
SOL_HCI
,
HCI_CMSG_TSTAMP
,
sizeof
(
skb
->
stamp
),
&
skb
->
stamp
);
}
}
static
int
hci_sock_recvmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
int
len
,
int
flags
)
static
int
hci_sock_recvmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
size_t
len
,
int
flags
)
{
{
int
noblock
=
flags
&
MSG_DONTWAIT
;
int
noblock
=
flags
&
MSG_DONTWAIT
;
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
...
@@ -355,7 +356,8 @@ static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msgh
...
@@ -355,7 +356,8 @@ static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msgh
return
err
?
:
copied
;
return
err
?
:
copied
;
}
}
static
int
hci_sock_sendmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
int
len
)
static
int
hci_sock_sendmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
size_t
len
)
{
{
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
struct
hci_dev
*
hdev
;
struct
hci_dev
*
hdev
;
...
@@ -370,7 +372,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
...
@@ -370,7 +372,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
if
(
msg
->
msg_flags
&
~
(
MSG_DONTWAIT
|
MSG_NOSIGNAL
|
MSG_ERRQUEUE
))
if
(
msg
->
msg_flags
&
~
(
MSG_DONTWAIT
|
MSG_NOSIGNAL
|
MSG_ERRQUEUE
))
return
-
EINVAL
;
return
-
EINVAL
;
if
(
len
<
4
)
if
(
len
<
4
||
len
>
HCI_MAX_FRAME_SIZE
)
return
-
EINVAL
;
return
-
EINVAL
;
lock_sock
(
sk
);
lock_sock
(
sk
);
...
...
net/bluetooth/l2cap.c
View file @
39ae691d
...
@@ -706,7 +706,8 @@ static inline int l2cap_do_send(struct sock *sk, struct msghdr *msg, int len)
...
@@ -706,7 +706,8 @@ static inline int l2cap_do_send(struct sock *sk, struct msghdr *msg, int len)
return
err
;
return
err
;
}
}
static
int
l2cap_sock_sendmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
int
len
)
static
int
l2cap_sock_sendmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
size_t
len
)
{
{
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
int
err
=
0
;
int
err
=
0
;
...
...
net/bluetooth/rfcomm/sock.c
View file @
39ae691d
...
@@ -482,12 +482,12 @@ static int rfcomm_sock_getname(struct socket *sock, struct sockaddr *addr, int *
...
@@ -482,12 +482,12 @@ static int rfcomm_sock_getname(struct socket *sock, struct sockaddr *addr, int *
}
}
static
int
rfcomm_sock_sendmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
static
int
rfcomm_sock_sendmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
in
t
len
)
struct
msghdr
*
msg
,
size_
t
len
)
{
{
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
struct
rfcomm_dlc
*
d
=
rfcomm_pi
(
sk
)
->
dlc
;
struct
rfcomm_dlc
*
d
=
rfcomm_pi
(
sk
)
->
dlc
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
int
err
,
size
;
int
err
;
int
sent
=
0
;
int
sent
=
0
;
if
(
msg
->
msg_flags
&
MSG_OOB
)
if
(
msg
->
msg_flags
&
MSG_OOB
)
...
@@ -501,7 +501,7 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
...
@@ -501,7 +501,7 @@ static int rfcomm_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
lock_sock
(
sk
);
lock_sock
(
sk
);
while
(
len
)
{
while
(
len
)
{
size
=
min_t
(
uint
,
len
,
d
->
mtu
);
size
_t
size
=
min
(
len
,
d
->
mtu
);
skb
=
sock_alloc_send_skb
(
sk
,
size
+
RFCOMM_SKB_RESERVE
,
skb
=
sock_alloc_send_skb
(
sk
,
size
+
RFCOMM_SKB_RESERVE
,
msg
->
msg_flags
&
MSG_DONTWAIT
,
&
err
);
msg
->
msg_flags
&
MSG_DONTWAIT
,
&
err
);
...
@@ -556,10 +556,11 @@ static long rfcomm_sock_data_wait(struct sock *sk, long timeo)
...
@@ -556,10 +556,11 @@ static long rfcomm_sock_data_wait(struct sock *sk, long timeo)
}
}
static
int
rfcomm_sock_recvmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
static
int
rfcomm_sock_recvmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
in
t
size
,
int
flags
)
struct
msghdr
*
msg
,
size_
t
size
,
int
flags
)
{
{
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
int
target
,
err
=
0
,
copied
=
0
;
int
err
=
0
;
size_t
target
,
copied
=
0
;
long
timeo
;
long
timeo
;
if
(
flags
&
MSG_OOB
)
if
(
flags
&
MSG_OOB
)
...
...
net/bluetooth/sco.c
View file @
39ae691d
...
@@ -630,7 +630,8 @@ static int sco_sock_getname(struct socket *sock, struct sockaddr *addr, int *len
...
@@ -630,7 +630,8 @@ static int sco_sock_getname(struct socket *sock, struct sockaddr *addr, int *len
return
0
;
return
0
;
}
}
static
int
sco_sock_sendmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
int
len
)
static
int
sco_sock_sendmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
size_t
len
)
{
{
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
int
err
=
0
;
int
err
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment