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
227158db
Commit
227158db
authored
Apr 06, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new helper: skb_copy_and_csum_datagram_msg()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
c33d23c2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
5 deletions
+9
-5
include/linux/skbuff.h
include/linux/skbuff.h
+5
-0
net/ipv4/udp.c
net/ipv4/udp.c
+2
-3
net/ipv6/raw.c
net/ipv6/raw.c
+1
-1
net/ipv6/udp.c
net/ipv6/udp.c
+1
-1
No files found.
include/linux/skbuff.h
View file @
227158db
...
...
@@ -2651,6 +2651,11 @@ static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset,
}
int
skb_copy_and_csum_datagram_iovec
(
struct
sk_buff
*
skb
,
int
hlen
,
struct
iovec
*
iov
);
static
inline
int
skb_copy_and_csum_datagram_msg
(
struct
sk_buff
*
skb
,
int
hlen
,
struct
msghdr
*
msg
)
{
return
skb_copy_and_csum_datagram_iovec
(
skb
,
hlen
,
msg
->
msg_iov
);
}
int
skb_copy_datagram_from_iovec
(
struct
sk_buff
*
skb
,
int
offset
,
const
struct
iovec
*
from
,
int
from_offset
,
int
len
);
...
...
net/ipv4/udp.c
View file @
227158db
...
...
@@ -1284,9 +1284,8 @@ int udp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
err
=
skb_copy_datagram_msg
(
skb
,
sizeof
(
struct
udphdr
),
msg
,
copied
);
else
{
err
=
skb_copy_and_csum_datagram_iovec
(
skb
,
sizeof
(
struct
udphdr
),
msg
->
msg_iov
);
err
=
skb_copy_and_csum_datagram_msg
(
skb
,
sizeof
(
struct
udphdr
),
msg
);
if
(
err
==
-
EINVAL
)
goto
csum_copy_err
;
...
...
net/ipv6/raw.c
View file @
227158db
...
...
@@ -492,7 +492,7 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk,
goto
csum_copy_err
;
err
=
skb_copy_datagram_msg
(
skb
,
0
,
msg
,
copied
);
}
else
{
err
=
skb_copy_and_csum_datagram_
iovec
(
skb
,
0
,
msg
->
msg_iov
);
err
=
skb_copy_and_csum_datagram_
msg
(
skb
,
0
,
msg
);
if
(
err
==
-
EINVAL
)
goto
csum_copy_err
;
}
...
...
net/ipv6/udp.c
View file @
227158db
...
...
@@ -428,7 +428,7 @@ int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
err
=
skb_copy_datagram_msg
(
skb
,
sizeof
(
struct
udphdr
),
msg
,
copied
);
else
{
err
=
skb_copy_and_csum_datagram_
iovec
(
skb
,
sizeof
(
struct
udphdr
),
msg
->
msg_iov
);
err
=
skb_copy_and_csum_datagram_
msg
(
skb
,
sizeof
(
struct
udphdr
),
msg
);
if
(
err
==
-
EINVAL
)
goto
csum_copy_err
;
}
...
...
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