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
9e91e1c7
Commit
9e91e1c7
authored
Jan 06, 2004
by
Andi Kleen
Committed by
David S. Miller
Jan 06, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[COMPAT]: Handle SO_TIMESTAMP cmsgs.
parent
439f31ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
net/compat.c
net/compat.c
+11
-1
No files found.
net/compat.c
View file @
9e91e1c7
...
@@ -215,15 +215,25 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg,
...
@@ -215,15 +215,25 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg,
int
put_cmsg_compat
(
struct
msghdr
*
kmsg
,
int
level
,
int
type
,
int
len
,
void
*
data
)
int
put_cmsg_compat
(
struct
msghdr
*
kmsg
,
int
level
,
int
type
,
int
len
,
void
*
data
)
{
{
struct
compat_timeval
ctv
;
struct
compat_cmsghdr
*
cm
=
(
struct
compat_cmsghdr
*
)
kmsg
->
msg_control
;
struct
compat_cmsghdr
*
cm
=
(
struct
compat_cmsghdr
*
)
kmsg
->
msg_control
;
struct
compat_cmsghdr
cmhdr
;
struct
compat_cmsghdr
cmhdr
;
int
cmlen
=
CMSG_COMPAT_LEN
(
len
)
;
int
cmlen
;
if
(
cm
==
NULL
||
kmsg
->
msg_controllen
<
sizeof
(
*
cm
))
{
if
(
cm
==
NULL
||
kmsg
->
msg_controllen
<
sizeof
(
*
cm
))
{
kmsg
->
msg_flags
|=
MSG_CTRUNC
;
kmsg
->
msg_flags
|=
MSG_CTRUNC
;
return
0
;
/* XXX: return error? check spec. */
return
0
;
/* XXX: return error? check spec. */
}
}
if
(
level
==
SOL_SOCKET
&&
type
==
SO_TIMESTAMP
)
{
struct
timeval
*
tv
=
(
struct
timeval
*
)
data
;
ctv
.
tv_sec
=
tv
->
tv_sec
;
ctv
.
tv_usec
=
tv
->
tv_usec
;
data
=
&
ctv
;
len
=
sizeof
(
struct
compat_timeval
);
}
cmlen
=
CMSG_COMPAT_LEN
(
len
);
if
(
kmsg
->
msg_controllen
<
cmlen
)
{
if
(
kmsg
->
msg_controllen
<
cmlen
)
{
kmsg
->
msg_flags
|=
MSG_CTRUNC
;
kmsg
->
msg_flags
|=
MSG_CTRUNC
;
cmlen
=
kmsg
->
msg_controllen
;
cmlen
=
kmsg
->
msg_controllen
;
...
...
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