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
Kirill Smelkov
linux
Commits
a7984945
Commit
a7984945
authored
Jan 08, 2004
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Use size_t for size argument in {send,recv}msg callchain.
parent
79d434c1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
18 deletions
+21
-18
include/linux/net.h
include/linux/net.h
+7
-7
include/net/sock.h
include/net/sock.h
+4
-4
net/core/sock.c
net/core/sock.c
+2
-2
net/socket.c
net/socket.c
+8
-5
No files found.
include/linux/net.h
View file @
a7984945
...
@@ -120,9 +120,9 @@ struct proto_ops {
...
@@ -120,9 +120,9 @@ struct proto_ops {
int
(
*
getsockopt
)(
struct
socket
*
sock
,
int
level
,
int
(
*
getsockopt
)(
struct
socket
*
sock
,
int
level
,
int
optname
,
char
__user
*
optval
,
int
__user
*
optlen
);
int
optname
,
char
__user
*
optval
,
int
__user
*
optlen
);
int
(
*
sendmsg
)
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
int
(
*
sendmsg
)
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
m
,
in
t
total_len
);
struct
msghdr
*
m
,
size_
t
total_len
);
int
(
*
recvmsg
)
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
int
(
*
recvmsg
)
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
m
,
in
t
total_len
,
struct
msghdr
*
m
,
size_
t
total_len
,
int
flags
);
int
flags
);
int
(
*
mmap
)
(
struct
file
*
file
,
struct
socket
*
sock
,
int
(
*
mmap
)
(
struct
file
*
file
,
struct
socket
*
sock
,
struct
vm_area_struct
*
vma
);
struct
vm_area_struct
*
vma
);
...
@@ -151,13 +151,13 @@ extern int sock_create(int family, int type, int proto,
...
@@ -151,13 +151,13 @@ extern int sock_create(int family, int type, int proto,
struct
socket
**
res
);
struct
socket
**
res
);
extern
void
sock_release
(
struct
socket
*
sock
);
extern
void
sock_release
(
struct
socket
*
sock
);
extern
int
sock_sendmsg
(
struct
socket
*
sock
,
struct
msghdr
*
msg
,
extern
int
sock_sendmsg
(
struct
socket
*
sock
,
struct
msghdr
*
msg
,
in
t
len
);
size_
t
len
);
extern
int
sock_recvmsg
(
struct
socket
*
sock
,
struct
msghdr
*
msg
,
extern
int
sock_recvmsg
(
struct
socket
*
sock
,
struct
msghdr
*
msg
,
in
t
size
,
int
flags
);
size_
t
size
,
int
flags
);
extern
int
sock_readv_writev
(
int
type
,
struct
inode
*
inode
,
extern
int
sock_readv_writev
(
int
type
,
struct
inode
*
inode
,
struct
file
*
file
,
struct
file
*
file
,
const
struct
iovec
*
iov
,
long
count
,
const
struct
iovec
*
iov
,
long
count
,
long
size
);
size_t
size
);
extern
int
sock_map_fd
(
struct
socket
*
sock
);
extern
int
sock_map_fd
(
struct
socket
*
sock
);
extern
struct
socket
*
sockfd_lookup
(
int
fd
,
int
*
err
);
extern
struct
socket
*
sockfd_lookup
(
int
fd
,
int
*
err
);
#define sockfd_put(sock) fput(sock->file)
#define sockfd_put(sock) fput(sock->file)
...
@@ -216,9 +216,9 @@ SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \
...
@@ -216,9 +216,9 @@ SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \
char *optval, int optlen), (sock, level, optname, optval, optlen)) \
char *optval, int optlen), (sock, level, optname, optval, optlen)) \
SOCKCALL_WRAP(name, getsockopt, (struct socket *sock, int level, int optname, \
SOCKCALL_WRAP(name, getsockopt, (struct socket *sock, int level, int optname, \
char *optval, int *optlen), (sock, level, optname, optval, optlen)) \
char *optval, int *optlen), (sock, level, optname, optval, optlen)) \
SOCKCALL_WRAP(name, sendmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m,
in
t len), \
SOCKCALL_WRAP(name, sendmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m,
size_
t len), \
(iocb, sock, m, len)) \
(iocb, sock, m, len)) \
SOCKCALL_WRAP(name, recvmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m,
in
t len, int flags), \
SOCKCALL_WRAP(name, recvmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m,
size_
t len, int flags), \
(iocb, sock, m, len, flags)) \
(iocb, sock, m, len, flags)) \
SOCKCALL_WRAP(name, mmap, (struct file *file, struct socket *sock, struct vm_area_struct *vma), \
SOCKCALL_WRAP(name, mmap, (struct file *file, struct socket *sock, struct vm_area_struct *vma), \
(file, sock, vma)) \
(file, sock, vma)) \
...
...
include/net/sock.h
View file @
a7984945
...
@@ -418,10 +418,10 @@ struct proto {
...
@@ -418,10 +418,10 @@ struct proto {
int
optname
,
char
*
optval
,
int
optname
,
char
*
optval
,
int
*
option
);
int
*
option
);
int
(
*
sendmsg
)(
struct
kiocb
*
iocb
,
struct
sock
*
sk
,
int
(
*
sendmsg
)(
struct
kiocb
*
iocb
,
struct
sock
*
sk
,
struct
msghdr
*
msg
,
in
t
len
);
struct
msghdr
*
msg
,
size_
t
len
);
int
(
*
recvmsg
)(
struct
kiocb
*
iocb
,
struct
sock
*
sk
,
int
(
*
recvmsg
)(
struct
kiocb
*
iocb
,
struct
sock
*
sk
,
struct
msghdr
*
msg
,
struct
msghdr
*
msg
,
in
t
len
,
int
noblock
,
int
flags
,
size_
t
len
,
int
noblock
,
int
flags
,
int
*
addr_len
);
int
*
addr_len
);
int
(
*
sendpage
)(
struct
sock
*
sk
,
struct
page
*
page
,
int
(
*
sendpage
)(
struct
sock
*
sk
,
struct
page
*
page
,
int
offset
,
size_t
size
,
int
flags
);
int
offset
,
size_t
size
,
int
flags
);
...
@@ -609,9 +609,9 @@ extern int sock_no_getsockopt(struct socket *, int , int,
...
@@ -609,9 +609,9 @@ extern int sock_no_getsockopt(struct socket *, int , int,
extern
int
sock_no_setsockopt
(
struct
socket
*
,
int
,
int
,
extern
int
sock_no_setsockopt
(
struct
socket
*
,
int
,
int
,
char
*
,
int
);
char
*
,
int
);
extern
int
sock_no_sendmsg
(
struct
kiocb
*
,
struct
socket
*
,
extern
int
sock_no_sendmsg
(
struct
kiocb
*
,
struct
socket
*
,
struct
msghdr
*
,
in
t
);
struct
msghdr
*
,
size_
t
);
extern
int
sock_no_recvmsg
(
struct
kiocb
*
,
struct
socket
*
,
extern
int
sock_no_recvmsg
(
struct
kiocb
*
,
struct
socket
*
,
struct
msghdr
*
,
in
t
,
int
);
struct
msghdr
*
,
size_
t
,
int
);
extern
int
sock_no_mmap
(
struct
file
*
file
,
extern
int
sock_no_mmap
(
struct
file
*
file
,
struct
socket
*
sock
,
struct
socket
*
sock
,
struct
vm_area_struct
*
vma
);
struct
vm_area_struct
*
vma
);
...
...
net/core/sock.c
View file @
a7984945
...
@@ -966,13 +966,13 @@ int sock_no_getsockopt(struct socket *sock, int level, int optname,
...
@@ -966,13 +966,13 @@ int sock_no_getsockopt(struct socket *sock, int level, int optname,
}
}
int
sock_no_sendmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
m
,
int
sock_no_sendmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
m
,
int
flags
)
size_t
len
)
{
{
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
}
}
int
sock_no_recvmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
m
,
int
sock_no_recvmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
m
,
in
t
len
,
int
flags
)
size_
t
len
,
int
flags
)
{
{
return
-
EOPNOTSUPP
;
return
-
EOPNOTSUPP
;
}
}
...
...
net/socket.c
View file @
a7984945
...
@@ -523,7 +523,8 @@ void sock_release(struct socket *sock)
...
@@ -523,7 +523,8 @@ void sock_release(struct socket *sock)
sock
->
file
=
NULL
;
sock
->
file
=
NULL
;
}
}
static
inline
int
__sock_sendmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
int
size
)
static
inline
int
__sock_sendmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
size_t
size
)
{
{
struct
sock_iocb
*
si
=
kiocb_to_siocb
(
iocb
);
struct
sock_iocb
*
si
=
kiocb_to_siocb
(
iocb
);
int
err
;
int
err
;
...
@@ -540,7 +541,7 @@ static inline int __sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct
...
@@ -540,7 +541,7 @@ static inline int __sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct
return
sock
->
ops
->
sendmsg
(
iocb
,
sock
,
msg
,
size
);
return
sock
->
ops
->
sendmsg
(
iocb
,
sock
,
msg
,
size
);
}
}
int
sock_sendmsg
(
struct
socket
*
sock
,
struct
msghdr
*
msg
,
in
t
size
)
int
sock_sendmsg
(
struct
socket
*
sock
,
struct
msghdr
*
msg
,
size_
t
size
)
{
{
struct
kiocb
iocb
;
struct
kiocb
iocb
;
int
ret
;
int
ret
;
...
@@ -553,7 +554,8 @@ int sock_sendmsg(struct socket *sock, struct msghdr *msg, int size)
...
@@ -553,7 +554,8 @@ int sock_sendmsg(struct socket *sock, struct msghdr *msg, int size)
}
}
static
inline
int
__sock_recvmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
int
size
,
int
flags
)
static
inline
int
__sock_recvmsg
(
struct
kiocb
*
iocb
,
struct
socket
*
sock
,
struct
msghdr
*
msg
,
size_t
size
,
int
flags
)
{
{
int
err
;
int
err
;
struct
sock_iocb
*
si
=
kiocb_to_siocb
(
iocb
);
struct
sock_iocb
*
si
=
kiocb_to_siocb
(
iocb
);
...
@@ -571,7 +573,8 @@ static inline int __sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct
...
@@ -571,7 +573,8 @@ static inline int __sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct
return
sock
->
ops
->
recvmsg
(
iocb
,
sock
,
msg
,
size
,
flags
);
return
sock
->
ops
->
recvmsg
(
iocb
,
sock
,
msg
,
size
,
flags
);
}
}
int
sock_recvmsg
(
struct
socket
*
sock
,
struct
msghdr
*
msg
,
int
size
,
int
flags
)
int
sock_recvmsg
(
struct
socket
*
sock
,
struct
msghdr
*
msg
,
size_t
size
,
int
flags
)
{
{
struct
kiocb
iocb
;
struct
kiocb
iocb
;
int
ret
;
int
ret
;
...
@@ -668,7 +671,7 @@ ssize_t sock_sendpage(struct file *file, struct page *page,
...
@@ -668,7 +671,7 @@ ssize_t sock_sendpage(struct file *file, struct page *page,
}
}
int
sock_readv_writev
(
int
type
,
struct
inode
*
inode
,
struct
file
*
file
,
int
sock_readv_writev
(
int
type
,
struct
inode
*
inode
,
struct
file
*
file
,
const
struct
iovec
*
iov
,
long
count
,
long
size
)
const
struct
iovec
*
iov
,
long
count
,
size_t
size
)
{
{
struct
msghdr
msg
;
struct
msghdr
msg
;
struct
socket
*
sock
;
struct
socket
*
sock
;
...
...
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